Chris Lattner
b50e795369
tidy up
...
llvm-svn: 100700
2010-04-07 22:29:10 +00:00
Chris Lattner
29233c0458
add a comment line that got dropped
...
llvm-svn: 100638
2010-04-07 18:10:38 +00:00
Benjamin Kramer
f2351a7a6e
Remove unused method.
...
llvm-svn: 100620
2010-04-07 11:23:46 +00:00
Torok Edwin
f8dba24a9b
Workaround the breakage in r100616 by guarding all timers with
...
TimePassesIsEnabled. This should allow make check to pass.
llvm-svn: 100618
2010-04-07 10:44:46 +00:00
Bill Wendling
fcc14141c7
Use the "NamedGroupTimer" class to categorize DWARF emission better.
...
llvm-svn: 100616
2010-04-07 09:28:04 +00:00
Benjamin Kramer
43c275fa56
Use raw_ostream.
...
llvm-svn: 100615
2010-04-07 09:26:51 +00:00
Chris Lattner
51065568cd
Have the inst emitter add the !srcloc mdnode to the machine instr.
...
Have the asmprinter use the mdnode to scavenge a source location if
present. Document this nonsense in langref.
llvm-svn: 100607
2010-04-07 05:38:05 +00:00
Chris Lattner
d62adaa54d
remove another magic number.
...
llvm-svn: 100606
2010-04-07 05:27:36 +00:00
Dale Johannesen
5d7f0a0fdd
Move printing of target-indepedent DEBUG_VALUE comments
...
into AsmPrinter. Target-dependent form is still generated
by FastISel and still handled in X86 code.
llvm-svn: 100596
2010-04-07 01:15:14 +00:00
Devang Patel
019922d1b0
Do not emit specification DIE with DW_AT_specification attribute for member functions of a funcation local class. This trips gdb's partial scan of DIEs at load time. Fixes Radar 7833483.
...
llvm-svn: 100586
2010-04-06 23:53:48 +00:00
John McCall
796583eec0
Fix a number of clang -Wsign-compare warnings that didn't have an obvious
...
solution. The only reason these don't fire with gcc-4.2 is that gcc turns off
part of -Wsign-compare in C++ on accident.
llvm-svn: 100581
2010-04-06 23:35:53 +00:00
Dale Johannesen
b36c70913b
Revert 100573, it's causing some testsuite problems.
...
llvm-svn: 100578
2010-04-06 22:45:26 +00:00
Dale Johannesen
85b35b6214
Move printing of DEBUG_VALUE comments to target-independent place.
...
There is probably a more elegant way to do this.
llvm-svn: 100573
2010-04-06 22:21:07 +00:00
Stuart Hastings
4bd3dd956f
Reverting 100530 & 100531 due to regressions in the GDB test suite.
...
llvm-svn: 100563
2010-04-06 21:38:29 +00:00
Stuart Hastings
c067196984
Revise debug info machinery to digest nested functions and classes.
...
A certain GDB testsuite case (local.cc) has a function nested inside a
class nested inside another function. GCC presents the innermost
function to llvm-convert first. Heretofore, the debug info mistakenly
placed the inner function at module scope. This patch walks the GCC
context links and instantiates the outer class and function so the
debug info is properly nested. Radar 7426545.
llvm-svn: 100530
2010-04-06 17:19:32 +00:00
Chris Lattner
92aba5a817
propagate cookie management out one layer of function calls.
...
llvm-svn: 100510
2010-04-06 00:58:50 +00:00
Chris Lattner
59126b2500
report errors through LLVMContext's inline asm handler if available.
...
llvm-svn: 100509
2010-04-06 00:55:39 +00:00
Devang Patel
fc4a1db23b
Remove unnecessary include.
...
llvm-svn: 100505
2010-04-06 00:38:32 +00:00
Chris Lattner
3b21e4d404
Give AsmParser an option to control whether it finalizes
...
the stream. New demo:
$ clang asm.c -S -o - -emit-llvm | llc -filetype=obj -o t.o
$ otool -tv t.o
t.o:
(__TEXT,__text) section
_foo:
0000000000000000 subq $0x08,%rsp
0000000000000004 movl %edi,(%rsp)
0000000000000007 movl %edi,%eax
0000000000000009 incl %eax
000000000000000b movl %eax,(%rsp)
000000000000000e movl %eax,0x04(%rsp)
0000000000000012 addq $0x08,%rsp
0000000000000016 ret
llvm-svn: 100492
2010-04-05 23:15:42 +00:00
Chris Lattner
8900ef1931
add .o file writing for inline asm in llc. Here's a silly
...
demo:
$ clang asm.c -S -o - -emit-llvm | llc -filetype=obj -o t.o
<inline asm>:1:2: error: unrecognized instruction
abc incl %eax
^
LLVM ERROR: Error parsing inline asm
Only problem seems to be that the parser finalizes OutStreamer
at the end of the first inline asm, which isn't what we want.
For example:
$ cat asm.c
int foo(int X) {
__asm__ ("incl %0" : "+r" (X));
return X;
}
$ clang asm.c -S -o - -emit-llvm | llc
...
subq $8, %rsp
movl %edi, (%rsp)
movl %edi, %eax
## InlineAsm Start
incl %eax
## InlineAsm End
movl %eax, (%rsp)
movl %eax, 4(%rsp)
addq $8, %rsp
ret
$ clang asm.c -S -o - -emit-llvm | llc -filetype=obj -o t.o
$ otool -tv t.o
t.o:
(__TEXT,__text) section
_foo:
0000000000000000 subq $0x08,%rsp
0000000000000004 movl %edi,(%rsp)
0000000000000007 movl %edi,%eax
0000000000000009 incl %eax
$
don't stop at inc!
llvm-svn: 100491
2010-04-05 23:11:24 +00:00
Bill Wendling
30346347b3
Output floating point representations in DWARF format. This is done by outputing
...
the FP encoding directly as a hex representation.
llvm-svn: 100487
2010-04-05 22:59:21 +00:00
Chris Lattner
0e45d24a4e
stringref-ize the MemoryBuffer::get apis. This requires
...
a co-committed clang patch.
llvm-svn: 100485
2010-04-05 22:42:30 +00:00
Chris Lattner
28f2fdafcd
hopefully sate the clang self host build, which is apparently
...
instantiating some folding set stuff that GCC isn't, requiring
some types to not be incomplete.
I don't know if clang is right or wrong, but unbreaking the
bot is goodness. Here's the broken build:
http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/1813/steps/compile.llvm.stage2/logs/stdio
llvm-svn: 100418
2010-04-05 06:12:01 +00:00
Chris Lattner
64a168efb6
privatize more stuff, eliminate vtables.
...
llvm-svn: 100410
2010-04-05 05:32:45 +00:00
Chris Lattner
acda87bdb1
reprivatize now that DwarfWriter is gone.
...
llvm-svn: 100409
2010-04-05 05:31:04 +00:00
Chris Lattner
da790ea006
prune #includes, MMI can never be null
...
llvm-svn: 100408
2010-04-05 05:28:23 +00:00
Chris Lattner
3f3fb970e4
prune #includes, realize the MMI can never be null.
...
llvm-svn: 100407
2010-04-05 05:24:55 +00:00
Chris Lattner
10cb0f4338
finally blast DwarfWriter away.
...
llvm-svn: 100406
2010-04-05 05:12:59 +00:00
Chris Lattner
f0d6bd3ef4
change AsmPrinter to use DwarfDebug/DwarfException directly
...
instead of going through DwarfWriter.
llvm-svn: 100405
2010-04-05 05:11:15 +00:00
Chris Lattner
f5d0636850
trim some spurious references to DwarfWriter. SDIsel really doesn't
...
need it anymore, so don't addRequire it.
llvm-svn: 100400
2010-04-05 04:09:20 +00:00
Chris Lattner
196dbdc160
eliminate DwarfDebug::shouldEmit, which is the same now as MMI::hasDebugInfo
...
llvm-svn: 100386
2010-04-05 03:52:55 +00:00
Chris Lattner
d2f5062c6d
fix a regression on 2009-08-17-DebugInfo.m
...
llvm-svn: 100385
2010-04-05 03:49:26 +00:00
Chris Lattner
7cfa70e9b3
fastisel doesn't need DwarfWriter, remove some tendricles.
...
llvm-svn: 100381
2010-04-05 02:19:28 +00:00
Chris Lattner
626cb66fdb
just have all targets create the DwarfWriter.
...
llvm-svn: 100377
2010-04-05 00:42:55 +00:00
Chris Lattner
eeaa6d67a2
nuke DwarfPrinter
...
llvm-svn: 100375
2010-04-05 00:27:29 +00:00
Chris Lattner
fd79502e08
make DwarfException not inherit from DwarfPrinter.
...
llvm-svn: 100374
2010-04-05 00:26:50 +00:00
Chris Lattner
5a00dea332
change SizeOf to take AsmPrinter instead of TargetData,
...
simplifying a bunch of code.
llvm-svn: 100373
2010-04-05 00:18:22 +00:00
Chris Lattner
3a383cb7d9
1) make DIE take AsmPrinter instead of DwarfPrinter.
...
2) change DwarfDebug to not inherit from DwarfPrinter.
llvm-svn: 100372
2010-04-05 00:13:49 +00:00
Chris Lattner
aabc6041de
Move EmitFrameMoves into AsmPrinter.
...
llvm-svn: 100371
2010-04-04 23:41:46 +00:00
Chris Lattner
8423cae590
simplify code and reduce indentation.
...
llvm-svn: 100369
2010-04-04 23:31:58 +00:00
Chris Lattner
70a4fcea1e
now that the magic is dispelled, move EmitSectionOffset to AsmPrinter.
...
llvm-svn: 100368
2010-04-04 23:25:33 +00:00
Chris Lattner
324c86600d
eliminate the magic AbsoluteDebugSectionOffsets MAI hook,
...
which is really a property of the section being referenced.
Add a predicate to MCSection to replace it.
Yay for reduction in magic.
llvm-svn: 100367
2010-04-04 23:22:29 +00:00
Chris Lattner
d442aa368d
only emit section labels if we have debug info, fixing a few
...
regtest failures.
llvm-svn: 100366
2010-04-04 23:17:54 +00:00
Chris Lattner
e58b547460
I was wrong, ocaml isn't referencing 'Ldata_begin', so remove it.
...
llvm-svn: 100365
2010-04-04 23:10:38 +00:00
Chris Lattner
0d3f3bdd3c
add some assertions to EmitSectionOffset.
...
llvm-svn: 100364
2010-04-04 23:06:31 +00:00
Chris Lattner
1fbf53b970
stop emitting some dead L labels.
...
llvm-svn: 100363
2010-04-04 23:02:02 +00:00
Chris Lattner
6629ca978e
Store an use the symbols emitted at the start of the debug
...
sections instead of magically rematerializing them later.
llvm-svn: 100362
2010-04-04 22:59:04 +00:00
Chris Lattner
46355d87a8
remove the didInitial ivar, rename emitInitial to be more
...
descriptive, change EmitSectionOffset back to taking a
symbol instead of a string.
llvm-svn: 100361
2010-04-04 22:33:59 +00:00
Chris Lattner
78528f9a36
simplify EmitSectionOffset a little bit, improve comments.
...
llvm-svn: 100360
2010-04-04 22:25:14 +00:00
Chris Lattner
638b3e0000
The "IsSmall" argument to EmitSectionOffset is always true,
...
constant fold it away.
llvm-svn: 100356
2010-04-04 21:34:40 +00:00
Chris Lattner
c7cc815522
eliminate the "isEH" argument to EmitSectionOffset.
...
llvm-svn: 100355
2010-04-04 21:31:54 +00:00
Chris Lattner
e239fa05cd
isAbsoluteEHSectionOffsets always returns false, eliminate it
...
and substitute false at the one call site.
llvm-svn: 100354
2010-04-04 21:29:44 +00:00
Chris Lattner
e619c0d3e9
move some more stuff to asmprinter.
...
llvm-svn: 100351
2010-04-04 20:20:50 +00:00
Chris Lattner
07c1b94faa
simplify some code.
...
llvm-svn: 100350
2010-04-04 20:10:41 +00:00
Chris Lattner
b75af3c5a9
move EmitEncodingByte to AsmPrinter.
...
llvm-svn: 100349
2010-04-04 20:04:21 +00:00
Chris Lattner
baf2be0561
move EmitCFAByte to AsmPrinter.
...
llvm-svn: 100348
2010-04-04 20:01:25 +00:00
Chris Lattner
f1429f1fe3
inline EmitDifference away.
...
llvm-svn: 100347
2010-04-04 19:58:12 +00:00
Chris Lattner
4e4549deea
resolve a fixme.
...
llvm-svn: 100346
2010-04-04 19:28:59 +00:00
Chris Lattner
a179b52361
move gettemplabel and getdwlabel to AsmPrinter and rename
...
them for consistency.
llvm-svn: 100345
2010-04-04 19:25:43 +00:00
Chris Lattner
9efd118938
move uleb/sleb printing into AsmPrinter from DwarfPrinter.
...
llvm-svn: 100344
2010-04-04 19:09:29 +00:00
Chris Lattner
2b40a207bc
more interface cleanup make some helpers static functions.
...
llvm-svn: 100343
2010-04-04 18:58:53 +00:00
Chris Lattner
7bde8c07a7
clean up the asmprinter header and privatize some stuff.
...
llvm-svn: 100342
2010-04-04 18:52:31 +00:00
Chris Lattner
baa2c972e9
use stringref instead of strtol to avoid errno gymnastics.
...
llvm-svn: 100341
2010-04-04 18:42:18 +00:00
Chris Lattner
1e15869d1f
split inline asm support out to its own .cpp file.
...
llvm-svn: 100340
2010-04-04 18:34:07 +00:00
Chris Lattner
8ff29c523e
inline processDebugLoc and simplify it.
...
llvm-svn: 100339
2010-04-04 18:18:51 +00:00
Chris Lattner
c334d80b0d
minor tidying.
...
llvm-svn: 100338
2010-04-04 18:16:38 +00:00
Chris Lattner
4a4710a055
clean up the asmprinter interface a bit, rename a few
...
"Print" methods to "Emit". Emit is something that goes
to an mc streamer, Print is something that goes to a
raw_ostream (for inline asm)
llvm-svn: 100337
2010-04-04 18:14:01 +00:00
Chris Lattner
21dc46e256
remove TargetMachine.h #include, also, TRI isn't used frequently
...
enough to warrant caching in AsmPrinter, so remove it.
llvm-svn: 100336
2010-04-04 18:06:11 +00:00
Chris Lattner
2cf5f9ec05
lazily allocate the GCMetadataPrinters map and remove DenseMap
...
from the AsmPrinter interface.
llvm-svn: 100331
2010-04-04 17:57:56 +00:00
Chris Lattner
d20699bc87
Momentous day: remove the "O" member from AsmPrinter. Now all
...
"asm printering" happens through MCStreamer. This also
Streamerizes PIC16 debug info, which escaped my attention.
This removes a leak from LLVMTargetMachine of the 'legacy'
output stream.
llvm-svn: 100327
2010-04-04 08:18:47 +00:00
Chris Lattner
462720b1b6
now that all operand printing happens to specified streams, we can
...
print function level inline asm with EmitInlineAsm instead of writing
it directly to "O".
llvm-svn: 100326
2010-04-04 07:50:12 +00:00
Chris Lattner
1198002c81
remove the raw_ostream from various dwarf printing things.
...
The only thing left is LEB printing, which uses EmitRawText
for now.
llvm-svn: 100325
2010-04-04 07:48:20 +00:00
Chris Lattner
ef8240bbac
mcize the gc metadata printing stuff.
...
llvm-svn: 100324
2010-04-04 07:39:04 +00:00
Chris Lattner
dd89ce9a82
use EmitRawText instead of O in DwarfPrinter.
...
llvm-svn: 100323
2010-04-04 07:25:52 +00:00
Chris Lattner
3bb09768cb
fix PrintAsmOperand and PrintAsmMemoryOperand to pass down
...
raw_ostream to print to.
llvm-svn: 100313
2010-04-04 05:29:35 +00:00
Chris Lattner
0124fe38a6
change this back too
...
llvm-svn: 100310
2010-04-04 05:09:10 +00:00
Chris Lattner
aa70abba05
check in what I tested. :(
...
llvm-svn: 100309
2010-04-04 05:08:10 +00:00
Chris Lattner
f64c982943
MMI is always available, rename O -> OS in printInlineAsm.
...
llvm-svn: 100308
2010-04-04 05:07:45 +00:00
Chris Lattner
76c564b1bb
change a ton of code to not implicitly use the "O" raw_ostream
...
member of AsmPrinter. Instead, pass it in explicitly.
llvm-svn: 100306
2010-04-04 04:47:45 +00:00
Chris Lattner
f33c7fcc28
asmstreamerize the .size directive for function bodies, force clients
...
of printOffset to pass in a stream to print to.
llvm-svn: 100296
2010-04-03 22:28:33 +00:00
Chris Lattner
c6d67d4ca5
emit the cygwin stub thing through mcstreamer.
...
llvm-svn: 100295
2010-04-03 22:19:41 +00:00
Chris Lattner
1716721df1
add a twine form of MCStreamer::EmitRawText, and mc'ize
...
a few more things in AsmPrinter.cpp.
llvm-svn: 100294
2010-04-03 22:12:35 +00:00
Chris Lattner
86d61b5837
start moving towards emitting inline asm statements with
...
EmitInlineAsm. However, this attempt is foiled by operands
being emitted directly to "O" so I'll have to do some surgery
and finish MCizing the world.
llvm-svn: 100291
2010-04-03 22:01:50 +00:00
Chris Lattner
8a87fb7633
add a new EmitInlineAsm function to asmprinter to handle inline asm.
...
If we have an MCAsmStreamer, we continue to emit asm textually,
otherwise we (currently) emit an error to errs and ignore it.
llvm-svn: 100289
2010-04-03 21:35:55 +00:00
Chris Lattner
fed39fa7b3
mc'ize comment printing around file scope inline asm.
...
llvm-svn: 100288
2010-04-03 21:13:18 +00:00
Chris Lattner
915c5f9862
Switch the code generator (except the JIT) onto the new DebugLoc
...
representation. This eliminates the 'DILocation' MDNodes for
file/line/col tuples from -O0 -g codegen.
This remove the old DebugLoc class, making it a typedef for DebugLoc,
I'll rename NewDebugLoc next.
I didn't update the JIT to use the new apis, so it will continue to
work, but be as slow as before. Someone should eventually do this
or, better yet, rip out the JIT debug info stuff and build the JIT
on top of MC.
llvm-svn: 100209
2010-04-02 19:42:39 +00:00
Devang Patel
18737b2a81
Revert r100117.
...
llvm-svn: 100145
2010-04-01 22:47:29 +00:00
Devang Patel
15676e5167
Do not eagerly record known previous location. DBG_VALUE may not cause a new label due to one or other reason.
...
llvm-svn: 100134
2010-04-01 20:22:44 +00:00
Devang Patel
1a55ef0427
Skip instructions until new scope is seen.
...
llvm-svn: 100117
2010-04-01 17:32:01 +00:00
Devang Patel
4c603b1c4e
Cosmetic changes.
...
Update comment, rename a local variable.
llvm-svn: 100116
2010-04-01 17:16:48 +00:00
Stuart Hastings
7f89a0ac88
Reverting 100048; it broke two Frontend debug info tests.
...
llvm-svn: 100058
2010-03-31 23:08:46 +00:00
Stuart Hastings
f3e5afd6d3
Debug info can now properly represent functions inside classes inside other functions. Partial fix for Radar 7424645.
...
llvm-svn: 100048
2010-03-31 21:10:54 +00:00
Benjamin Kramer
96956ed0ff
Reduce string trashing.
...
llvm-svn: 100038
2010-03-31 20:15:45 +00:00
Benjamin Kramer
74729ae094
DwarfDebug: Allocate DIEValues with a BumpPtrAllocator. Most of them are
...
POD-like anyway, so we don't even care about calling their d'tors (DIEBlock
being the exception).
~6% less mallocs and ~1% compile time improvement on clang -O0 -g oggenc.c
llvm-svn: 100035
2010-03-31 19:34:01 +00:00
Chris Lattner
17d38594fe
reduce indentation
...
llvm-svn: 99999
2010-03-31 06:09:04 +00:00
Chris Lattner
71696ef1ad
tidy up
...
llvm-svn: 99998
2010-03-31 06:06:37 +00:00
Chris Lattner
03e1b5ab5c
MI != 0 is checked in the assert right above this.
...
llvm-svn: 99995
2010-03-31 05:42:48 +00:00
Chris Lattner
848c7d2e49
use the isDebugValue() predicate and pop_back_val()
...
llvm-svn: 99993
2010-03-31 05:39:57 +00:00
Chris Lattner
8d2fe28910
assert is a function-like macro, not a control flow operator.
...
llvm-svn: 99992
2010-03-31 05:36:29 +00:00
Chris Lattner
009de335ac
add new apis for getting/setting !dbg metadata on
...
instructions. In addition to being a convenience,
they are faster than the old apis, particularly when
not going from an MDKindID like people should be
doing.
llvm-svn: 99982
2010-03-31 03:34:40 +00:00
Devang Patel
57c644f926
Ignore invalid metadata.
...
llvm-svn: 99938
2010-03-30 22:09:52 +00:00
Chris Lattner
9897043928
Rip out the 'is temporary' nonsense from the MCContext interface to
...
create symbols. It is extremely error prone and a source of a lot
of the remaining integrated assembler bugs on x86-64.
This fixes rdar://7807601.
llvm-svn: 99902
2010-03-30 18:10:53 +00:00
Devang Patel
67d94ab0f8
There is no need to fall through after processing DBG_VALUE machine instruction.
...
llvm-svn: 99899
2010-03-30 18:07:00 +00:00
Devang Patel
23b2ae621c
Encode start location of debug value, communicated through DBG_VALUE machine instruction, in a variable's DIE.
...
llvm-svn: 99845
2010-03-29 22:59:58 +00:00
Chris Lattner
6efa201f7f
use RAII for ExceptionTimer too
...
llvm-svn: 99833
2010-03-29 20:39:38 +00:00
Chris Lattner
4787975994
fix a variety of issues were we'd start DebugTimer but
...
not stop it by using RAII.
llvm-svn: 99832
2010-03-29 20:38:20 +00:00
Devang Patel
bd477bef25
Refactor code to push DILocation prcessing into DwarfDebug.cpp from AsmPrinter.cpp.
...
This is same as r99772 (which was reverted) with just one meaningful difference where two source lines exchanged their positions.
llvm-svn: 99816
2010-03-29 17:20:31 +00:00
Devang Patel
1e8ccb5f8b
Revert 99772.
...
llvm-svn: 99778
2010-03-28 21:23:37 +00:00
Devang Patel
32bdaef3fe
Refactoring. Push DILocation processing in to DwarfDebug from AsmPrinter.
...
llvm-svn: 99772
2010-03-28 18:57:09 +00:00
Devang Patel
95cd4b9c0a
Add comment.
...
llvm-svn: 99507
2010-03-25 15:09:44 +00:00
Devang Patel
834392fcc6
Use SP filename directly instead of SP's context's filename.
...
llvm-svn: 99429
2010-03-24 21:30:35 +00:00
Devang Patel
d22ed622b3
Emit DW_AT_low_pc and DW_AT_high_pc attributes for TAG_compile_unit.
...
llvm-svn: 99225
2010-03-22 23:11:36 +00:00
Devang Patel
53e91f0836
DW_AT_stmt_list attribute attached with a compile unit encodes offset of line number information for this compile unit in debug_line section. This offset is always zero when only one compile unit is emitted in a object file.
...
llvm-svn: 99223
2010-03-22 22:38:48 +00:00
Jeffrey Yasskin
54ebc986b1
Fix a memory leak from DIE::addSiblingOffset() by adding the DIEValue
...
it allocates to DwarfDebug::DIEValues.
llvm-svn: 99196
2010-03-22 18:47:14 +00:00
Devang Patel
852a04e7ce
Fix EmitSectionOffset incorrect argument. DwarfDebug is emitting debug info so isEH is always false. This was hiding until now from compilers because of default arguments. This was hiding from dwarf debug info users because for most of the platform isAbsoluteEHSectionOffsets() is same as isAbsoluteDebugSectionOffsets(). But Chris found it while updating dwarf printer to use MC*.
...
llvm-svn: 98743
2010-03-17 17:29:55 +00:00
Chris Lattner
8fce3dddfa
reapply r98656 unmodified, which exposed the asmprinter not
...
handling constant unions.
llvm-svn: 98680
2010-03-16 21:25:55 +00:00
Daniel Dunbar
3a374da973
Revert r98656, its breaking all over the place.
...
llvm-svn: 98662
2010-03-16 19:35:34 +00:00
Chris Lattner
9ae99e0df5
improve support for uniontype and ConstantUnion, patch by Tim Northover!
...
llvm-svn: 98656
2010-03-16 19:15:03 +00:00
Chris Lattner
db035a0af2
Fix the third (and last known) case of code update problems due
...
to LLVM IR changes with addr label weirdness. In the testcase, we
generate references to the two bb's when codegen'ing the first
function:
_test1: ## @test1
leaq Ltmp0(%rip), %rax
..
leaq Ltmp1(%rip), %rax
Then continue to codegen the second function where the blocks
get merged. We're now smart enough to emit both labels, producing
this code:
_test_fun: ## @test_fun
## BB#0: ## %entry
Ltmp1: ## Block address taken
Ltmp0:
## BB#1: ## %ret
movl $-1, %eax
ret
Rejoice.
llvm-svn: 98595
2010-03-16 00:29:39 +00:00
Chris Lattner
561334a81f
Implement support for the case when a reference to a addr-of-bb
...
label is generated, but then the block is deleted. Since the
value is undefined, we just emit the label right after the entry
label of the function. It might matter that the label is in the
same section as the function was afterall.
llvm-svn: 98579
2010-03-15 20:39:00 +00:00
Devang Patel
a3e9c9ca7b
Emit dwarf variable info communicated by code generator through DBG_VALUE machine instructions.
...
This is a work in progress.
llvm-svn: 98556
2010-03-15 18:33:46 +00:00
Chris Lattner
f18c0e6b4b
remove dead method.
...
llvm-svn: 98526
2010-03-15 00:00:42 +00:00
Chris Lattner
9efbbcbe45
fix AsmPrinter::GetBlockAddressSymbol to always return a unique
...
label instead of trying to form one based on the BB name (which
causes collisions if the name is empty). This fixes PR6608
llvm-svn: 98495
2010-03-14 17:53:23 +00:00
Chris Lattner
6e52e9db31
get MMI out of the label uniquing business, just go to MCContext
...
to get unique assembler temporary labels.
llvm-svn: 98489
2010-03-14 08:36:50 +00:00
Chris Lattner
6dcaba516f
don't use getDWLabel("label" anymore, always go through MMI.
...
llvm-svn: 98485
2010-03-14 08:18:13 +00:00
Chris Lattner
ff1fdd6787
remove now-dead code, all labels use MCSymbols.
...
llvm-svn: 98484
2010-03-14 08:17:53 +00:00
Chris Lattner
b4666f4517
change SrcLineInfo to contain a label instead of a label ID.
...
llvm-svn: 98483
2010-03-14 08:15:55 +00:00
Chris Lattner
d5e8d9f29a
Now that DBG_LABEL is updated, we can finally make MachineMove
...
contain an MCSymbol instead of a label index.
llvm-svn: 98482
2010-03-14 08:12:40 +00:00
Chris Lattner
c26f44fb07
change the DBG_LABEL MachineInstr to always be created
...
with an MCSymbol instead of an immediate.
llvm-svn: 98481
2010-03-14 07:56:48 +00:00
Chris Lattner
8e2b12b164
unbreak the build, grr symlinks.
...
llvm-svn: 98477
2010-03-14 07:36:49 +00:00
Chris Lattner
1065f49ad9
switch GC_LABEL to use an MCSymbol operand instead of a label ID operand.
...
llvm-svn: 98474
2010-03-14 07:27:07 +00:00
Chris Lattner
5a6e262c72
Fix some EH failures on NNT I introduced in r98461
...
llvm-svn: 98471
2010-03-14 07:02:50 +00:00
Chris Lattner
04857fab70
fix a bug I introduced in r98459, causing some NNT failures.
...
llvm-svn: 98470
2010-03-14 06:50:56 +00:00
Chris Lattner
ee2fbbc978
change the LabelSDNode to be EHLabelSDNode and make it hold
...
an MCSymbol. Make the EH_LABEL MachineInstr hold its label
with an MCSymbol instead of ID. Fix a bug in MMI.cpp which
would return labels named "Label4" instead of "label4".
llvm-svn: 98463
2010-03-14 02:33:54 +00:00
Chris Lattner
ee95d4c61c
use Label->isDefined() instead of isLabelDeleted() now that we
...
consistently use MCSymbol and only call this predicate after
they should have been emitted.
llvm-svn: 98461
2010-03-14 02:20:58 +00:00
Chris Lattner
34adc8d225
change EH related stuff (other than EH_LABEL) to use MCSymbol
...
instead of label ID's. This cleans up and regularizes a bunch
of code and makes way for future progress.
Unfortunately, this pointed out to me that JITDwarfEmitter.cpp
is largely copy and paste from DwarfException/MachineModuleInfo
and other places. This is very sad and disturbing. :(
One major change here is that TidyLandingPads moved from being
called in DwarfException::BeginFunction to being called in
DwarfException::EndFunction. There should not be any
functionality change from doing this, but I'm not an EH expert.
llvm-svn: 98459
2010-03-14 01:41:15 +00:00
Chris Lattner
29bdac4928
eliminate the now-unneeded context argument of MBB::getSymbol()
...
llvm-svn: 98451
2010-03-13 21:04:28 +00:00
Chris Lattner
e468f88b26
rearrange MCContext ownership. Before LLVMTargetMachine created it
...
and passing off ownership to AsmPrinter. Now MachineModuleInfo
creates it and owns it by value. This allows us to use MCSymbols
more consistently throughout the rest of the code generator, and
simplifies a bit of code. This also allows MachineFunction to
keep an MCContext reference handy, and cleans up the TargetRegistry
interfaces for AsmPrinters.
llvm-svn: 98450
2010-03-13 20:55:24 +00:00
Chris Lattner
41e275dc8e
simplify EmitFrameMoves to take BaseLabel in as a symbol
...
instead of as a stem+idx pair, simplify the "is a new
location" check to use symbol comparison.
llvm-svn: 98432
2010-03-13 08:05:25 +00:00
Chris Lattner
8811e12314
factor some labels, simplify some code.
...
llvm-svn: 98429
2010-03-13 07:40:56 +00:00
Chris Lattner
2c3f478c0b
various cleanups.
...
llvm-svn: 98426
2010-03-13 07:26:18 +00:00
Chris Lattner
b7aa9527ef
reimplement the string pool used for inlined function
...
entries to not thrash std::strings and MCSymbols.
llvm-svn: 98415
2010-03-13 02:17:42 +00:00
Chris Lattner
5ea039ad5c
remove gone method, grr symlinks.
...
llvm-svn: 98392
2010-03-12 21:30:49 +00:00
Chris Lattner
9e4cafe6f1
inline the now-trivial implementation of GetGlobalValueSymbol into
...
some of its callers.
llvm-svn: 98388
2010-03-12 21:09:07 +00:00
Chris Lattner
c7b46f9d9c
give Mangler access to TargetData.
...
llvm-svn: 98378
2010-03-12 20:47:28 +00:00
Chris Lattner
be3242b523
finally give Mangler a getSymbol method, which returns an MCSymbol
...
for a global instead of messing around with string buffers.
llvm-svn: 98366
2010-03-12 18:55:20 +00:00
Chris Lattner
45ec3f8944
remove dead code.
...
llvm-svn: 98365
2010-03-12 18:49:32 +00:00
Chris Lattner
2eff505fba
make the mangler take an MCContext instead of an MAI.
...
No functionality change.
llvm-svn: 98363
2010-03-12 18:44:54 +00:00
Chris Lattner
77b0a2ee03
fix a bug emitting .secrel32 that I introduced, PR6587, patch
...
by A.Mazur!
llvm-svn: 98360
2010-03-12 18:10:35 +00:00
Jeffrey Yasskin
35b4e4f641
Free DbgScopes in DwarfDebug::endFunction(). Also increased the const-ness of
...
several fields to make it easier to figure out where bugs might be creeping in.
llvm-svn: 98358
2010-03-12 17:45:06 +00:00