diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/libs/llvm12/lib/IR/DebugInfo.cpp | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 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 9f9d4aad5b..d7656b9dd1 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. //===----------------------------------------------------------------------===// |