diff options
author | Devang Patel <dpatel@apple.com> | 2010-07-24 00:59:16 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-07-24 00:59:16 +0000 |
commit | 268ad093a7ae4633fec3b2525a1c7d66715e0553 (patch) | |
tree | 2dea6d1f8fa978856a8f95d4ded1e7172d181d05 /clang/lib/CodeGen/CGDebugInfo.h | |
parent | 498877d055a82e82e1e7a0cc7dbd37e4f3240ded (diff) | |
download | bcm5719-llvm-268ad093a7ae4633fec3b2525a1c7d66715e0553.tar.gz bcm5719-llvm-268ad093a7ae4633fec3b2525a1c7d66715e0553.zip |
Untangle filename/dirname confusion. Store constructed strings on the side. Avoid use of Path.makeAbsolute().
DW_TAG_compile_unit uses two attributes DW_AT_name and DW_AT_comp_dir. Their expected values are:
$ clang foo.c -g
DW_AT_name - foo.c
DW_AT_comp_dir - `pwd`
$ clang one/two/foo.c -g
DW_AT_name - one/two/foo.c
DW_AT_comp_dir - `pwd`
$ clang /tmp/one/foo.c -g
DW_AT_name - /tmp/one/foo.c
DW_AT_comp_dir - empty
llvm-svn: 109303
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.h')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h index fdfd3dca571..fc296acf453 100644 --- a/clang/lib/CodeGen/CGDebugInfo.h +++ b/clang/lib/CodeGen/CGDebugInfo.h @@ -70,6 +70,7 @@ class CGDebugInfo { /// DebugInfoNames - This is a storage for names that are /// constructed on demand. For example, C++ destructors, C++ operators etc.. llvm::BumpPtrAllocator DebugInfoNames; + llvm::StringRef CWDName; llvm::DenseMap<const char *, llvm::WeakVH> DIFileCache; llvm::DenseMap<const FunctionDecl *, llvm::WeakVH> SPCache; @@ -198,6 +199,13 @@ private: llvm::DIDescriptor getContextDescriptor(const Decl *Decl, llvm::DIDescriptor &CU); + /// getCompDirname - AT_comp_dir is empty if filename is absulte otherwise + /// it points to compilation directory. + llvm::StringRef getCompDirname(llvm::StringRef Filename); + + /// getCurrentDirname - Return current directory name. + llvm::StringRef getCurrentDirname(); + /// CreateCompileUnit - Create new compile unit. void CreateCompileUnit(); |