[llvm] r325280 - [Utils] salvageDI: Add a comment and move a call earlier, NFC
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 15 11:13:03 PST 2018
Author: vedantk
Date: Thu Feb 15 11:13:03 2018
New Revision: 325280
URL: http://llvm.org/viewvc/llvm-project?rev=325280&view=rev
Log:
[Utils] salvageDI: Add a comment and move a call earlier, NFC
Modified:
llvm/trunk/lib/Transforms/Utils/Local.cpp
Modified: llvm/trunk/lib/Transforms/Utils/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/Local.cpp?rev=325280&r1=325279&r2=325280&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/Local.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/Local.cpp Thu Feb 15 11:13:03 2018
@@ -1492,6 +1492,7 @@ void llvm::salvageDebugInfo(Instruction
return;
auto &M = *I.getModule();
+ auto &DL = M.getDataLayout();
auto wrapMD = [&](Value *V) {
return MetadataAsValue::get(I.getContext(), ValueAsMetadata::get(V));
@@ -1519,7 +1520,7 @@ void llvm::salvageDebugInfo(Instruction
};
if (auto *CI = dyn_cast<CastInst>(&I)) {
- if (!CI->isNoopCast(M.getDataLayout()))
+ if (!CI->isNoopCast(DL))
return;
// No-op casts are irrelevant for debug info.
@@ -1539,6 +1540,7 @@ void llvm::salvageDebugInfo(Instruction
for (auto *DII : DbgUsers)
applyOffset(DII, Offset.getSExtValue());
} else if (auto *BI = dyn_cast<BinaryOperator>(&I)) {
+ // Rewrite binary operations with constant integer operands.
auto *ConstInt = dyn_cast<ConstantInt>(I.getOperand(1));
if (!ConstInt || ConstInt->getBitWidth() > 64)
return;
More information about the llvm-commits
mailing list