[llvm] r234267 - IR: Rename MDSubrange::getLo() to getLowerBound()
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Apr 6 17:39:59 PDT 2015
Author: dexonsmith
Date: Mon Apr 6 19:39:59 2015
New Revision: 234267
URL: http://llvm.org/viewvc/llvm-project?rev=234267&view=rev
Log:
IR: Rename MDSubrange::getLo() to getLowerBound()
During initial review, the `lo:` field was renamed to `lowerBound:`.
Make the same change to the C++ API.
Modified:
llvm/trunk/include/llvm/IR/DebugInfo.h
llvm/trunk/include/llvm/IR/DebugInfoMetadata.h
llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/trunk/lib/IR/AsmWriter.cpp
llvm/trunk/lib/IR/LLVMContextImpl.h
llvm/trunk/unittests/IR/MetadataTest.cpp
Modified: llvm/trunk/include/llvm/IR/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfo.h?rev=234267&r1=234266&r2=234267&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/IR/DebugInfo.h Mon Apr 6 19:39:59 2015
@@ -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(); }
};
Modified: llvm/trunk/include/llvm/IR/DebugInfoMetadata.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/DebugInfoMetadata.h?rev=234267&r1=234266&r2=234267&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/DebugInfoMetadata.h (original)
+++ llvm/trunk/include/llvm/IR/DebugInfoMetadata.h Mon Apr 6 19:39:59 2015
@@ -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) {
Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=234267&r1=234266&r2=234267&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Mon Apr 6 19:39:59 2015
@@ -821,7 +821,7 @@ static void WriteMDSubrange(const MDSubr
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();
Modified: llvm/trunk/lib/IR/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=234267&r1=234266&r2=234267&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AsmWriter.cpp (original)
+++ llvm/trunk/lib/IR/AsmWriter.cpp Mon Apr 6 19:39:59 2015
@@ -1505,7 +1505,7 @@ static void writeMDSubrange(raw_ostream
Out << "!MDSubrange(";
MDFieldPrinter Printer(Out);
Printer.printInt("count", N->getCount(), /* ShouldSkipZero */ false);
- Printer.printInt("lowerBound", N->getLo());
+ Printer.printInt("lowerBound", N->getLowerBound());
Out << ")";
}
Modified: llvm/trunk/lib/IR/LLVMContextImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/LLVMContextImpl.h?rev=234267&r1=234266&r2=234267&view=diff
==============================================================================
--- llvm/trunk/lib/IR/LLVMContextImpl.h (original)
+++ llvm/trunk/lib/IR/LLVMContextImpl.h Mon Apr 6 19:39:59 2015
@@ -275,15 +275,17 @@ template <> struct MDNodeKeyImpl<Generic
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> {
Modified: llvm/trunk/unittests/IR/MetadataTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/IR/MetadataTest.cpp?rev=234267&r1=234266&r2=234267&view=diff
==============================================================================
--- llvm/trunk/unittests/IR/MetadataTest.cpp (original)
+++ llvm/trunk/unittests/IR/MetadataTest.cpp Mon Apr 6 19:39:59 2015
@@ -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));
}
More information about the llvm-commits
mailing list