llvm-6502/lib
Adrian Prantl a65da70a54 Reapply: Teach SROA how to update debug info for fragmented variables.
This reapplies r225379.

ChangeLog:
- The assertion that this commit previously ran into about the inability
  to handle indirect variables has since been removed and the backend
  can handle this now.
- Testcases were upgrade to the new MDLocation format.
- Instead of keeping a DebugDeclares map, we now use
  llvm::FindAllocaDbgDeclare().

Original commit message follows.

Debug info: Teach SROA how to update debug info for fragmented variables.
This allows us to generate debug info for extremely advanced code such as

 typedef struct { long int a; int b;} S;

 int foo(S s) {
   return s.b;
 }

which at -O1 on x86_64 is codegen'd into

 define i32 @foo(i64 %s.coerce0, i32 %s.coerce1) #0 {
   ret i32 %s.coerce1, !dbg !24
 }

with this patch we emit the following debug info for this

 TAG_formal_parameter [3]
   AT_location( 0x00000000
                0x0000000000000000 - 0x0000000000000006: rdi, piece 0x00000008, rsi, piece 0x00000004
                0x0000000000000006 - 0x0000000000000008: rdi, piece 0x00000008, rax, piece 0x00000004 )
                AT_name( "s" )
                AT_decl_file( "/Volumes/Data/llvm/_build.ninja.release/test.c" )

Thanks to chandlerc, dblaikie, and echristo for their feedback on all
previous iterations of this patch!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226598 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-20 19:42:22 +00:00
..
Analysis [PM] Port LoopInfo to the new pass manager, adding both a LoopAnalysis 2015-01-20 10:58:50 +00:00
AsmParser AsmParser: PARSE_MD_FIELD() => ParseMDField(), NFC 2015-01-20 02:42:29 +00:00
Bitcode Bitcode: Don't create comdats when autoupgrading macho bitcode 2015-01-20 05:58:07 +00:00
CodeGen Factor out a splitSwitchCase() function so that it can be reused. 2015-01-20 08:57:44 +00:00
DebugInfo
ExecutionEngine [RuntimeDyld] Tidy up emitCommonSymbols a little. NFC. 2015-01-17 00:55:05 +00:00
IR [llvm link] Destroy ConstantArrays in LLVMContext if they are not used. 2015-01-20 19:24:59 +00:00
IRReader
LineEditor
Linker [llvm link] Destroy ConstantArrays in LLVMContext if they are not used. 2015-01-20 19:24:59 +00:00
LTO
MC Add r224985 back with fixes. 2015-01-19 21:11:14 +00:00
Object Fix the Archive::Child::getRawSize() method used by llvm-objdump’s -archive-headers option 2015-01-16 22:10:36 +00:00
Option
ProfileData Replace size method call of containers to empty method where appropriate 2015-01-15 11:41:30 +00:00
Support Remove std::move that was preventing return value optimization. 2015-01-17 00:46:44 +00:00
TableGen Replace size method call of containers to empty method where appropriate 2015-01-15 11:41:30 +00:00
Target R600/SI: Add subtarget feature to enable VGPR spilling for all shader types 2015-01-20 19:33:04 +00:00
Transforms Reapply: Teach SROA how to update debug info for fragmented variables. 2015-01-20 19:42:22 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile