diff options
author | Vedant Kumar <vsk@apple.com> | 2018-02-15 19:13:03 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2018-02-15 19:13:03 +0000 |
commit | 044b588929e850fae0489d67ee6bb05faeb8d002 (patch) | |
tree | 6c2cc8a8c0532f71434f4bb4cbe94ada355206c7 /llvm/lib/Transforms/Utils | |
parent | f8ad59d99d0c10e94898f205cf3d8b69847a6b44 (diff) | |
download | bcm5719-llvm-044b588929e850fae0489d67ee6bb05faeb8d002.tar.gz bcm5719-llvm-044b588929e850fae0489d67ee6bb05faeb8d002.zip |
[Utils] salvageDI: Add a comment and move a call earlier, NFC
llvm-svn: 325280
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index 39d66e0f9b0..e75127f77e8 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -1492,6 +1492,7 @@ void llvm::salvageDebugInfo(Instruction &I) { 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 &I) { }; 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 &I) { 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; |