summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-07 00:39:59 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-07 00:39:59 +0000
commit329f8219cde304324d9b725494764e037f79cfec (patch)
tree000498c92acfffa9a129e3c9c34f00baf056a81d
parent6f6cc8c81f2a12c7e32fedeec7ccac1daea99d2b (diff)
IR: Rename MDSubrange::getLo() to getLowerBound()
During initial review, the `lo:` field was renamed to `lowerBound:`. Make the same change to the C++ API. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234267 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/IR/DebugInfo.h2
-rw-r--r--include/llvm/IR/DebugInfoMetadata.h19
-rw-r--r--lib/Bitcode/Writer/BitcodeWriter.cpp2
-rw-r--r--lib/IR/AsmWriter.cpp2
-rw-r--r--lib/IR/LLVMContextImpl.h12
-rw-r--r--unittests/IR/MetadataTest.cpp4
6 files changed, 23 insertions, 18 deletions
diff --git a/include/llvm/IR/DebugInfo.h b/include/llvm/IR/DebugInfo.h
index b193ee013a7..56b60db8966 100644
--- a/include/llvm/IR/DebugInfo.h
+++ b/include/llvm/IR/DebugInfo.h
@@ -175,7 +175,7 @@ public:
return *get();
}
- int64_t getLo() const { return get()->getLo(); }
+ int64_t getLo() const { return get()->getLowerBound(); }
int64_t getCount() const { return get()->getCount(); }
};
diff --git a/include/llvm/IR/DebugInfoMetadata.h b/include/llvm/IR/DebugInfoMetadata.h
index 394c70ee950..c5018e54e8d 100644
--- a/include/llvm/IR/DebugInfoMetadata.h
+++ b/include/llvm/IR/DebugInfoMetadata.h
@@ -303,27 +303,30 @@ class MDSubrange : public DebugNode {
friend class MDNode;
int64_t Count;
- int64_t Lo;
+ int64_t LowerBound;
- MDSubrange(LLVMContext &C, StorageType Storage, int64_t Count, int64_t Lo)
+ MDSubrange(LLVMContext &C, StorageType Storage, int64_t Count,
+ int64_t LowerBound)
: DebugNode(C, MDSubrangeKind, Storage, dwarf::DW_TAG_subrange_type,
None),
- Count(Count), Lo(Lo) {}
+ Count(Count), LowerBound(LowerBound) {}
~MDSubrange() {}
- static MDSubrange *getImpl(LLVMContext &Context, int64_t Count, int64_t Lo,
- StorageType Storage, bool ShouldCreate = true);
+ static MDSubrange *getImpl(LLVMContext &Context, int64_t Count,
+ int64_t LowerBound, StorageType Storage,
+ bool ShouldCreate = true);
TempMDSubrange cloneImpl() const {
- return getTemporary(getContext(), getCount(), getLo());
+ return getTemporary(getContext(), getCount(), getLowerBound());
}
public:
- DEFINE_MDNODE_GET(MDSubrange, (int64_t Count, int64_t Lo = 0), (Count, Lo))
+ DEFINE_MDNODE_GET(MDSubrange, (int64_t Count, int64_t LowerBound = 0),
+ (Count, LowerBound))
TempMDSubrange clone() const { return cloneImpl(); }
- int64_t getLo() const { return Lo; }
+ int64_t getLowerBound() const { return LowerBound; }
int64_t getCount() const { return Count; }
static bool classof(const Metadata *MD) {
diff --git a/lib/Bitcode/Writer/BitcodeWriter.cpp b/lib/Bitcode/Writer/BitcodeWriter.cpp
index 71ba01e6668..d1863672f12 100644
--- a/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -821,7 +821,7 @@ static void WriteMDSubrange(const MDSubrange *N, const ValueEnumerator &,
unsigned Abbrev) {
Record.push_back(N->isDistinct());
Record.push_back(N->getCount());
- Record.push_back(rotateSign(N->getLo()));
+ Record.push_back(rotateSign(N->getLowerBound()));
Stream.EmitRecord(bitc::METADATA_SUBRANGE, Record, Abbrev);
Record.clear();
diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp
index 966cd608604..4250a95a09f 100644
--- a/lib/IR/AsmWriter.cpp
+++ b/lib/IR/AsmWriter.cpp
@@ -1505,7 +1505,7 @@ static void writeMDSubrange(raw_ostream &Out, const MDSubrange *N,
Out << "!MDSubrange(";
MDFieldPrinter Printer(Out);
Printer.printInt("count", N->getCount(), /* ShouldSkipZero */ false);
- Printer.printInt("lowerBound", N->getLo());
+ Printer.printInt("lowerBound", N->getLowerBound());
Out << ")";
}
diff --git a/lib/IR/LLVMContextImpl.h b/lib/IR/LLVMContextImpl.h
index dfb8faabb15..6f9a3e1f639 100644
--- a/lib/IR/LLVMContextImpl.h
+++ b/lib/IR/LLVMContextImpl.h
@@ -275,15 +275,17 @@ template <> struct MDNodeKeyImpl<GenericDebugNode> : MDNodeOpsKey {
template <> struct MDNodeKeyImpl<MDSubrange> {
int64_t Count;
- int64_t Lo;
+ int64_t LowerBound;
- MDNodeKeyImpl(int64_t Count, int64_t Lo) : Count(Count), Lo(Lo) {}
- MDNodeKeyImpl(const MDSubrange *N) : Count(N->getCount()), Lo(N->getLo()) {}
+ MDNodeKeyImpl(int64_t Count, int64_t LowerBound)
+ : Count(Count), LowerBound(LowerBound) {}
+ MDNodeKeyImpl(const MDSubrange *N)
+ : Count(N->getCount()), LowerBound(N->getLowerBound()) {}
bool isKeyOf(const MDSubrange *RHS) const {
- return Count == RHS->getCount() && Lo == RHS->getLo();
+ return Count == RHS->getCount() && LowerBound == RHS->getLowerBound();
}
- unsigned getHashValue() const { return hash_combine(Count, Lo); }
+ unsigned getHashValue() const { return hash_combine(Count, LowerBound); }
};
template <> struct MDNodeKeyImpl<MDEnumerator> {
diff --git a/unittests/IR/MetadataTest.cpp b/unittests/IR/MetadataTest.cpp
index 27699f83f63..694b08bae5c 100644
--- a/unittests/IR/MetadataTest.cpp
+++ b/unittests/IR/MetadataTest.cpp
@@ -848,7 +848,7 @@ TEST_F(MDSubrangeTest, get) {
auto *N = MDSubrange::get(Context, 5, 7);
EXPECT_EQ(dwarf::DW_TAG_subrange_type, N->getTag());
EXPECT_EQ(5, N->getCount());
- EXPECT_EQ(7, N->getLo());
+ EXPECT_EQ(7, N->getLowerBound());
EXPECT_EQ(N, MDSubrange::get(Context, 5, 7));
EXPECT_EQ(MDSubrange::get(Context, 5, 0), MDSubrange::get(Context, 5));
@@ -860,7 +860,7 @@ TEST_F(MDSubrangeTest, getEmptyArray) {
auto *N = MDSubrange::get(Context, -1, 0);
EXPECT_EQ(dwarf::DW_TAG_subrange_type, N->getTag());
EXPECT_EQ(-1, N->getCount());
- EXPECT_EQ(0, N->getLo());
+ EXPECT_EQ(0, N->getLowerBound());
EXPECT_EQ(N, MDSubrange::get(Context, -1, 0));
}