Debug Info: drop debug info via upgrading path if version number does not match.

Add a helper function getDebugInfoVersionFromModule to return the debug info
version number for a module.

"Verifier/module-flags-1.ll" checks for verification errors.
It will seg fault when calling getDebugInfoVersionFromModule because of the
incorrect format for module flags in the testing case. We make
getModuleFlagsMetadata more robust by checking for error conditions.

PR17982

llvm-svn: 196158
This commit is contained in:
Manman Ren
2013-12-02 21:29:56 +00:00
parent 3b572dc7ed
commit 644e8f4a5b
8 changed files with 64 additions and 5 deletions

View File

@@ -3152,6 +3152,7 @@ error_code BitcodeReader::MaterializeModule(Module *M) {
for (unsigned I = 0, E = InstsWithTBAATag.size(); I < E; I++)
UpgradeInstWithTBAATag(InstsWithTBAATag[I]);
UpgradeDebugInfo(*M);
return error_code::success();
}