llvm-project/llvm/lib/Transforms/Utils
Andrea Di Biagio 32d5aedd5b [InlineFunction] Do not propagate the callsite debug location to instructions inlined from functions with debug info.
When a function F is inlined, InlineFunction extends the debug location of every
instruction inlined from F by adding an InlinedAt.

However, if an instruction has a 'null' debug location, InlineFunction would
propagate the callsite debug location to it. This behavior existed since
revision 210459.

Revision 210459 was originally committed specifically to workaround the lack of
debug information for instructions inlined from intrinsic functions (which are
usually declared with attributes `__always_inline__, __nodebug__`).

The problem with revision 210459 is that it doesn't make any sort of distinction
between instructions inlined from a 'nodebug' function and instructions which
are inlined from a function built with debug info. This issue may lead to
incorrect stepping in the debugger.

This patch works under the assumption that a nodebug function does not have a
DISubprogram. When a function F is inlined into another function G,
InlineFunction checks if F has debug info associated with it.

For nodebug functions, the InlineFunction logic is unchanged (i.e. it would
still propagate the callsite debugloc to the inlined instructions). Otherwise,
InlineFunction no longer propagates the callsite debug location.

Differential Revision: https://reviews.llvm.org/D27462

llvm-svn: 288895
2016-12-07 10:37:26 +00:00
..
ASanStackFrameLayout.cpp [asan] Replace std::to_string with llvm::to_string 2016-10-19 00:16:56 +00:00
AddDiscriminators.cpp Use the last 7 bits to represent the discriminator to fit it in 1 byte ULEB128 (NFC). 2016-11-08 16:32:32 +00:00
BasicBlockUtils.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
BreakCriticalEdges.cpp [PM] Port BreakCriticalEdges to the new PM. 2016-07-22 18:04:25 +00:00
BuildLibCalls.cpp Recommitting r275284: add support to inline __builtin_mempcpy 2016-07-29 18:23:18 +00:00
BypassSlowDivision.cpp [BypassSlowDivision] Handle division by constant numerators better. 2016-11-16 00:44:47 +00:00
CMakeLists.txt [LoopUnroll] Implement profile-based loop peeling 2016-11-30 21:13:57 +00:00
CloneFunction.cpp [CloneFunction] Don't remove unrelated nodes from the CGSSC 2016-08-19 16:37:40 +00:00
CloneModule.cpp Cloning: Also clone global variable attached metadata. 2016-10-26 02:57:33 +00:00
CmpInstAnalysis.cpp move decomposeBitTestICmp() to Transforms/Utils; NFC 2016-07-20 17:18:45 +00:00
CodeExtractor.cpp CodeExtractor : Add ability to preserve profile data. 2016-08-02 02:15:45 +00:00
CtorUtils.cpp [CtorUtils] Modernize. No functional changes intended. 2016-10-22 01:21:24 +00:00
DemoteRegToStack.cpp
EscapeEnumerator.cpp [tsan] Add support for C++ exceptions into TSan (call __tsan_func_exit during unwinding), LLVM part 2016-11-14 21:41:13 +00:00
Evaluator.cpp Use the range variant of find instead of unpacking begin/end 2016-08-11 22:21:41 +00:00
FlattenCFG.cpp [FlattenCFG] Simplify + remove unused variable. NFCI. 2016-08-05 20:53:35 +00:00
FunctionComparator.cpp IR: Move NumElements field from {Array,Vector}Type to SequentialType. 2016-12-02 03:20:58 +00:00
FunctionImportUtils.cpp [ThinLTO] Stop importing constant global vars as copies in the backend 2016-12-02 01:02:30 +00:00
GlobalStatus.cpp Merge two if conditions into one. NFCI. 2016-10-24 19:41:47 +00:00
ImportedFunctionsInliningStatistics.cpp Imported statistics types changes 2016-08-02 22:18:47 +00:00
InlineFunction.cpp [InlineFunction] Do not propagate the callsite debug location to instructions inlined from functions with debug info. 2016-12-07 10:37:26 +00:00
InstructionNamer.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
IntegerDivision.cpp TransformUtils: Avoid getNodePtrUnchecked() in integer division, NFC 2016-02-21 20:14:29 +00:00
LCSSA.cpp [LCSSA] Perform LCSSA verification only for the current loop nest. 2016-10-28 12:57:20 +00:00
LLVMBuild.txt
LibCallsShrinkWrap.cpp Give some helper classes/functions internal linkage. NFC. 2016-11-19 20:44:26 +00:00
Local.cpp [DIExpression] Introduce a dedicated DW_OP_LLVM_fragment operation 2016-12-05 18:04:47 +00:00
LoopSimplify.cpp [LoopSimplify] Preserve LCSSA when removing edges from unreachable blocks. 2016-11-18 21:01:12 +00:00
LoopUnroll.cpp [LoopUnroll] Implement profile-based loop peeling 2016-11-30 21:13:57 +00:00
LoopUnrollPeel.cpp [LoopUnroll] Implement profile-based loop peeling 2016-11-30 21:13:57 +00:00
LoopUnrollRuntime.cpp Revert "[LoopUnroll] Properly update loop-info when cloning prologues and epilogues." 2016-09-08 03:51:30 +00:00
LoopUtils.cpp Remove stale comment. NFC. 2016-12-03 01:59:13 +00:00
LoopVersioning.cpp Rename LoopAccessAnalysis to LoopAccessLegacyAnalysis /NFC 2016-07-08 20:55:26 +00:00
LowerInvoke.cpp [PM] Port LowerInvoke to the new pass manager 2016-08-12 17:28:27 +00:00
LowerSwitch.cpp Use the range variant of remove_if instead of unpacking begin/end 2016-08-12 04:32:37 +00:00
Mem2Reg.cpp Consistently use FunctionAnalysisManager 2016-08-09 00:28:15 +00:00
MemorySSA.cpp [PM] Change the static object whose address is used to uniquely identify 2016-11-23 17:53:26 +00:00
MetaRenamer.cpp
ModuleUtils.cpp Fix a typo. 2016-10-31 22:42:39 +00:00
NameAnonGlobals.cpp Use StringRef in Pass/PassManager APIs (NFC) 2016-10-01 02:56:57 +00:00
PromoteMemoryToRegister.cpp Reapplying r281895 (and follow-up r281964) after fixing pr30468. 2016-09-22 14:13:25 +00:00
SSAUpdater.cpp Use the range variant of find instead of unpacking begin/end 2016-08-11 22:21:41 +00:00
SanitizerStats.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes. 2016-01-26 18:48:36 +00:00
SimplifyCFG.cpp IR: Change the gep_type_iterator API to avoid always exposing the "current" type. 2016-12-02 02:24:42 +00:00
SimplifyIndVar.cpp [IndVars] Remove -liv-reduce 2016-06-05 18:01:12 +00:00
SimplifyInstructions.cpp fix formatting; NFC 2016-11-27 15:53:48 +00:00
SimplifyLibCalls.cpp Enable simplify libcalls for ARM PCS 2016-09-13 12:10:14 +00:00
SplitModule.cpp Move instances of std::function. 2016-06-12 16:13:55 +00:00
StripGCRelocates.cpp [StripGCRelocates] New pass to remove gc.relocates added by RS4GC 2016-10-21 18:43:16 +00:00
StripNonLineTableDebugInfo.cpp Add -strip-nonlinetable-debuginfo capability 2016-10-25 18:44:13 +00:00
SymbolRewriter.cpp [PM] Port SymbolRewriter to the new PM 2016-07-25 20:52:00 +00:00
UnifyFunctionExitNodes.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
Utils.cpp Add -strip-nonlinetable-debuginfo capability 2016-10-25 18:44:13 +00:00
ValueMapper.cpp Do a sweep over move ctors and remove those that are identical to the default. 2016-10-20 12:20:28 +00:00