1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

302 Commits

Author SHA1 Message Date
Chris Lattner
4a33f01892 Change MCAsmStreamer to take an MCInstPrinter instead of a
full AsmPrinter, and change TargetRegistry to keep track
of registered MCInstPrinters.

llvm-mc is still linking in the entire
target foo to get the code emitter stuff, but this is an
important step in the right direction.

llvm-svn: 81754
2009-09-14 03:02:37 +00:00
Chris Lattner
a00e070ea0 Give MCInstPrinter a MCAsmInfo member, make X86ATTInstPrinter
be a MCInstPrinter.

llvm-svn: 81746
2009-09-14 01:49:26 +00:00
Chris Lattner
8da6598a75 tidy up a bit.
llvm-svn: 81744
2009-09-14 01:34:40 +00:00
Chris Lattner
334aa7a1d4 remove all but one reference to TargetRegisterDesc::AsmName.
llvm-svn: 81714
2009-09-13 20:31:40 +00:00
Chris Lattner
20b7392123 the tblgen produced 'getRegisterName' method does not access
the object, make it static instead of const.

llvm-svn: 81711
2009-09-13 20:19:22 +00:00
Chris Lattner
31c7141542 switch the x86 asmprinters to use getRegisterName instead
of getting it from TRI, inst printing now is codegen context
free!

llvm-svn: 81710
2009-09-13 20:15:16 +00:00
Chris Lattner
0cde5283e3 make tblgen produce a function that returns the name for a physreg.
Nothing is using this info yet.

llvm-svn: 81707
2009-09-13 20:08:00 +00:00
Chris Lattner
fb0e41caef make intel asmprinter use TRI::getAsmName instead of TRI::getName like
all the other targets.  Add support for weak/linkonce linkage so it doesn't
crash on basically all nontrivial testcases.

llvm-svn: 81704
2009-09-13 19:44:38 +00:00
Chris Lattner
96e22d6462 split MCInst printing out of the X86ATTInstPrinter
class into its own X86ATTInstPrinter class.  The inst
printer now has just one dependence on the code generator
(TRI).

llvm-svn: 81703
2009-09-13 19:30:11 +00:00
Chris Lattner
57dbcc4388 reduce indentation with early exit.
llvm-svn: 81699
2009-09-13 19:10:08 +00:00
Chris Lattner
a0dbce2e0e delete the fixme too! :)
llvm-svn: 81689
2009-09-13 18:50:22 +00:00
Chris Lattner
dfc3079a9e merge the linux cpool/jtbl pic tests into pic.ll and convert to filecheck.
Change the picbase symbol on non-darwin systems from ".Lllvm$4.$piclabel" to
".L4$pb".  The actual name doesn't matter and the darwin name is shorter.

llvm-svn: 81688
2009-09-13 18:46:37 +00:00
Chris Lattner
9e536003ba make X86ATTAsmPrinter::PrintPICBaseSymbol forward to X86MCInstLower.
llvm-svn: 81685
2009-09-13 18:33:59 +00:00
Chris Lattner
cbcbedf254 replace printBasicBlockLabel with EmitBasicBlockStart,
now that printBasicBlockLabel is only used for starting
a MBB.  This allows elimination of a bunch of arguments.

llvm-svn: 81684
2009-09-13 18:25:37 +00:00
Chris Lattner
de1324146e convert some uses of printBasicBlockLabel to use GetMBBSymbol
instead.

llvm-svn: 81677
2009-09-13 17:14:04 +00:00
Chris Lattner
ff9d0f20fa devirtualize AsmPrinter::printBasicBlockLabel since it is never overridden.
Move GetMBBSymbol up to AsmPrinter and make printBasicBlockLabel use it so that
we only have one place that decides what to name bb labels.  Hopefully various
clients of printBasicBlockLabel can start using GetMBBSymbol instead.

