summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-06-03 17:04:51 +0000
committerDevang Patel <dpatel@apple.com>2011-06-03 17:04:51 +0000
commit1d40024322d9e3eb903a9bded4d0c1c87f6cc026 (patch)
treea33b9e01bb76817689b9bb5be4fcea8ebb4b73d6
parent6a11b64c5ee4210bbb510a976eb7cf6f01a081fb (diff)
downloadbcm5719-llvm-1d40024322d9e3eb903a9bded4d0c1c87f6cc026.tar.gz
bcm5719-llvm-1d40024322d9e3eb903a9bded4d0c1c87f6cc026.zip
A typedef's context is not the same as type's context. It is the context of typedef decl itself. Use extra parameter to communicate this to DIBuilder.
llvm-svn: 132556
-rw-r--r--llvm/include/llvm/Analysis/DIBuilder.h3
-rw-r--r--llvm/lib/Analysis/DIBuilder.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/llvm/include/llvm/Analysis/DIBuilder.h b/llvm/include/llvm/Analysis/DIBuilder.h
index 5846dbff041..96c6587ef3e 100644
--- a/llvm/include/llvm/Analysis/DIBuilder.h
+++ b/llvm/include/llvm/Analysis/DIBuilder.h
@@ -117,8 +117,9 @@ namespace llvm {
/// @param Name Typedef name.
/// @param File File where this type is defined.
/// @param LineNo Line number.
+ /// @param Context The surrounding context for the typedef.
DIType createTypedef(DIType Ty, StringRef Name, DIFile File,
- unsigned LineNo);
+ unsigned LineNo, DIDescriptor Context);
/// createFriend - Create debugging information entry for a 'friend'.
DIType createFriend(DIType Ty, DIType FriendTy);
diff --git a/llvm/lib/Analysis/DIBuilder.cpp b/llvm/lib/Analysis/DIBuilder.cpp
index 1375e497ac6..ef5d03a0713 100644
--- a/llvm/lib/Analysis/DIBuilder.cpp
+++ b/llvm/lib/Analysis/DIBuilder.cpp
@@ -160,12 +160,12 @@ DIType DIBuilder::createReferenceType(DIType RTy) {
/// createTypedef - Create debugging information entry for a typedef.
DIType DIBuilder::createTypedef(DIType Ty, StringRef Name, DIFile File,
- unsigned LineNo) {
+ unsigned LineNo, DIDescriptor Context) {
// typedefs are encoded in DIDerivedType format.
assert(Ty.Verify() && "Invalid typedef type!");
Value *Elts[] = {
GetTagConstant(VMContext, dwarf::DW_TAG_typedef),
- Ty.getContext(),
+ Context,
MDString::get(VMContext, Name),
File,
ConstantInt::get(Type::getInt32Ty(VMContext), LineNo),
OpenPOWER on IntegriCloud