diff options
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 4de3c4f..5c62ef4 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -103,7 +103,6 @@ static cl::opt<bool> ExpandConstantExprs( "Expand constant expressions to instructions for testing purposes")); extern cl::opt<bool> UseNewDbgInfoFormat; -extern cl::opt<cl::boolOrDefault> PreserveInputDbgFormat; namespace { @@ -3953,11 +3952,7 @@ Error BitcodeReader::globalCleanup() { for (Function &F : *TheModule) { MDLoader->upgradeDebugIntrinsics(F); Function *NewFn; - // If PreserveInputDbgFormat=true, then we don't know whether we want - // intrinsics or records, and we won't perform any conversions in either - // case, so don't upgrade intrinsics to records. - if (UpgradeIntrinsicFunction( - &F, NewFn, PreserveInputDbgFormat != cl::boolOrDefault::BOU_TRUE)) + if (UpgradeIntrinsicFunction(&F, NewFn)) UpgradedIntrinsics[&F] = NewFn; // Look for functions that rely on old function attribute behavior. UpgradeFunctionAttributes(F); @@ -7002,37 +6997,9 @@ Error BitcodeReader::materialize(GlobalValue *GV) { F->setIsMaterializable(false); // All parsed Functions should load into the debug info format dictated by the - // Module, unless we're attempting to preserve the input debug info format. + // Module. if (SeenDebugIntrinsic && SeenDebugRecord) return error("Mixed debug intrinsics and debug records in bitcode module!"); - if (PreserveInputDbgFormat == cl::boolOrDefault::BOU_TRUE) { - bool SeenAnyDebugInfo = SeenDebugIntrinsic || SeenDebugRecord; - bool NewDbgInfoFormatDesired = - SeenAnyDebugInfo ? SeenDebugRecord : F->getParent()->IsNewDbgInfoFormat; - if (SeenAnyDebugInfo) { - UseNewDbgInfoFormat = SeenDebugRecord; - } - // If the module's debug info format doesn't match the observed input - // format, then set its format now; we don't need to call the conversion - // function because there must be no existing intrinsics to convert. - // Otherwise, just set the format on this function now. - if (NewDbgInfoFormatDesired != F->getParent()->IsNewDbgInfoFormat) - F->getParent()->setNewDbgInfoFormatFlag(NewDbgInfoFormatDesired); - else - F->setNewDbgInfoFormatFlag(NewDbgInfoFormatDesired); - } else { - // If we aren't preserving formats, we use the Module flag to get our - // desired format instead of reading flags, in case we are lazy-loading and - // the format of the module has been changed since it was set by the flags. - // We only need to convert debug info here if we have debug records but - // desire the intrinsic format; everything else is a no-op or handled by the - // autoupgrader. - bool ModuleIsNewDbgInfoFormat = F->getParent()->IsNewDbgInfoFormat; - if (ModuleIsNewDbgInfoFormat || !SeenDebugRecord) - F->setNewDbgInfoFormatFlag(ModuleIsNewDbgInfoFormat); - else - F->setIsNewDbgInfoFormat(ModuleIsNewDbgInfoFormat); - } if (StripDebugInfo) stripDebugInfo(*F); |