[llvm-commits] [llvm] r115084 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h include/llvm/Support/Dwarf.h lib/Analysis/DebugInfo.cpp test/FrontendC++/2010-04-30-OptimizedMethod-Dbg.cpp
Devang Patel
dpatel at apple.com
Wed Sep 29 14:04:46 PDT 2010
Author: dpatel
Date: Wed Sep 29 16:04:46 2010
New Revision: 115084
URL: http://llvm.org/viewvc/llvm-project?rev=115084&view=rev
Log:
Generalize DISubprogram element to encode various flags instead of just one boolean for isArtificial.
This is a backword compatible change.
Modified:
llvm/trunk/include/llvm/Analysis/DebugInfo.h
llvm/trunk/include/llvm/Support/Dwarf.h
llvm/trunk/lib/Analysis/DebugInfo.cpp
llvm/trunk/test/FrontendC++/2010-04-30-OptimizedMethod-Dbg.cpp
Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=115084&r1=115083&r2=115084&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Wed Sep 29 16:04:46 2010
@@ -46,6 +46,16 @@
/// 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 @@
/// 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 @@
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 @@
unsigned VK = 0,
unsigned VIndex = 0,
DIType = DIType(),
- bool isArtificial = 0,
+ unsigned Flags = 0,
bool isOptimized = false,
Function *Fn = 0);
Modified: llvm/trunk/include/llvm/Support/Dwarf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Dwarf.h?rev=115084&r1=115083&r2=115084&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Dwarf.h (original)
+++ llvm/trunk/include/llvm/Support/Dwarf.h Wed Sep 29 16:04:46 2010
@@ -22,7 +22,8 @@
// 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.
Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=115084&r1=115083&r2=115084&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Wed Sep 29 16:04:46 2010
@@ -1009,7 +1009,7 @@
bool isDefinition,
unsigned VK, unsigned VIndex,
DIType ContainingType,
- bool isArtificial,
+ unsigned Flags,
bool isOptimized,
Function *Fn) {
@@ -1028,7 +1028,7 @@
ConstantInt::get(Type::getInt32Ty(VMContext), (unsigned)VK),
ConstantInt::get(Type::getInt32Ty(VMContext), VIndex),
ContainingType,
- ConstantInt::get(Type::getInt1Ty(VMContext), isArtificial),
+ ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
ConstantInt::get(Type::getInt1Ty(VMContext), isOptimized),
Fn
};
@@ -1062,7 +1062,7 @@
DeclNode->getOperand(11), // Virtuality
DeclNode->getOperand(12), // VIndex
DeclNode->getOperand(13), // Containting Type
- DeclNode->getOperand(14), // isArtificial
+ DeclNode->getOperand(14), // Flags
DeclNode->getOperand(15), // isOptimized
SPDeclaration.getFunction()
};
Modified: llvm/trunk/test/FrontendC++/2010-04-30-OptimizedMethod-Dbg.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/FrontendC%2B%2B/2010-04-30-OptimizedMethod-Dbg.cpp?rev=115084&r1=115083&r2=115084&view=diff
==============================================================================
--- llvm/trunk/test/FrontendC++/2010-04-30-OptimizedMethod-Dbg.cpp (original)
+++ llvm/trunk/test/FrontendC++/2010-04-30-OptimizedMethod-Dbg.cpp Wed Sep 29 16:04:46 2010
@@ -7,12 +7,12 @@
};
int foo::bar(int x) {
- // CHECK: {{i1 false, i1 true(, i[0-9]+ [^\}]+[}]|[}]) ; \[ DW_TAG_subprogram \]}}
+ // CHECK: {{i32 [0-9]+, i1 true(, i[0-9]+ [^\}]+[}]|[}]) ; \[ DW_TAG_subprogram \]}}
return x*4 + 1;
}
int foo::baz(int x) {
- // CHECK: {{i1 false, i1 true(, i[0-9]+ [^\},]+[}]|[}]) ; \[ DW_TAG_subprogram \]}}
+ // CHECK: {{i32 [0-9]+, i1 true(, i[0-9]+ [^\},]+[}]|[}]) ; \[ DW_TAG_subprogram \]}}
return x*4 + 1;
}
More information about the llvm-commits
mailing list