better check for version

llvm-svn: 32045
This commit is contained in:
Jim Laskey 2006-11-30 18:29:23 +00:00
parent c8978c5272
commit f52337299a
1 changed files with 14 additions and 2 deletions

View File

@ -1390,11 +1390,23 @@ bool DIVerifier::Verify(GlobalVariable *GV) {
return false; return false;
} }
// Get the Tag // Get the Tag.
unsigned Tag = DebugInfoDesc::TagFromGlobal(GV); unsigned Tag = DebugInfoDesc::TagFromGlobal(GV);
// Check for user defined descriptors. // Check for user defined descriptors.
if (Tag == DW_TAG_invalid) return true; if (Tag == DW_TAG_invalid) {
ValiditySlot = Valid;
return true;
}
// Get the Version.
unsigned Version = DebugInfoDesc::VersionFromGlobal(GV);
// Check for version mismatch.
if (Version != LLVMDebugVersion) {
ValiditySlot = Invalid;
return false;
}
// Construct an empty DebugInfoDesc. // Construct an empty DebugInfoDesc.
DebugInfoDesc *DD = DebugInfoDesc::DescFactory(Tag); DebugInfoDesc *DD = DebugInfoDesc::DescFactory(Tag);