diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/libs/llvm12/lib/IR/DebugInfo.cpp | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/llvm12/lib/IR/DebugInfo.cpp')
-rw-r--r-- | contrib/libs/llvm12/lib/IR/DebugInfo.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/contrib/libs/llvm12/lib/IR/DebugInfo.cpp b/contrib/libs/llvm12/lib/IR/DebugInfo.cpp index d7656b9dd1..9f9d4aad5b 100644 --- a/contrib/libs/llvm12/lib/IR/DebugInfo.cpp +++ b/contrib/libs/llvm12/lib/IR/DebugInfo.cpp @@ -652,8 +652,8 @@ bool llvm::stripNonLineTableDebugInfo(Module &M) { MDNode *InlinedAt = DL.getInlinedAt(); Scope = remap(Scope); InlinedAt = remap(InlinedAt); - return DILocation::get(M.getContext(), DL.getLine(), DL.getCol(), - Scope, InlinedAt); + return DILocation::get(M.getContext(), DL.getLine(), DL.getCol(), + Scope, InlinedAt); }; if (I.getDebugLoc() != DebugLoc()) @@ -697,38 +697,38 @@ void Instruction::applyMergedLocation(const DILocation *LocA, setDebugLoc(DILocation::getMergedLocation(LocA, LocB)); } -void Instruction::updateLocationAfterHoist() { dropLocation(); } - -void Instruction::dropLocation() { - const DebugLoc &DL = getDebugLoc(); - if (!DL) - return; - - // If this isn't a call, drop the location to allow a location from a - // preceding instruction to propagate. - if (!isa<CallBase>(this)) { - setDebugLoc(DebugLoc()); - return; - } - - // Set a line 0 location for calls to preserve scope information in case - // inlining occurs. - DISubprogram *SP = getFunction()->getSubprogram(); - if (SP) - // If a function scope is available, set it on the line 0 location. When - // hoisting a call to a predecessor block, using the function scope avoids - // making it look like the callee was reached earlier than it should be. - setDebugLoc(DILocation::get(getContext(), 0, 0, SP)); - else - // The parent function has no scope. Go ahead and drop the location. If - // the parent function is inlined, and the callee has a subprogram, the - // inliner will attach a location to the call. - // - // One alternative is to set a line 0 location with the existing scope and - // inlinedAt info. The location might be sensitive to when inlining occurs. - setDebugLoc(DebugLoc()); -} - +void Instruction::updateLocationAfterHoist() { dropLocation(); } + +void Instruction::dropLocation() { + const DebugLoc &DL = getDebugLoc(); + if (!DL) + return; + + // If this isn't a call, drop the location to allow a location from a + // preceding instruction to propagate. + if (!isa<CallBase>(this)) { + setDebugLoc(DebugLoc()); + return; + } + + // Set a line 0 location for calls to preserve scope information in case + // inlining occurs. + DISubprogram *SP = getFunction()->getSubprogram(); + if (SP) + // If a function scope is available, set it on the line 0 location. When + // hoisting a call to a predecessor block, using the function scope avoids + // making it look like the callee was reached earlier than it should be. + setDebugLoc(DILocation::get(getContext(), 0, 0, SP)); + else + // The parent function has no scope. Go ahead and drop the location. If + // the parent function is inlined, and the callee has a subprogram, the + // inliner will attach a location to the call. + // + // One alternative is to set a line 0 location with the existing scope and + // inlinedAt info. The location might be sensitive to when inlining occurs. + setDebugLoc(DebugLoc()); +} + //===----------------------------------------------------------------------===// // LLVM C API implementations. //===----------------------------------------------------------------------===// |