mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Verify variable directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103305 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -75,9 +75,6 @@ namespace llvm {
|
|||||||
return getUnsignedField(0) & ~LLVMDebugVersionMask;
|
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.
|
/// print - print descriptor.
|
||||||
void print(raw_ostream &OS) const;
|
void print(raw_ostream &OS) const;
|
||||||
|
|
||||||
|
@@ -32,42 +32,6 @@ using namespace llvm::dwarf;
|
|||||||
// DIDescriptor
|
// 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
|
StringRef
|
||||||
DIDescriptor::getStringField(unsigned Elt) const {
|
DIDescriptor::getStringField(unsigned Elt) const {
|
||||||
if (DbgNode == 0)
|
if (DbgNode == 0)
|
||||||
|
@@ -349,7 +349,7 @@ bool FastISel::SelectCall(const User *I) {
|
|||||||
default: break;
|
default: break;
|
||||||
case Intrinsic::dbg_declare: {
|
case Intrinsic::dbg_declare: {
|
||||||
const DbgDeclareInst *DI = cast<DbgDeclareInst>(I);
|
const DbgDeclareInst *DI = cast<DbgDeclareInst>(I);
|
||||||
if (!DIDescriptor::ValidDebugInfo(DI->getVariable(), CodeGenOpt::None) ||
|
if (!DIVariable(DI->getVariable()).Verify() ||
|
||||||
!MF.getMMI().hasDebugInfo())
|
!MF.getMMI().hasDebugInfo())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
@@ -3818,7 +3818,7 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
|
|||||||
}
|
}
|
||||||
case Intrinsic::dbg_declare: {
|
case Intrinsic::dbg_declare: {
|
||||||
const DbgDeclareInst &DI = cast<DbgDeclareInst>(I);
|
const DbgDeclareInst &DI = cast<DbgDeclareInst>(I);
|
||||||
if (!DIDescriptor::ValidDebugInfo(DI.getVariable(), CodeGenOpt::None))
|
if (!DIVariable(DI.getVariable()).Verify())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
MDNode *Variable = DI.getVariable();
|
MDNode *Variable = DI.getVariable();
|
||||||
@@ -3881,7 +3881,7 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
|
|||||||
}
|
}
|
||||||
case Intrinsic::dbg_value: {
|
case Intrinsic::dbg_value: {
|
||||||
const DbgValueInst &DI = cast<DbgValueInst>(I);
|
const DbgValueInst &DI = cast<DbgValueInst>(I);
|
||||||
if (!DIDescriptor::ValidDebugInfo(DI.getVariable(), CodeGenOpt::None))
|
if (!DIVariable(DI.getVariable()).Verify())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
MDNode *Variable = DI.getVariable();
|
MDNode *Variable = DI.getVariable();
|
||||||
|
Reference in New Issue
Block a user