llvm-6502/lib/Transforms/Utils
David Blaikie f93662d3d5 DebugInfo: Use distinct inlinedAt MDLocations to avoid separate inlined calls being coalesced
When two calls from the same MDLocation are inlined they currently get
treated as one inlined function call (creating difficulty debugging,
duplicate variables, etc).

Clang worked around this by including column information on inline calls
which doesn't address LTO inlining or calls to the same function from
the same line and column (such as through a macro). It also didn't
address ctor and member function calls.

By making the inlinedAt locations distinct, every call site has an
explicitly distinct location that cannot be coalesced with any other
call.

This can produce linearly (2x in the worst case where every call is
inlined and the call instruction has a non-call instruction at the same
location) more debug locations. Any increase beyond that are in cases
where the Clang workaround was insufficient and the new scheme is
creating necessary distinct nodes that were being erroneously coalesced
previously.

After this change to LLVM the incomplete workarounds in Clang. That
should reduce the number of debug locations (in a build without column
info, the default on Darwin, not the default on Linux) by not creating
pseudo-distinct locations for every call to an inline function.

(oh, and I made the inlined-at chain rebuilding iterative instead of
recursive because I was having trouble wrapping my head around it the
way it was - open to discussion on the right design for that function
(including going back to a recursive solution))

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226736 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-21 22:57:29 +00:00
..
AddDiscriminators.cpp IR: Split Metadata from Value 2014-12-09 18:38:53 +00:00
ASanStackFrameLayout.cpp Revert "Introduce a string_ostream string builder facilty" 2014-06-26 22:52:05 +00:00
BasicBlockUtils.cpp [PM] Replace the Pass argument to SplitEdge with specific analyses used 2015-01-19 12:36:53 +00:00
BreakCriticalEdges.cpp [PM] Remove the Pass argument from all of the critical edge splitting 2015-01-19 12:09:11 +00:00
BuildLibCalls.cpp [PM] Move TargetLibraryInfo into the Analysis library. 2015-01-15 02:16:27 +00:00
BypassSlowDivision.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
CloneFunction.cpp Rename MapValue(Metadata*) to MapMetadata() 2014-12-19 06:06:18 +00:00
CloneModule.cpp Remove a bad cast in CloneModule() 2014-12-23 08:23:45 +00:00
CMakeLists.txt Transforms: sort source files in build 2014-11-08 00:00:47 +00:00
CmpInstAnalysis.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
CodeExtractor.cpp Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges." 2014-07-21 17:06:51 +00:00
CtorUtils.cpp GlobalOpt: Preserve comdats of unoptimized initializers 2014-09-23 22:33:01 +00:00
DemoteRegToStack.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
FlattenCFG.cpp utils: Fix segfault in flattencfg 2014-08-13 20:31:53 +00:00
GlobalStatus.cpp Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool> 2014-11-19 07:49:26 +00:00
InlineFunction.cpp DebugInfo: Use distinct inlinedAt MDLocations to avoid separate inlined calls being coalesced 2015-01-21 22:57:29 +00:00
InstructionNamer.cpp [C++11] Add 'override' keyword to virtual methods that override their base class. 2014-03-05 09:10:37 +00:00
IntegerDivision.cpp Fix heap-use-after-free bug in expandSDiv when the operands are 2014-11-05 21:28:24 +00:00
LCSSA.cpp [PM] Split the LoopInfo object apart from the legacy pass, creating 2015-01-17 14:16:18 +00:00
LLVMBuild.txt Update libdeps since TLI was moved from Target to Analysis in r226078. 2015-01-15 05:21:00 +00:00
Local.cpp [PM] Replace the Pass argument in MergeBasicBlockIntoOnlyPred with 2015-01-20 01:37:09 +00:00
LoopSimplify.cpp [PM] Lift the analyses into the interface for 2015-01-19 03:03:39 +00:00
LoopUnroll.cpp [PM] Now that LoopInfo isn't in the Pass type hierarchy, it is much 2015-01-18 01:25:51 +00:00
LoopUnrollRuntime.cpp [PM] Replace the Pass argument to SplitEdge with specific analyses used 2015-01-19 12:36:53 +00:00
LowerExpectIntrinsic.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:55:47 +00:00
LowerInvoke.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 02:55:47 +00:00
LowerSwitch.cpp [SwitchLowering] Handle destinations on multiple phi instructions 2014-12-02 18:31:53 +00:00
Makefile
Mem2Reg.cpp [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
MetaRenamer.cpp [C++11] Add 'override' keyword to virtual methods that override their base class. 2014-03-05 09:10:37 +00:00
ModuleUtils.cpp Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid needing to mention the size. 2014-08-21 05:55:13 +00:00
PromoteMemoryToRegister.cpp [PM] Split the AssumptionTracker immutable pass into two separate APIs: 2015-01-04 12:03:27 +00:00
SimplifyCFG.cpp fix {typo, build failure} in r225760 2015-01-13 04:17:47 +00:00
SimplifyIndVar.cpp [PM] Remove a dead field. 2015-01-17 14:31:35 +00:00
SimplifyInstructions.cpp [PM] Separate the TargetLibraryInfo object from the immutable pass. 2015-01-15 10:41:28 +00:00
SimplifyLibCalls.cpp [PM] Replace an abuse of inheritance to override a single function with 2015-01-21 02:11:59 +00:00
SSAUpdater.cpp Revert "[C++11] Add predecessors(BasicBlock *) / successors(BasicBlock *) iterator ranges." 2014-07-21 17:06:51 +00:00
SymbolRewriter.cpp SymbolRewriter: use iplist::splice 2015-01-05 17:56:32 +00:00
UnifyFunctionExitNodes.cpp [C++] Use 'nullptr'. Transforms edition. 2014-04-25 05:29:35 +00:00
Utils.cpp Pass to emit DWARF path discriminators. 2014-03-03 20:06:11 +00:00
ValueMapper.cpp IR: Move MDNode clone() methods from ValueMapper to MDNode, NFC 2015-01-20 02:56:57 +00:00