[llvm-commits] [llvm] r103305 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h lib/Analysis/DebugInfo.cpp lib/CodeGen/SelectionDAG/FastISel.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Devang Patel
dpatel at apple.com
Fri May 7 15:04:20 PDT 2010
Author: dpatel
Date: Fri May 7 17:04:20 2010
New Revision: 103305
URL: http://llvm.org/viewvc/llvm-project?rev=103305&view=rev
Log:
Verify variable directly.
Modified:
llvm/trunk/include/llvm/Analysis/DebugInfo.h
llvm/trunk/lib/Analysis/DebugInfo.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=103305&r1=103304&r2=103305&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Fri May 7 17:04:20 2010
@@ -75,9 +75,6 @@
return getUnsignedField(0) & ~LLVMDebugVersionMask;
}
- /// ValidDebugInfo - Return true if N represents valid debug info value.
- static bool ValidDebugInfo(const MDNode *N, unsigned OptLevel);
-
/// print - print descriptor.
void print(raw_ostream &OS) const;
Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=103305&r1=103304&r2=103305&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Fri May 7 17:04:20 2010
@@ -32,42 +32,6 @@
// DIDescriptor
//===----------------------------------------------------------------------===//
-/// ValidDebugInfo - Return true if V represents valid debug info value.
-/// FIXME : Add DIDescriptor.isValid()
-bool DIDescriptor::ValidDebugInfo(const MDNode *N, unsigned OptLevel) {
- if (!N)
- return false;
-
- DIDescriptor DI(N);
-
- // Check current version. Allow Version7 for now.
- unsigned Version = DI.getVersion();
- if (Version != LLVMDebugVersion && Version != LLVMDebugVersion7)
- return false;
-
- switch (DI.getTag()) {
- case DW_TAG_variable:
- assert(DIVariable(N).Verify() && "Invalid DebugInfo value");
- break;
- case DW_TAG_compile_unit:
- assert(DICompileUnit(N).Verify() && "Invalid DebugInfo value");
- break;
- case DW_TAG_subprogram:
- assert(DISubprogram(N).Verify() && "Invalid DebugInfo value");
- break;
- case DW_TAG_lexical_block:
- // FIXME: This interfers with the quality of generated code during
- // optimization.
- if (OptLevel != CodeGenOpt::None)
- return false;
- // FALLTHROUGH
- default:
- break;
- }
-
- return true;
-}
-
StringRef
DIDescriptor::getStringField(unsigned Elt) const {
if (DbgNode == 0)
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=103305&r1=103304&r2=103305&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Fri May 7 17:04:20 2010
@@ -349,7 +349,7 @@
default: break;
case Intrinsic::dbg_declare: {
const DbgDeclareInst *DI = cast<DbgDeclareInst>(I);
- if (!DIDescriptor::ValidDebugInfo(DI->getVariable(), CodeGenOpt::None) ||
+ if (!DIVariable(DI->getVariable()).Verify() ||
!MF.getMMI().hasDebugInfo())
return true;
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=103305&r1=103304&r2=103305&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Fri May 7 17:04:20 2010
@@ -3818,7 +3818,7 @@
}
case Intrinsic::dbg_declare: {
const DbgDeclareInst &DI = cast<DbgDeclareInst>(I);
- if (!DIDescriptor::ValidDebugInfo(DI.getVariable(), CodeGenOpt::None))
+ if (!DIVariable(DI.getVariable()).Verify())
return 0;
MDNode *Variable = DI.getVariable();
@@ -3881,7 +3881,7 @@
}
case Intrinsic::dbg_value: {
const DbgValueInst &DI = cast<DbgValueInst>(I);
- if (!DIDescriptor::ValidDebugInfo(DI.getVariable(), CodeGenOpt::None))
+ if (!DIVariable(DI.getVariable()).Verify())
return 0;
MDNode *Variable = DI.getVariable();
More information about the llvm-commits
mailing list