summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-07-15 17:01:41 +0000
committerAdrian Prantl <aprantl@apple.com>2015-07-15 17:01:41 +0000
commitee5feafc0f467102cd12e8be82b54cc23158beb1 (patch)
tree49ccb84fd5335ff36fd92ac1346313d038c97fda /llvm/lib/IR
parent5b4acbd6b6bceaa3ea25b237168b434a24e1181d (diff)
downloadbcm5719-llvm-ee5feafc0f467102cd12e8be82b54cc23158beb1.tar.gz
bcm5719-llvm-ee5feafc0f467102cd12e8be82b54cc23158beb1.zip
Debug Info: Add basic support for external types references.
This is a necessary prerequisite for bootstrapping the emission of debug info inside modules. - Adds a FlagExternalTypeRef to DICompositeType. External types must have a unique identifier. - External type references are emitted using a forward declaration with a DW_AT_signature([DW_FORM_ref_sig8]) based on the UID. http://reviews.llvm.org/D9612 llvm-svn: 242302
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/DIBuilder.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/IR/DIBuilder.cpp b/llvm/lib/IR/DIBuilder.cpp
index 2a90e70af1a..28a8d567c22 100644
--- a/llvm/lib/IR/DIBuilder.cpp
+++ b/llvm/lib/IR/DIBuilder.cpp
@@ -435,6 +435,18 @@ DISubroutineType *DIBuilder::createSubroutineType(DIFile *File,
return DISubroutineType::get(VMContext, Flags, ParameterTypes);
}
+DICompositeType *DIBuilder::createExternalTypeRef(unsigned Tag, DIFile *File,
+ StringRef UniqueIdentifier) {
+ assert(!UniqueIdentifier.empty() && "external type ref without uid");
+ auto *CTy =
+ DICompositeType::get(VMContext, Tag, "", nullptr, 0, nullptr, nullptr, 0,
+ 0, 0, DINode::FlagExternalTypeRef, nullptr, 0,
+ nullptr, nullptr, UniqueIdentifier);
+ // Types with unique IDs need to be in the type map.
+ retainType(CTy);
+ return CTy;
+}
+
DICompositeType *DIBuilder::createEnumerationType(
DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
uint64_t SizeInBits, uint64_t AlignInBits, DINodeArray Elements,
OpenPOWER on IntegriCloud