llvm-svn: 81652
2009-09-12 23:02:08 +00:00
Chris Lattner
3d47ac7330 factor MBB label lowering better
llvm-svn: 81630
2009-09-12 21:06:08 +00:00
Chris Lattner
b2fdae122a X86MCInstLower::Lower should only not emit anything to OutStreamer,
this means that it can only lower one MachineInstr to one MCInst.  To
make this fly, we need to pull out handling of MO_GOT_ABSOLUTE_ADDRESS
(which generates an implicit label) out of X86MCInstLower.

llvm-svn: 81629
2009-09-12 21:01:20 +00:00
Chris Lattner
53cca8590c eliminate the "MBBLabel" MCOperand type, and just use a MCSymbol for
MBB labels like everything else.

llvm-svn: 81628
2009-09-12 20:45:03 +00:00
Chris Lattner
fb113da948 split MachineInstr -> MCInst lowering into its own class (not
being embedded into X86ATTAsmPrinter).  This still depends heavily
on X86ATTAsmPrinter, but this is a step in the right direction.

llvm-svn: 81627
2009-09-12 20:34:57 +00:00
Chris Lattner
fe33b51da0 remove the "old" at&t style asmprinter. Unfortunately, most of the
operand printing crapola cannot be removed yet because it is used by
the inline asm print stuff.

llvm-svn: 81626
2009-09-12 20:01:36 +00:00
Chris Lattner
6a552d18b5 fix another GCC bootstrap problem, which manifested as things
like:
foo.s:2412:non-relocatable subtraction expression, "_gomp_tls_key" minus "L1$pb"

llvm-svn: 81596
2009-09-12 01:11:50 +00:00
Chris Lattner
1ac6dc75be fix an embarassing typo that resulted in llvm-gcc bootstrap miscompare
because the sorting wasn't sorting.

llvm-svn: 81592
2009-09-12 00:49:00 +00:00
Ted Kremenek
e98d47cdfe Update CMake files.
llvm-svn: 81577
2009-09-11 21:49:45 +00:00
Chris Lattner
4f048e3a67 fix pasto
llvm-svn: 81544
2009-09-11 18:33:44 +00:00
Chris Lattner
c0ef7f109b fix some fixmes: emit stubs in sorted order.
llvm-svn: 81541
2009-09-11 18:20:26 +00:00
Chris Lattner
ebfcd8d588 turn on -experimental-asm-printer for x86 / AT&T by default.
llvm-svn: 81532
2009-09-11 17:07:27 +00:00
Chris Lattner
beee27777a switch HiddenGVStubs to be a DenseMap instead of a string map, mirroring FnStubs and GVStubs.
llvm-svn: 81514
2009-09-11 07:03:20 +00:00
Chris Lattner
04be362b0a Fix a bug I introduced in FnStubs generation, switch GVStubs to be a
densemap instead of StringMap to match FnStubs.

llvm-svn: 81513
2009-09-11 06:59:18 +00:00
Chris Lattner
316cce5a0f change FnStubs from being a StringMap<std::string> to being a much
more efficient SmallPtrSet<MCSymbol*>.  This eliminates string
craziness and fixes CodeGen/X86/darwin-quote.ll with the new asmprinter.

Codegen is producing stubs in a nondeterminstic order, but it was doing
this before anyway.

llvm-svn: 81511
2009-09-11 06:36:33 +00:00
Chris Lattner
c61e9c130b printInstruction() no longer prints a \n after itself, do it
for the two instruction MOVPC32r sequence.

llvm-svn: 81509
2009-09-11 05:59:55 +00:00
Chris Lattner
0f5802b4d8 reimplement X86ATTAsmPrinter::GetGlobalAddressSymbol in terms of
Mangler::getNameWithPrefix.  In addition to avoiding some over
quoting, this also is more efficient because it uses smallvector
instead of std::string thrashing.

llvm-svn: 81508
2009-09-11 05:58:44 +00:00
Chris Lattner
6484bead9e convert X86ATTAsmPrinter::GetExternalSymbolSymbol to use SmallString
instead of std::string and Mangler.

