summaryrefslogtreecommitdiff
path: root/lib/IR/DebugInfoMetadata.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-07-05 14:21:36 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-07-05 14:21:36 +0000
commit1a82d4c088707c791c792f6822f611b47a12bdfe (patch)
tree7c411f9b5d807f7f204fdd16965d8925a82b6d18 /lib/IR/DebugInfoMetadata.cpp
parent3a0822f094b578157263e04114075ad7df81db41 (diff)
Notes
Diffstat (limited to 'lib/IR/DebugInfoMetadata.cpp')
-rw-r--r--lib/IR/DebugInfoMetadata.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/IR/DebugInfoMetadata.cpp b/lib/IR/DebugInfoMetadata.cpp
index 8b9857d373b9..5e017488c1fb 100644
--- a/lib/IR/DebugInfoMetadata.cpp
+++ b/lib/IR/DebugInfoMetadata.cpp
@@ -138,6 +138,9 @@ DIScopeRef DIScope::getScope() const {
if (auto *NS = dyn_cast<DINamespace>(this))
return DIScopeRef(NS->getScope());
+ if (auto *M = dyn_cast<DIModule>(this))
+ return DIScopeRef(M->getScope());
+
assert((isa<DIFile>(this) || isa<DICompileUnit>(this)) &&
"Unhandled type of scope.");
return nullptr;
@@ -150,6 +153,8 @@ StringRef DIScope::getName() const {
return SP->getName();
if (auto *NS = dyn_cast<DINamespace>(this))
return NS->getName();
+ if (auto *M = dyn_cast<DIModule>(this))
+ return M->getName();
assert((isa<DILexicalBlockBase>(this) || isa<DIFile>(this) ||
isa<DICompileUnit>(this)) &&
"Unhandled type of scope.");
@@ -410,6 +415,18 @@ DINamespace *DINamespace::getImpl(LLVMContext &Context, Metadata *Scope,
DEFINE_GETIMPL_STORE(DINamespace, (Line), Ops);
}
+DIModule *DIModule::getImpl(LLVMContext &Context, Metadata *Scope,
+ MDString *Name, MDString *ConfigurationMacros,
+ MDString *IncludePath, MDString *ISysRoot,
+ StorageType Storage, bool ShouldCreate) {
+ assert(isCanonical(Name) && "Expected canonical MDString");
+ DEFINE_GETIMPL_LOOKUP(DIModule,
+ (Scope, getString(Name), getString(ConfigurationMacros),
+ getString(IncludePath), getString(ISysRoot)));
+ Metadata *Ops[] = {Scope, Name, ConfigurationMacros, IncludePath, ISysRoot};
+ DEFINE_GETIMPL_STORE_NO_CONSTRUCTOR_ARGS(DIModule, Ops);
+}
+
DITemplateTypeParameter *DITemplateTypeParameter::getImpl(LLVMContext &Context,
MDString *Name,
Metadata *Type,