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 | ed23f18d7e09c2b2be567a59aeb440c93fda5327 (patch) | |
| tree | 68fd30227ca24c2f7fb4cb431bff741781caebdf /clang/lib | |
| parent | 3cc8751d59ce63debd169e6a4ba1a3002724b4d5 (diff) | |
| download | bcm5719-llvm-ed23f18d7e09c2b2be567a59aeb440c93fda5327.tar.gz bcm5719-llvm-ed23f18d7e09c2b2be567a59aeb440c93fda5327.zip | |
Basic types are language defined builtins. They are always defined at top most level.
llvm-svn: 117613
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 16 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.h | 3 |
2 files changed, 13 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 97639db887a..46d1447c62c 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/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; } diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h index 55e2f0a480a..d4beae1c38d 100644 --- a/clang/lib/CodeGen/CGDebugInfo.h +++ b/clang/lib/CodeGen/CGDebugInfo.h @@ -218,6 +218,9 @@ private: /// location. llvm::DIFile getOrCreateFile(SourceLocation Loc); + /// getOrCreateMainFile - Get the file info for main compile unit. + llvm::DIFile getOrCreateMainFile(); + /// getOrCreateType - Get the type from the cache or create a new type if /// necessary. llvm::DIType getOrCreateType(QualType Ty, llvm::DIFile F); |

