diff options
author | Devang Patel <dpatel@apple.com> | 2010-09-29 21:04:46 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-09-29 21:04:46 +0000 |
commit | 9dd2b47d444e310347debcac5cdddedbb22881e6 (patch) | |
tree | d676f8365caf6f3e602d0879414a8838dd9dfca5 /include/llvm | |
parent | b0725316cd1807b954eed4b9966250249d1fd884 (diff) | |
download | external_llvm-9dd2b47d444e310347debcac5cdddedbb22881e6.zip external_llvm-9dd2b47d444e310347debcac5cdddedbb22881e6.tar.gz external_llvm-9dd2b47d444e310347debcac5cdddedbb22881e6.tar.bz2 |
Generalize DISubprogram element to encode various flags instead of just one boolean for isArtificial.
This is a backword compatible change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115084 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Analysis/DebugInfo.h | 30 | ||||
-rw-r--r-- | include/llvm/Support/Dwarf.h | 3 |
2 files changed, 19 insertions, 14 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h index 1b544e5..b9e7f1b 100644 --- a/include/llvm/Analysis/DebugInfo.h +++ b/include/llvm/Analysis/DebugInfo.h @@ -46,6 +46,16 @@ namespace llvm { /// This should not be stored in a container, because underly MDNode may /// change in certain situations. class DIDescriptor { + public: + enum { + FlagPrivate = 1 << 0, + FlagProtected = 1 << 1, + FlagFwdDecl = 1 << 2, + FlagAppleBlock = 1 << 3, + FlagBlockByrefStruct = 1 << 4, + FlagVirtual = 1 << 5, + FlagArtificial = 1 << 6 + }; protected: const MDNode *DbgNode; @@ -203,17 +213,6 @@ namespace llvm { /// others do not require a huge and empty descriptor full of zeros. class DIType : public DIScope { public: - enum { - FlagPrivate = 1 << 0, - FlagProtected = 1 << 1, - FlagFwdDecl = 1 << 2, - FlagAppleBlock = 1 << 3, - FlagBlockByrefStruct = 1 << 4, - FlagVirtual = 1 << 5, - FlagArtificial = 1 << 6 // To identify artificial arguments in - // a subroutine type. e.g. "this" in c++. - }; - protected: // This ctor is used when the Tag has already been validated by a derived // ctor. @@ -396,7 +395,12 @@ namespace llvm { DICompositeType getContainingType() const { return getFieldAs<DICompositeType>(13); } - unsigned isArtificial() const { return getUnsignedField(14); } + unsigned isArtificial() const { + if (getVersion() <= llvm::LLVMDebugVersion8) + return getUnsignedField(14); + return (getUnsignedField(14) & FlagArtificial) != 0; + } + unsigned isOptimized() const; StringRef getFilename() const { @@ -691,7 +695,7 @@ namespace llvm { unsigned VK = 0, unsigned VIndex = 0, DIType = DIType(), - bool isArtificial = 0, + unsigned Flags = 0, bool isOptimized = false, Function *Fn = 0); diff --git a/include/llvm/Support/Dwarf.h b/include/llvm/Support/Dwarf.h index 3ca8d96..da61dfb 100644 --- a/include/llvm/Support/Dwarf.h +++ b/include/llvm/Support/Dwarf.h @@ -22,7 +22,8 @@ namespace llvm { // Debug info constants. enum { - LLVMDebugVersion = (8 << 16), // Current version of debug information. + LLVMDebugVersion = (9 << 16), // Current version of debug information. + LLVMDebugVersion8 = (8 << 16), // Cconstant for version 8. LLVMDebugVersion7 = (7 << 16), // Constant for version 7. LLVMDebugVersion6 = (6 << 16), // Constant for version 6. LLVMDebugVersion5 = (5 << 16), // Constant for version 5. |