summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-19 04:55:25 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-19 04:55:25 +0000
commited8fdb2a0e9503abbac7c0927d2915cd8bac03d2 (patch)
treeada4253e3e564ec1531ca53c5eab3b9fb329f485 /llvm/lib
parent51a9bd2e110f43eb9df14e1daffd89fd0332b9f0 (diff)
downloadbcm5719-llvm-ed8fdb2a0e9503abbac7c0927d2915cd8bac03d2.tar.gz
bcm5719-llvm-ed8fdb2a0e9503abbac7c0927d2915cd8bac03d2.zip
IR: Rename API for enabling ODR uniquing of DITypes, NFC
As per David's review, rename everything in the new API for ODR type uniquing of debug info. ensureDITypeMap => enableDebugTypeODRUniquing destroyDITypeMap => disableDebugTypeODRUniquing hasDITypeMap => isODRUniquingDebugTypes llvm-svn: 266713
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp2
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp2
-rw-r--r--llvm/lib/IR/LLVMContext.cpp10
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp2
4 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index 34f7ec4469b..987ab5de967 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -3843,7 +3843,7 @@ bool LLParser::ParseDICompositeType(MDNode *&Result, bool IsDistinct) {
// type map in the context.
DIType **MappedT = nullptr;
if (!(flags.Val & DINode::FlagFwdDecl) && identifier.Val &&
- (MappedT = Context.getOrInsertDITypeMapping(*identifier.Val)) &&
+ (MappedT = Context.getOrInsertODRUniquedType(*identifier.Val)) &&
*MappedT) {
Result = *MappedT;
return false;
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 18386ed0727..1a83359b6e8 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -2194,7 +2194,7 @@ std::error_code BitcodeReader::parseMetadata(bool ModuleLevel) {
auto *Identifier = getMDString(Record[15]);
DIType **MappedT = nullptr;
if (!(Flags & DINode::FlagFwdDecl) && Identifier)
- MappedT = Context.getOrInsertDITypeMapping(*Identifier);
+ MappedT = Context.getOrInsertODRUniquedType(*Identifier);
// Use the mapped type node, or create a new one if necessary.
DIType *CT = MappedT ? *MappedT : nullptr;
diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp
index 3fc79ed03c3..e166a551ade 100644
--- a/llvm/lib/IR/LLVMContext.cpp
+++ b/llvm/lib/IR/LLVMContext.cpp
@@ -311,19 +311,19 @@ bool LLVMContext::shouldDiscardValueNames() const {
return pImpl->DiscardValueNames;
}
-bool LLVMContext::hasDITypeMap() const { return !!pImpl->DITypeMap; }
+bool LLVMContext::isODRUniquingDebugTypes() const { return !!pImpl->DITypeMap; }
-void LLVMContext::ensureDITypeMap() {
+void LLVMContext::enableDebugTypeODRUniquing() {
if (pImpl->DITypeMap)
return;
pImpl->DITypeMap = llvm::make_unique<DenseMap<const MDString *, DIType *>>();
}
-void LLVMContext::destroyDITypeMap() { pImpl->DITypeMap.reset(); }
+void LLVMContext::disableDebugTypeODRUniquing() { pImpl->DITypeMap.reset(); }
-DIType **LLVMContext::getOrInsertDITypeMapping(const MDString &S) {
- if (!hasDITypeMap())
+DIType **LLVMContext::getOrInsertODRUniquedType(const MDString &S) {
+ if (!isODRUniquingDebugTypes())
return nullptr;
return &(*pImpl->DITypeMap)[&S];
}
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index a1d4d7bd101..e06903ca37b 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -84,7 +84,7 @@ LTOCodeGenerator::LTOCodeGenerator(LLVMContext &Context)
: Context(Context), MergedModule(new Module("ld-temp.o", Context)),
TheLinker(new Linker(*MergedModule)) {
Context.setDiscardValueNames(LTODiscardValueNames);
- Context.ensureDITypeMap();
+ Context.enableDebugTypeODRUniquing();
initializeLTOPasses();
}
OpenPOWER on IntegriCloud