Commit Graph

901 Commits

Author SHA1 Message Date
Chris Lattner
736e31d0cf split inline asm support out to its own .cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100340 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 18:34:07 +00:00
Chris Lattner
285199502b inline processDebugLoc and simplify it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100339 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 18:18:51 +00:00
Chris Lattner
dfa107e45a minor tidying.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100338 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 18:16:38 +00:00
Chris Lattner
300a4c5640 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) 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100337 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 18:14:01 +00:00
Chris Lattner
9d1c1ada21 remove TargetMachine.h #include, also, TRI isn't used frequently
enough to warrant caching in AsmPrinter, so remove it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 18:06:11 +00:00
Chris Lattner
e00b59f954 lazily allocate the GCMetadataPrinters map and remove DenseMap
from the AsmPrinter interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100331 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 17:57:56 +00:00
Chris Lattner
b23569aff0 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100327 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 08:18:47 +00:00
Chris Lattner
de0f339ec3 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".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100326 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 07:50:12 +00:00
Chris Lattner
75f50725c1 remove the raw_ostream from various dwarf printing things.
The only thing left is LEB printing, which uses EmitRawText
for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100325 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 07:48:20 +00:00
Chris Lattner
7d73c7f0d6 mcize the gc metadata printing stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100324 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 07:39:04 +00:00
Chris Lattner
0b9bdb47bd use EmitRawText instead of O in DwarfPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100323 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 07:25:52 +00:00
Chris Lattner
c75c028a15 fix PrintAsmOperand and PrintAsmMemoryOperand to pass down
raw_ostream to print to.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100313 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:29:35 +00:00
Chris Lattner
d32c8a5617 change this back too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:09:10 +00:00
Chris Lattner
e1783cadf7 check in what I tested. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100309 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:08:10 +00:00
Chris Lattner
c1e0b76306 MMI is always available, rename O -> OS in printInlineAsm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100308 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 05:07:45 +00:00
Chris Lattner
35c33bd772 change a ton of code to not implicitly use the "O" raw_ostream
member of AsmPrinter.  Instead, pass it in explicitly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100306 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-04 04:47:45 +00:00
Chris Lattner
0c08d09204 asmstreamerize the .size directive for function bodies, force clients
of printOffset to pass in a stream to print to.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100296 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 22:28:33 +00:00
Chris Lattner
fd60b8b484 emit the cygwin stub thing through mcstreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100295 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 22:19:41 +00:00
Chris Lattner
58bc4dd4a9 add a twine form of MCStreamer::EmitRawText, and mc'ize
a few more things in AsmPrinter.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100294 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 22:12:35 +00:00
Chris Lattner
f94f8dcda7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100291 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 22:01:50 +00:00
Chris Lattner
91bead7905 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100289 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 21:35:55 +00:00
Chris Lattner
47b7e5dae9 mc'ize comment printing around file scope inline asm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100288 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-03 21:13:18 +00:00
Chris Lattner
de4845c163 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100209 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 19:42:39 +00:00
Devang Patel
c8e77640a5 Revert r100117.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100145 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 22:47:29 +00:00
Devang Patel
24c20e2435 Do not eagerly record known previous location. DBG_VALUE may not cause a new label due to one or other reason.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100134 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 20:22:44 +00:00
Devang Patel
58c7aa61d4 Skip instructions until new scope is seen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100117 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 17:32:01 +00:00
Devang Patel
8935d90a90 Cosmetic changes.
Update comment, rename a local variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-01 17:16:48 +00:00
Stuart Hastings
f8df814869 Reverting 100048; it broke two Frontend debug info tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100058 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 23:08:46 +00:00
Stuart Hastings
a88cb38d02 Debug info can now properly represent functions inside classes inside other functions. Partial fix for Radar 7424645.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100048 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 21:10:54 +00:00
Benjamin Kramer
bbb88db993 Reduce string trashing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100038 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 20:15:45 +00:00
Benjamin Kramer
345ef343cc 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100035 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 19:34:01 +00:00
Chris Lattner
cfd3188a11 reduce indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99999 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 06:09:04 +00:00
Chris Lattner
1d65ba732c tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99998 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 06:06:37 +00:00
Chris Lattner
ff741ab709 MI != 0 is checked in the assert right above this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 05:42:48 +00:00
Chris Lattner
14d750d0ad use the isDebugValue() predicate and pop_back_val()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99993 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 05:39:57 +00:00
Chris Lattner
ed7a77bfb2 assert is a function-like macro, not a control flow operator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99992 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 05:36:29 +00:00
Chris Lattner
870cfcf9a6 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99982 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 03:34:40 +00:00
Devang Patel
722f2290b8 Ignore invalid metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99938 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 22:09:52 +00:00
Chris Lattner
9b97a73ded 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99902 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 18:10:53 +00:00
Devang Patel
7ed6311577 There is no need to fall through after processing DBG_VALUE machine instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99899 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 18:07:00 +00:00
Devang Patel
aead63c033 Encode start location of debug value, communicated through DBG_VALUE machine instruction, in a variable's DIE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99845 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 22:59:58 +00:00
Chris Lattner
c3b228c978 use RAII for ExceptionTimer too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99833 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 20:39:38 +00:00
Chris Lattner
a909d66351 fix a variety of issues were we'd start DebugTimer but
not stop it by using RAII.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99832 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 20:38:20 +00:00
Devang Patel
553881bddc 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99816 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-29 17:20:31 +00:00
Devang Patel
de9b1efbe5 Revert 99772.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 21:23:37 +00:00
Devang Patel
c7eae5ca4a Refactoring. Push DILocation processing in to DwarfDebug from AsmPrinter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99772 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-28 18:57:09 +00:00
Devang Patel
2ddefecfa0 Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99507 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-25 15:09:44 +00:00
Devang Patel
9bb59a2bdc Use SP filename directly instead of SP's context's filename.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99429 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-24 21:30:35 +00:00
Devang Patel
4a602caf2e Emit DW_AT_low_pc and DW_AT_high_pc attributes for TAG_compile_unit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99225 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 23:11:36 +00:00
Devang Patel
0493f95a2c 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99223 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-22 22:38:48 +00:00