[llvm-commits] [llvm] r80633 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h lib/Analysis/DebugInfo.cpp lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Devang Patel
dpatel at apple.com
Mon Aug 31 15:00:16 PDT 2009
Author: dpatel
Date: Mon Aug 31 17:00:15 2009
New Revision: 80633
URL: http://llvm.org/viewvc/llvm-project?rev=80633&view=rev
Log:
Rename DIBlock as DILexicalBlock.
Modified:
llvm/trunk/include/llvm/Analysis/DebugInfo.h
llvm/trunk/lib/Analysis/DebugInfo.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=80633&r1=80632&r2=80633&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Mon Aug 31 17:00:15 2009
@@ -96,6 +96,7 @@
bool isGlobalVariable() const;
bool isScope() const;
bool isCompileUnit() const;
+ bool isLexicalBlock() const;
};
/// DISubrange - This is used to represent ranges, for array bounds.
@@ -419,12 +420,14 @@
void dump() const;
};
- /// DIBlock - This is a wrapper for a block (e.g. a function, scope, etc).
- class DIBlock : public DIDescriptor {
+ /// DILexicalBlock - This is a wrapper for a lexical block.
+ class DILexicalBlock : public DIScope {
public:
- explicit DIBlock(MDNode *N = 0)
- : DIDescriptor(N, dwarf::DW_TAG_lexical_block) {}
-
+ explicit DILexicalBlock(MDNode *N = 0) {
+ DbgNode = N;
+ if (DbgNode && !isLexicalBlock())
+ DbgNode = 0;
+ }
DIDescriptor getContext() const { return getDescriptorField(1); }
};
@@ -524,9 +527,9 @@
DICompileUnit CompileUnit, unsigned LineNo,
DIType Type);
- /// CreateBlock - This creates a descriptor for a lexical block with the
- /// specified parent context.
- DIBlock CreateBlock(DIDescriptor Context);
+ /// CreateLexicalBlock - This creates a descriptor for a lexical block
+ /// with the specified parent context.
+ DILexicalBlock CreateLexicalBlock(DIDescriptor Context);
/// InsertStopPoint - Create a new llvm.dbg.stoppoint intrinsic invocation,
/// inserting it at the end of the specified basic block.
Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=80633&r1=80632&r2=80633&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Mon Aug 31 17:00:15 2009
@@ -235,6 +235,14 @@
return Tag == dwarf::DW_TAG_compile_unit;
}
+/// isLexicalBlock - Return true if the specified tag is DW_TAG_lexical_block.
+bool DIDescriptor::isLexicalBlock() const {
+ assert (!isNull() && "Invalid descriptor!");
+ unsigned Tag = getTag();
+
+ return Tag == dwarf::DW_TAG_lexical_block;
+}
+
//===----------------------------------------------------------------------===//
// Simple Descriptor Constructors and other Methods
//===----------------------------------------------------------------------===//
@@ -758,12 +766,12 @@
/// CreateBlock - This creates a descriptor for a lexical block with the
/// specified parent VMContext.
-DIBlock DIFactory::CreateBlock(DIDescriptor Context) {
+DILexicalBlock DIFactory::CreateLexicalBlock(DIDescriptor Context) {
Value *Elts[] = {
GetTagConstant(dwarf::DW_TAG_lexical_block),
Context.getNode()
};
- return DIBlock(MDNode::get(VMContext, &Elts[0], 2));
+ return DILexicalBlock(MDNode::get(VMContext, &Elts[0], 2));
}
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=80633&r1=80632&r2=80633&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Aug 31 17:00:15 2009
@@ -1222,7 +1222,7 @@
if (Slot) return Slot;
DbgScope *Parent = NULL;
- DIBlock Block(N);
+ DILexicalBlock Block(N);
// Don't create a new scope if we already created one for an inlined function.
DenseMap<const MDNode *, DbgScope *>::iterator
More information about the llvm-commits
mailing list