llvm-svn: 81503
2009-09-11 04:36:43 +00:00
Chris Lattner
e2cb22eb96 rearrange some code, export a SmallString version of DecorateCygMingName.
llvm-svn: 81502
2009-09-11 04:28:13 +00:00
Chris Lattner
b9aca1a178 remove DebugLoc from MCInst and eliminate "Comment printing" from
the MCInst path of the asmprinter.  Instead, pull comment printing
out of the autogenerated asmprinter into each target that uses the
autogenerated asmprinter.  This causes code duplication into each
target, but in a way that will be easier to clean up later when more
asmprinter stuff is commonized into the base AsmPrinter class.

This also fixes an xcore strangeness where it inserted two tabs
before every instruction.

llvm-svn: 81396
2009-09-09 23:14:36 +00:00
Chris Lattner
8dd3d8b930 add a gross hack to get "SrcLine" comments to show up with the
new asmprinter.  Differently gross hack coming next.

llvm-svn: 81379
2009-09-09 20:45:42 +00:00
Chris Lattner
52651f7623 hoist the call to processDebugLoc out of the generated
asm printer into the "printInstruction" routine.  This
fixes a problem where the experimental asmprinter would
drop debug labels in some cases, and fixes issues on ppc/xcore
where pseudo instructions like "mr" didn't get debug locs properly.

It is annoying that this moves the call from one place into each
target, but a future set of more invasive refactorings will fix
that problem.

llvm-svn: 81377
2009-09-09 20:34:59 +00:00
Chris Lattner
2dfd5f5963 disable the new asmprinter by default. Both the Mangler and MCSymbol
printing stuff are quoting symbols now, breaking objc testcases.

llvm-svn: 81319
2009-09-09 06:11:14 +00:00
Chris Lattner
c74e9c2c37 turn the mcinst asmprinter on by default for x86, tweaking two tests to
expect the slight syntax differences in the generated code.

llvm-svn: 81305
2009-09-09 00:41:36 +00:00
Chris Lattner
56a465385b tidy up
llvm-svn: 81304
2009-09-09 00:40:31 +00:00
Chris Lattner
91c9c8a18e make sure to send external symbols through the mangler,
this fixes mingw-alloca.ll with the new asmprinter.

llvm-svn: 81301
2009-09-09 00:23:32 +00:00
Chris Lattner
f387735da5 add support for @PLT and friends on external symbols, fixes
x86-64-pic-11.ll with the new asmprinter.

llvm-svn: 81294
2009-09-09 00:10:14 +00:00
Chris Lattner
0b34068b2b change selectiondag to add the sign extended versions of immediate operands
to instructions instead of zero extended ones.  This makes the asmprinter
print signed values more consistently.  This apparently only really affects
the X86 backend.

llvm-svn: 81265
2009-09-08 23:05:44 +00:00
Chris Lattner
ca44919aac add support for some missing modifiers on jumptable/constant pool entries.
llvm-svn: 81199
2009-09-08 06:25:12 +00:00
Chris Lattner
893fbc4fec add a bunch more evil lowering code to work around various :subreg32 modifiers
in the .td files.  This gets us down to 18 failures in codegen/x86 with the
new asmprinter.

llvm-svn: 81198
2009-09-08 06:19:15 +00:00
Chris Lattner
ef96a8b64d ADd support for "lowering" the X86::MOVZX16rr8/X86::MOVZX16rm8
subreg32 modifiers.

llvm-svn: 81196
2009-09-08 06:03:07 +00:00
Chris Lattner
8accd1ddcf add a hack to lower MOV16r0 to MOV32r0 in MCInstLower, eliminating
the problem with subreg32 modifiers.  This gets all of Olden working
with the new asmprinter.

llvm-svn: 81195
2009-09-08 05:49:25 +00:00
Duncan Sands
265ebcdcfc Remove unreachable code.
llvm-svn: 81126
2009-09-06 19:27:53 +00:00
Duncan Sands
598fe699d0 Remove some not-really-used variables, as warned
about by icc (#593, partial).  Patch by Erick Tryzelaar.

llvm-svn: 81115
2009-09-06 12:41:19 +00:00
Chris Lattner
6ea9973a0b don't call getOffset() on jump tables, this fixes three failing olden benchmarks
with the new asmprinter.

llvm-svn: 80906
2009-09-03 07:36:42 +00:00