diff options
author | Devang Patel <dpatel@apple.com> | 2010-10-28 22:03:20 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-10-28 22:03:20 +0000 |
commit | 532105f0257ec73e9bf75a3036bac1b37b5a5643 (patch) | |
tree | 71380273a2c74c152f7485bc355b4b04d09795b2 /lib/CodeGen/CGDebugInfo.cpp | |
parent | 46ec70e2e6541a067d33b2513505bec74582b53c (diff) |
Basic types are language defined builtins. They are always defined at top most level.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117613 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 97639db887..46d1447c62 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -179,6 +179,12 @@ llvm::DIFile CGDebugInfo::getOrCreateFile(SourceLocation Loc) { } +/// getOrCreateMainFile - Get the file info for main compile unit. +llvm::DIFile CGDebugInfo::getOrCreateMainFile() { + return DebugFactory.CreateFile(TheCU.getFilename(), TheCU.getDirectory(), + TheCU); +} + /// getLineNumber - Get line number for the location. If location is invalid /// then use current location. unsigned CGDebugInfo::getLineNumber(SourceLocation Loc) { @@ -340,10 +346,9 @@ llvm::DIType CGDebugInfo::CreateType(const BuiltinType *BT, uint64_t Size = CGM.getContext().getTypeSize(BT); uint64_t Align = CGM.getContext().getTypeAlign(BT); uint64_t Offset = 0; - llvm::DIType DbgTy = - DebugFactory.CreateBasicType(Unit, BTName, - Unit, 0, Size, Align, + DebugFactory.CreateBasicType(TheCU, BTName, getOrCreateMainFile(), + 0, Size, Align, Offset, /*flags*/ 0, Encoding); return DbgTy; } @@ -360,9 +365,8 @@ llvm::DIType CGDebugInfo::CreateType(const ComplexType *Ty, uint64_t Offset = 0; llvm::DIType DbgTy = - DebugFactory.CreateBasicType(Unit, "complex", - Unit, 0, Size, Align, - Offset, /*flags*/ 0, Encoding); + DebugFactory.CreateBasicType(TheCU, "complex", getOrCreateMainFile(), + 0, Size, Align, Offset, /*flags*/ 0, Encoding); return DbgTy; } |