diff options
author | Devang Patel <dpatel@apple.com> | 2009-08-31 21:34:44 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-08-31 21:34:44 +0000 |
commit | 4a47c2447110c5163806b46ee1be881adf70ce38 (patch) | |
tree | 9c9113b85edfada55571aee3a00cd561aa1fa34f /include/llvm/Analysis | |
parent | 248d5579576fdfb0f1dca59bc3c6cebb8a6976fc (diff) | |
download | external_llvm-4a47c2447110c5163806b46ee1be881adf70ce38.zip external_llvm-4a47c2447110c5163806b46ee1be881adf70ce38.tar.gz external_llvm-4a47c2447110c5163806b46ee1be881adf70ce38.tar.bz2 |
Derive DICompileUnit from DIScope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80627 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis')
-rw-r--r-- | include/llvm/Analysis/DebugInfo.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h index 314873a..e6737d0 100644 --- a/include/llvm/Analysis/DebugInfo.h +++ b/include/llvm/Analysis/DebugInfo.h @@ -95,6 +95,7 @@ namespace llvm { bool isSubprogram() const; bool isGlobalVariable() const; bool isScope() const; + bool isCompileUnit() const; }; /// DISubrange - This is used to represent ranges, for array bounds. @@ -129,10 +130,13 @@ namespace llvm { }; /// DICompileUnit - A wrapper for a compile unit. - class DICompileUnit : public DIDescriptor { + class DICompileUnit : public DIScope { public: - explicit DICompileUnit(MDNode *N = 0) - : DIDescriptor(N, dwarf::DW_TAG_compile_unit) {} + explicit DICompileUnit(MDNode *N = 0) { + DbgNode = N; + if (DbgNode && !isCompileUnit()) + DbgNode = 0; + } unsigned getLanguage() const { return getUnsignedField(2); } const std::string &getFilename(std::string &F) const { |