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
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
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
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
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
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
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
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
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
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
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
Richard Osborne
6d3e92dfee
Add a new jump table encoding to indicate jump tables entries
...
are inside the function by the target at the point of use.
llvm-svn: 98255
2010-03-11 14:58:16 +00:00
Chris Lattner
ac2361a9b0
set the temporary bit on MCSymbols correctly.
...
llvm-svn: 98124
2010-03-10 02:25:11 +00:00
Chris Lattner
ba35a67062
reapply r98035:
...
Now that setStartLabel takes an MCSymbol, we can de-ID'ize
beginScope and RecordSourceLine.
llvm-svn: 98047
2010-03-09 04:54:43 +00:00
Eric Christopher
66194fbf86
Speculatively revert r98035. It appears to have caused a set of buildbot
...
failures.
llvm-svn: 98039
2010-03-09 02:36:31 +00:00
Chris Lattner
06c5e9060c
Now that setStartLabel takes an MCSymbol, we can de-ID'ize
...
beginScope and RecordSourceLine.
llvm-svn: 98035
2010-03-09 02:08:02 +00:00
Chris Lattner
9e57c676dd
mcstreamerize AsmPrinter::printLabel.
...
llvm-svn: 98025
2010-03-09 01:02:30 +00:00
Chris Lattner
b14490d912
add a EmitSymbolValue convenience method to MCStreamer.
...
llvm-svn: 98017
2010-03-09 00:39:24 +00:00
Chris Lattner
9889c1eb9e
move .set generation out of DwarfPrinter into AsmPrinter and
...
MCize it.
llvm-svn: 98010
2010-03-08 23:58:37 +00:00
Devang Patel
3b548aa8e2
Avoid using DIDescriptor.isNull().
...
This is a first step towards eliminating checks in Descriptor constructors.
llvm-svn: 97975
2010-03-08 20:52:55 +00:00
Devang Patel
bc97f6b757
Revert r97947.
...
llvm-svn: 97963
2010-03-08 19:20:38 +00:00
Devang Patel
fe28599f6f
Avoid using DIDescriptor.isNull().
...
This is a first step towards eliminating unncessary constructor checks in light weight DIDescriptor wrappers.
llvm-svn: 97947
2010-03-08 18:25:48 +00:00
Chris Lattner
e4f249bc06
use OutStreamer.EmitCodeAlignment for alignment in the text
...
segment.
llvm-svn: 96967
2010-02-23 18:46:22 +00:00
Chris Lattner
1fa9c2cce4
move isOnlyReachableByFallthrough out of MachineBasicBlock into AsmPrinter,
...
and add a sparc implementation that knows about delay slots. Patch by
Nathan Keynes!
llvm-svn: 96492
2010-02-17 18:52:56 +00:00
Dan Gohman
4a618827de
Fix "the the" and similar typos.
...
llvm-svn: 95781
2010-02-10 16:03:48 +00:00
Chris Lattner
ea26fa9971
fix a layering violation: VirtRegRewriter.cpp shouldn't use AsmPrinter.h.
...
llvm-svn: 95748
2010-02-10 01:23:18 +00:00
Chris Lattner
74e6852510
Move verbose asm instruction comments to using MCStreamer.
...
The major win of this is that the code is simpler and they
print on the same line as the instruction again:
movl %eax, 96(%esp) ## 4-byte Spill
movl 96(%esp), %eax ## 4-byte Reload
cmpl 92(%esp), %eax ## 4-byte Folded Reload
jl LBB7_86
llvm-svn: 95738
2010-02-10 00:47:53 +00:00
Chris Lattner
ff68a42121
print all the newlines at the end of instructions with
...
OutStreamer.AddBlankLine instead of textually.
llvm-svn: 95734
2010-02-10 00:36:00 +00:00
Chris Lattner
b06015aa69
move target-independent opcodes out of TargetInstrInfo
...
into TargetOpcodes.h. #include the new TargetOpcodes.h
into MachineInstr. Add new inline accessors (like isPHI())
to MachineInstr, and start using them throughout the
codebase.
llvm-svn: 95687
2010-02-09 19:54:29 +00:00
Dan Gohman
227077d1be
Implement AsmPrinter support for several more operators which have
...
direct MCExpr equivalents. Don't use MCExpr::Shr because it isn't
consistent between targets.
llvm-svn: 95620
2010-02-09 00:02:37 +00:00
Chris Lattner
ebc970e4eb
now that @GOTOFF is no longer represented as a suffix on a
...
MCSymbol, we can remove the 'suffix' argument of
GetBlockAddressSymbol. Do so.
llvm-svn: 95601
2010-02-08 23:10:08 +00:00
Dan Gohman
e51b57bee0
ConstantFoldConstantExpression can theoretically return the original
...
expression; don't go into an infinite loop if it does.
llvm-svn: 95591
2010-02-08 22:19:11 +00:00
Dan Gohman
4268d6a7c3
When CodeGen'ing unoptimized code, there may be unfolded constant expressions
...
in global initializers. Instead of aborting, attempt to fold them on the
spot. If folding succeeds, emit the folded expression instead.
This fixes PR6255.
llvm-svn: 95583
2010-02-08 22:02:38 +00:00
Bill Wendling
6510dc8dc3
An empty global constant (one of size 0) may have a section immediately
...
following it. However, the EmitGlobalConstant method wasn't emitting a body for
the constant. The assembler doesn't like that. Before, we were generating this:
.zerofill __DATA, __common, __cmd, 1, 3
This fix puts us back to that semantic.
llvm-svn: 95336
2010-02-05 00:17:02 +00:00
Chris Lattner
0b78cc2af5
don't emit \n's at the start of X86AsmPrinter::runOnMachineFunction,
...
.o files don't like that.
llvm-svn: 95187
2010-02-03 01:49:49 +00:00
Chris Lattner
f1866ab682
privatize a bunch of methods and move \n printing into them.
...
llvm-svn: 95186
2010-02-03 01:46:05 +00:00
Chris Lattner
996ec840d0
rejigger the world so that EmitInstruction prints the \n at
...
the end of the instruction instead of expecting the caller to
do it. This currently causes the asm-verbose instruction
comments to be on the next line.
llvm-svn: 95178
2010-02-03 01:09:55 +00:00
Chris Lattner
41ad1905c9
sink handling of target-independent machine instrs (other
...
than DEBUG_VALUE :( ) into the target indep AsmPrinter.cpp
file. This allows elimination of the
NO_ASM_WRITER_BOILERPLATE hack among other things.
llvm-svn: 95177
2010-02-03 01:00:52 +00:00
Chris Lattner
b0d44c3807
refactor code so that LLVMTargetMachine creates the asmstreamer and
...
mccontext instead of having AsmPrinter do it. This allows other
types of MCStreamer's to be passed in.
llvm-svn: 95155
2010-02-02 23:37:42 +00:00
Chris Lattner
32445d300f
move handling of asm-verbose out of AsmPrinter.cpp into LLVMTargetMachine.cpp with the rest of the command line options.
...
llvm-svn: 95152
2010-02-02 22:54:51 +00:00
Chris Lattner
c968f4475e
add target hooks for emitting random gunk before and after the function body.
...
llvm-svn: 94732
2010-01-28 01:58:58 +00:00
Chris Lattner
73de5fbfc3
Give AsmPrinter the most common expected implementation of
...
runOnMachineFunction, and switch PPC to use EmitFunctionBody.
The two ppc asmprinters now don't heave to define
runOnMachineFunction.
llvm-svn: 94722
2010-01-28 01:28:58 +00:00
Chris Lattner
565896b9eb
emit a 0 byte instead of a noop if a function is empty on darwin.
...
"0" is nice and target independent.
llvm-svn: 94718
2010-01-28 01:06:32 +00:00
Chris Lattner
94a946cac4
Remove the argument from EmitJumpTableInfo, because it doesn't need it.
...
Move the X86 implementation of function body emission up to
AsmPrinter::EmitFunctionBody, which works by calling the virtual
EmitInstruction method.
llvm-svn: 94716
2010-01-28 01:02:27 +00:00
Chris Lattner
2b796241a7
Drop the argument to AsmPrinter::EmitConstantPool and make it virtual.
...
Overload it in the ARM backend to do nothing, since is does insane
constant pool emission.
llvm-svn: 94708
2010-01-28 00:19:24 +00:00
Chris Lattner
cd99546b03
rename printVisibility to EmitVisibility and make it private,
...
constify EmitLinkage.
llvm-svn: 94705
2010-01-28 00:05:10 +00:00
Chris Lattner
bc1e6f0873
add a new AsmPrinter::EmitFunctionEntryLabel virtual function,
...
which allows targets to override function entry label emission.
Use it to convert linux/ppc to use EmitFunctionHeader().
llvm-svn: 94667
2010-01-27 07:21:55 +00:00
Chris Lattner
bac7498f8e
mcize label emission for functions.
...
llvm-svn: 94624
2010-01-26 23:53:39 +00:00
Chris Lattner
fc2e376a15
use EmitLinkage for functions as well as globals. One output
...
change is that we now use ".linkonce discard" for global variables
instead of ".linkonce samesize". These should be the same, just less
strict. If anyone is interested in mcizing MCSection for COFF targets,
this should be easy to fix.
llvm-svn: 94623
2010-01-26 23:51:52 +00:00
Chris Lattner
dbf5a7617d
pull linkage emission code out to a new EmitLinkage function.
...
llvm-svn: 94621
2010-01-26 23:47:12 +00:00
Chris Lattner
22fc38dd4f
rearrange some directives, no functionality change.
...
llvm-svn: 94620
2010-01-26 23:41:48 +00:00
Chris Lattner
c7b91156e4
now that enough stuff is constified, move function header printing
...
logic up from X86 into the common code. The other targets will
hopefully start using this soon.
llvm-svn: 94614
2010-01-26 23:18:44 +00:00
Chris Lattner
b657c4cdc3
emit jump table an alias ".set" directives through MCStreamer as
...
assignments.
.set x, a-b
is the same as:
x = a-b
llvm-svn: 94596
2010-01-26 21:53:08 +00:00
Chris Lattner
ff234e09b9
Eliminate SetDirective, and replace it with HasSetDirective.
...
Default HasSetDirective to true, since most targets have it.
The targets that claim to not have it probably do, or it is
spelled differently. These include Blackfin, Mips, Alpha, and
PIC16. All of these except pic16 are normal ELF targets, so
they almost certainly have it.
llvm-svn: 94585
2010-01-26 20:40:54 +00:00
Chris Lattner
547c761dd6
eliminate the TargetLowering::UsesGlobalOffsetTable bool, which is
...
subsumed by TargetLowering::getJumpTableEncoding(). Change uses of
it to be more specific.
llvm-svn: 94529
2010-01-26 06:53:37 +00:00
Chris Lattner
4db603f93b
Now that printPICJumpTableSetLabel is not overloaded,
...
inline it into its only caller, allowing us to simplify it
and hoist bits out of the loop.
llvm-svn: 94528
2010-01-26 06:42:44 +00:00
Chris Lattner
8a785d7a67
Move getJTISymbol from MachineJumpTableInfo to MachineFunction,
...
which is more convenient, and change getPICJumpTableRelocBaseExpr
to take a MachineFunction to match.
Next, move the X86 code that create a PICBase symbol to
X86TargetLowering::getPICBaseSymbol from
X86MCInstLower::GetPICBaseSymbol, which was an asmprinter specific
library. This eliminates a 'gross hack', and allows us to
implement X86ISelLowering::getPICJumpTableRelocBaseExpr which now
calls it.
This in turn allows us to eliminate the
X86AsmPrinter::printPICJumpTableSetLabel method, which was the
only overload of printPICJumpTableSetLabel.
llvm-svn: 94526
2010-01-26 06:28:43 +00:00
Chris Lattner
273735bc5a
add a new MachineJumpTableInfo::getJTISymbol method,
...
use it to implement the default TargetLowering::getPICJumpTableRelocBaseExpr
llvm-svn: 94523
2010-01-26 05:58:28 +00:00
Chris Lattner
cc0f734cd0
simplify asmprinter: only emit .set directives when entries have
...
EK_LabelDifference32 kind and the target has .set support. Simplify
X86AsmPrinter::printPICJumpTableSetLabel to make use of recent helpers.
llvm-svn: 94518
2010-01-26 05:15:20 +00:00
Chris Lattner
279de3ef64
rename printPICJumpTableEntry -> EmitJumpTableEntry,
...
make it private and non-virtual. It handles the non-pic
case too, so just use it, simplifying EmitJumpTableInfo.
llvm-svn: 94517
2010-01-26 05:10:10 +00:00
Chris Lattner
d051af7551
add a new MachineBasicBlock::getSymbol method, replacing
...
the AsmPrinter::GetMBBSymbol.
llvm-svn: 94515
2010-01-26 04:55:51 +00:00
Chris Lattner
6715952c25
make MachineFunction keep track of its ID and make
...
MachineFunctionAnalysis dole them out, instead of having
AsmPrinter do both. Have the AsmPrinter::SetupMachineFunction
method set the 'AsmPrinter::MF' variable.
llvm-svn: 94509
2010-01-26 04:35:26 +00:00
Chris Lattner
5fc4160ea3
Add support for target-specific 32-bit custom-lowered
...
jump table entries.
llvm-svn: 94505
2010-01-26 04:05:28 +00:00
Chris Lattner
a7c116016e
switch jump table entry emission to be based on EntryKind
...
instead of magic variables.
llvm-svn: 94500
2010-01-26 03:43:22 +00:00
Chris Lattner
b6db2c6b31
Rearrange handling of jump tables. Highlights:
...
1. MachineJumpTableInfo is now created lazily for a function the first time
it actually makes a jump table instead of for every function.
2. The encoding of jump table entries is now described by the
MachineJumpTableInfo::JTEntryKind enum. This enum is determined by the
TLI::getJumpTableEncoding() hook, instead of by lots of code scattered
throughout the compiler that "knows" that jump table entries are always
32-bits in pic mode (for example).
3. The size and alignment of jump table entries is now calculated based on
their kind, instead of at machinefunction creation time.
Future work includes using the EntryKind in more places in the compiler,
eliminating other logic that "knows" the layout of jump tables in various
situations.
llvm-svn: 94470
2010-01-25 23:26:13 +00:00
Chris Lattner
a4074257ab
eliminate redundant argument to EmitJumpTableInfo
...
llvm-svn: 94464
2010-01-25 22:41:33 +00:00
Chris Lattner
3cde760023
mcstreamerize gprel32 emission.
...
llvm-svn: 94452
2010-01-25 21:28:50 +00:00
Chris Lattner
822742fef9
mcize the non-gprel cases of AsmPrinter::printPICJumpTableEntry
...
llvm-svn: 94450
2010-01-25 21:22:22 +00:00
Chris Lattner
00d188f379
handle the _set_ symbol with an MCSymbol.
...
llvm-svn: 94449
2010-01-25 21:17:10 +00:00
Chris Lattner
19bd039896
rename MAI::PICJumpTableDirective to MAI::GPRel32Directive to
...
make it clear what it is, instead of how it is used.
llvm-svn: 94448
2010-01-25 21:10:10 +00:00
Chris Lattner
360aeb76a2
pull the non-pic jump table case out of printPICJumpTableEntry
...
and MCize the non-pic case. Now printPICJumpTableEntry really
is just about printing PIC entries.
llvm-svn: 94446
2010-01-25 21:01:58 +00:00
Chris Lattner
ccabcd7f85
remove JumpTableDirective, it is always null.
...
llvm-svn: 94445
2010-01-25 20:52:54 +00:00
Chris Lattner
6330d5330e
sink an arm specific method out of asmprinter into the ARMAsmPrinter and
...
rename it to avoid shadowing.
llvm-svn: 94440
2010-01-25 19:39:52 +00:00
Chris Lattner
601ef33c77
mcstreamerize .file and .file. This also fixes an issue where the
...
normal form of .file would fail if the filename had a weird character
in it.
llvm-svn: 94437
2010-01-25 18:58:59 +00:00
Chris Lattner
bc696445e1
emit ELF .type directives through MCStreamer instead of doing it textually.
...
llvm-svn: 94436
2010-01-25 18:33:40 +00:00
Chris Lattner
866a539f5f
add a comment
...
llvm-svn: 94417
2010-01-25 07:53:05 +00:00
Chris Lattner
91dac6d570
emit the .size directive for global variables on ELF through
...
mcstreamer.
llvm-svn: 94416
2010-01-25 07:52:13 +00:00
Chris Lattner
b1301f7bce
mcize lcomm, simplify .comm, extend both to support 64-bit sizes.
...
llvm-svn: 94299
2010-01-23 07:47:02 +00:00
Chris Lattner
76bdea3290
resolve a fixme: the "nonexecutable stack directive" is actually
...
a .section. Switch to it with SwitchSection.
However, I think that this directive should be safe on any ELF target.
If so, we should hoist it up out of the X86 and SystemZ targets.
llvm-svn: 94298
2010-01-23 07:21:06 +00:00
Chris Lattner
0bfd279b37
mcize visibility directives.
...
llvm-svn: 94295
2010-01-23 06:53:23 +00:00
Chris Lattner
685508cf49
move the various directive enums out of the MCStreamer class
...
into a new MCDirectives.h file.
llvm-svn: 94294
2010-01-23 06:39:22 +00:00
Chris Lattner
d1acffc845
Change constantexpr global variable initializers to convert the constants
...
to MCExpr then emit them through MCStreamer with EmitValue. I think all
global variable initializers are now going through mcstreamer.
llvm-svn: 94293
2010-01-23 06:17:14 +00:00
Chris Lattner
1deb09c28d
mcstreamerize .no_dead_strip and .reference for static ctors/dtors.
...
llvm-svn: 94290
2010-01-23 05:51:36 +00:00
Chris Lattner
4225a7b987
mcize jump table and constant pool entry labels, .local on elf,
...
and some .weak directives.
llvm-svn: 94284
2010-01-23 05:19:23 +00:00
Chris Lattner
68eeb5ec9c
emit .ascii and .asciz through MCStreamer.
...
llvm-svn: 94282
2010-01-23 04:54:10 +00:00
Chris Lattner
c3f23b84ea
remove one form of EmitString, just use EmitBytes instead. We must
...
be careful to add a \0 at the end though, because EmitString didn't
do this.
llvm-svn: 94277
2010-01-23 03:11:46 +00:00
Chris Lattner
6f2d99df03
move "EOL" from asmprinter to dwarfprinter. It should eventually
...
be completely eliminated, but today is not that day.
llvm-svn: 94253
2010-01-22 23:47:11 +00:00
Chris Lattner
fa82355f33
move uleb printing from asmprinter to dwarfprinter, mcize,
...
cleanup and eliminate a bunch more uses of "EOL".
llvm-svn: 94250
2010-01-22 23:18:42 +00:00
Chris Lattner
2303145081
move sleb printing out of asmprinter into dwarf printer, make clients
...
handle the comment better, MCize the non-.sleb case.
llvm-svn: 94244
2010-01-22 22:56:55 +00:00
Chris Lattner
edf96a4cc3
add a new DwarfPrinter::EmitEncodingByte method which handles
...
pretty printing encoding comments and eliminates redundancy on
the client side. We now get pretty dwarf like this again:
.byte 255 ## @LPStart Encoding = omit
.byte 0 ## @TType Encoding = absptr
.byte 0x28 ## @TType base offset
.byte 3 ## Call site Encoding = udata4
.byte 0x1a ## Call site table size
...
llvm-svn: 94239
2010-01-22 22:38:16 +00:00
Chris Lattner
f5c834fce1
inline away the trivial AsmPrinter::EOL() method.
...
llvm-svn: 94230
2010-01-22 22:09:00 +00:00
Chris Lattner
13037516aa
inline AsmPrinter::PrintHex into its two trivial callers.
...
llvm-svn: 94228
2010-01-22 21:57:56 +00:00
Chris Lattner
978e2f02a8
change this to be a static function instead of a method on asmprinter.
...
llvm-svn: 94227
2010-01-22 21:50:41 +00:00
Chris Lattner
00562558ab
make the loop comment printer print out a much better structured
...
output. An example:
.align 4, 0x90
LBB1_5: ## %while.cond3
## Parent Loop BB1_1 Depth=1
## => This Loop Header: Depth=2
## Child Loop BB1_8 Depth 3
## Child Loop BB1_6 Depth 3
llvm-svn: 94225
2010-01-22 21:43:28 +00:00
Chris Lattner
e567c8e67f
For blocks that are not loop headers, just print their loop depth and header BB.
...
For loop headers, print Inner loop along with the other stuff so it doesn't take
an extra line. We now get stuff like this:
LBB1_4: ## %land.end
## in Loop: Header=BB1_1 Depth=1
notb %al
testb $1, %al
jne LBB1_8
and:
LBB1_6: ## %while.cond7
## Inner Loop Header: Depth=3
## Inside Loop BB1_5 Depth 2
## Inside Loop BB1_1 Depth 1
which still isn't great for loop headers, but is much less verbose.
llvm-svn: 94221
2010-01-22 21:11:06 +00:00
Chris Lattner
23e43dbba1
reenable the label loop comments and switch them to use the formatted
...
comment emission stuff. I'm going to rewrite this though because the
current output doesn't make sense.
llvm-svn: 94215
2010-01-22 21:00:45 +00:00
Chris Lattner
a3eee3cb69
Convert some more random-comment-printing stuff to use
...
AddComment and GetCommentOS. Add a blank line between globals
(even in non-verbose mode) to make the assembly more readable.
llvm-svn: 94202
2010-01-22 19:52:01 +00:00
Chris Lattner
8fa0e35f97
add a new MCAsmStreamer::GetCommentOS method to simplify stuff
...
that doesn't want to use twines.
llvm-svn: 94199
2010-01-22 19:17:48 +00:00
Chris Lattner
e1d8a319a1
rename addComment -> AddComment for consistency.
...
llvm-svn: 94190
2010-01-22 18:21:35 +00:00
Chris Lattner
38e9219f71
Add the ability for MCStreamer to emit comments on the same line as directives.
...
Switch over the asm-verbose comment for double values to use it. We now get:
_x:
.long 343597384 ## double 1.231200e+02
.long 1079953326
For example, note that the comment is on the same line as the .long. Woo.
llvm-svn: 94166
2010-01-22 07:29:22 +00:00
Chris Lattner
0522eb2160
pass "-fasm-verbose" into createAsmStreamer.
...
llvm-svn: 94165
2010-01-22 07:06:15 +00:00
Chris Lattner
c47ece59a8
don't send null pointers through the constantexpr codepath unneededly.
...
llvm-svn: 94010
2010-01-20 17:57:50 +00:00
Chris Lattner
71601e8b3b
eliminate some uses of AsmPrinter::EmitIntXXX
...
llvm-svn: 93996
2010-01-20 07:41:15 +00:00
Chris Lattner
db42c8d23d
inline and radically simplify printDataDirective. It will eventually
...
go completely away.
llvm-svn: 93994
2010-01-20 07:33:29 +00:00
Chris Lattner
f8dcf784a7
emit basic block labels with mcstreamer.
...
llvm-svn: 93993
2010-01-20 07:24:05 +00:00
Chris Lattner
4c8b1824f0
emit integer and fp zeros as (e.g.) .byte 0 instead of .space 1,
...
for tidiness.
llvm-svn: 93992
2010-01-20 07:19:19 +00:00
Chris Lattner
03cb2a3035
signficant cleanups to EmitGlobalConstant (including streamerization
...
of int initializers), change some methods to be static functions,
use raw_ostream::write_hex instead of a smallstring dance with
APValue::toStringUnsigned(S, 16).
llvm-svn: 93991
2010-01-20 07:11:32 +00:00
Chris Lattner
37020ccf48
switch ConstantFP emission to use MCStreamer, significantly
...
simplifying the code.
llvm-svn: 93988
2010-01-20 06:53:37 +00:00
Chris Lattner
45eeffcc2a
make mcasmstreamer handle expanding 8 byte integer constants to
...
4-byte constants if .quad isn't supported. Switch a bunch of
methods used by the dwarf writer to use OutStreamer.EmitIntValue.
llvm-svn: 93987
2010-01-20 06:45:39 +00:00
Chris Lattner
38caaf14c1
give createAsmStreamer an 'isLittleEndian' argument.
...
llvm-svn: 93986
2010-01-20 06:39:07 +00:00
Chris Lattner
eaef5e111d
simplify the rest of fp constant printing.
...
llvm-svn: 93929
2010-01-19 22:16:33 +00:00
Chris Lattner
c70daf316e
simplify the code for printing x86 long double, don't do work
...
for -fverbose-asm unless it's on.
llvm-svn: 93926
2010-01-19 22:11:05 +00:00
Chris Lattner
ecaf0dcbc6
eliminate AsmPrinter::EmitZeros: just use MCStreamer directly.
...
llvm-svn: 93918
2010-01-19 21:51:22 +00:00
Chris Lattner
c35681b298
Generalize mcasmstreamer data emission APIs to take an address space
...
identifier. There is no way to work around it.
llvm-svn: 93896
2010-01-19 19:46:13 +00:00