1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

[Utils] salvageDI: Add a comment and move a call earlier, NFC

llvm-svn: 325280
This commit is contained in:
Vedant Kumar 2018-02-15 19:13:03 +00:00
parent c55d6724b6
commit cfb230d22a

View File

@ -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;