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

155 Commits

Author SHA1 Message Date
Reid Spencer
db06ed9156 Add debug support for X86/ELF targets (Linux). This allows llvm-gcc4
generated object modules to be debugged with gdb. Hopefully this helps
pre-release debugging.

llvm-svn: 31299
2006-10-30 22:32:30 +00:00
Evan Cheng
45b6e99308 Doh. Must check if GV is constant first.
llvm-svn: 31252
2006-10-28 05:56:06 +00:00
Evan Cheng
3144b839f0 Put cstrings in .cstring section when compiling for Mac OS X.
llvm-svn: 31203
2006-10-26 19:18:18 +00:00
Devang Patel
0691019e12 Move getPreferredAlignmentLog from AsmPrinter to TargetData
llvm-svn: 31171
2006-10-24 20:32:14 +00:00
Anton Korobeynikov
da7897a6c8 Do section switching right way for Mingw\Cygwin and Linux.
This will allow (after llvm-gcc linkage fix) more dummy tests using
libstdc++ to pass on mingw :)

llvm-svn: 31120
2006-10-22 21:37:13 +00:00
Anton Korobeynikov
d1436ae792 Fixed mingw\cygwin linkonce linkage once again.
Added workaround for linker bug with linkonce sections.
Changed sections prefix to allow linker merge them
(PE loader doesn't like too much long-named sections :) )
All of this unbreaks libstdc++ on mingw32 allowing (small)
programs to be compiled, linked and run.

llvm-svn: 31033
2006-10-18 09:12:29 +00:00
Anton Korobeynikov
c86485a397 Adding linkonce linkage codegeneration support for mingw32\cygwin
targets.

llvm-svn: 31011
2006-10-17 20:29:49 +00:00
Anton Korobeynikov
61d88967b9 Align stack size to DWORD boundary
llvm-svn: 30964
2006-10-14 20:53:35 +00:00
Chris Lattner
b826d65e01 Various random and minor code cleanups.
llvm-svn: 30608
2006-09-26 03:57:53 +00:00
Anton Korobeynikov
59ef7e94eb Adding codegeneration for StdCall & FastCall calling conventions
llvm-svn: 30549
2006-09-20 22:03:51 +00:00
Anton Korobeynikov
7c2118575c Added some eye-candy for Subtarget type checking
Added X86 StdCall & FastCall calling conventions. Codegen will follow.

llvm-svn: 30446
2006-09-17 20:25:45 +00:00
Anton Korobeynikov
6e19f80688 Adding dllimport, dllexport and external weak linkage types.
DLL* linkages got full (I hope) codegeneration support in C & both x86
assembler backends.
External weak linkage added for future use, we don't provide any
codegeneration, etc. support for it.

llvm-svn: 30374
2006-09-14 18:23:27 +00:00
Evan Cheng
15dd42884e Committing X86-64 support.
llvm-svn: 30177
2006-09-08 06:48:29 +00:00
Jim Laskey
9da25f6119 Make target asm info a property of the target machine.
llvm-svn: 30162
2006-09-07 22:06:40 +00:00
Jim Laskey
d2830c11b8 Make the x86 asm flavor part of the subtarget info.
llvm-svn: 30146
2006-09-07 12:23:47 +00:00
Jim Laskey
6b86ef852c Separate target specific asm properties from the asm printers.
llvm-svn: 30126
2006-09-06 18:34:40 +00:00
Nate Begeman
0e92042770 Emit .set directives for jump table entries when possible, which reduces
the number of relocations in object files, shrinkifying them.

llvm-svn: 29650
2006-08-12 21:29:52 +00:00
Jim Laskey
046abcdbec Use the predicate.
llvm-svn: 29322
2006-07-27 02:05:13 +00:00
Nate Begeman
3d5f5b4e8b Support jump tables when in PIC relocation model
llvm-svn: 29318
2006-07-27 01:13:04 +00:00
Chris Lattner
0f2560a313 Add an out-of-line virtual method for X86DwarfWriter to give it a home.
llvm-svn: 29153
2006-07-14 23:05:05 +00:00
Evan Cheng
1b53896495 Move .literal4 and .literal8 support into AsmPrinter.cpp
llvm-svn: 28978
2006-06-29 00:33:06 +00:00
Evan Cheng
36d3fccf4b Doh.
llvm-svn: 28963
2006-06-28 17:56:43 +00:00
Evan Cheng
e123f47232 Oops. Need to keep CP index.
llvm-svn: 28958
2006-06-28 07:55:24 +00:00
Evan Cheng
3963b5ee02 Darwin puts float and double literal constants into literal4 and literal8 sections.
llvm-svn: 28957
2006-06-28 07:35:41 +00:00
Evan Cheng
6fd191494f Be consistent with gcc.
llvm-svn: 28682
2006-06-04 07:24:07 +00:00
Evan Cheng
77b8eaf292 Minor bug caught by Ashwin Chandra
llvm-svn: 28491
2006-05-26 06:22:34 +00:00
Evan Cheng
564c7ac8f6 X86 / Cygwin asm / alignment fixes.
Patch contributed by Anton Korobeynikov!

llvm-svn: 28480
2006-05-25 21:59:08 +00:00
Chris Lattner
0c4a1e56f4 Fix the MASM asmprinter's lies. It does not want to emit code to .text/.data
it wants it emitted to _text/_data.

llvm-svn: 28185
2006-05-09 05:12:53 +00:00
Chris Lattner
f45b6d5c08 Split SwitchSection into SwitchTo{Text|Data}Section methods.
llvm-svn: 28184
2006-05-09 04:59:56 +00:00
Jeff Cohen
248e133255 Fix some loose ends in MASM support.
llvm-svn: 28148
2006-05-06 21:27:14 +00:00
Chris Lattner
12bb901c93 Print *some* grouping around inline asm blocks so we know where they are.
llvm-svn: 28133
2006-05-05 21:48:50 +00:00
Jeff Cohen
a954c15ea1 Make Intel syntax the default when LLVM is built with VC++.
llvm-svn: 28095
2006-05-04 16:19:27 +00:00
Owen Anderson
71bc529dfa Refactor TargetMachine, pushing handling of TargetData into the target-specific subclasses. This has one caller-visible change: getTargetData() now returns a pointer instead of a reference.
This fixes PR 759.

llvm-svn: 28074
2006-05-03 01:29:57 +00:00
Nate Begeman
fa83cee567 Hooray, everyone now uses the same printBasicBlockLabel implementation
llvm-svn: 28056
2006-05-02 17:34:51 +00:00
Nate Begeman
05174045df Extend printBasicBlockLabel a bit so that it can be used to print all
basic block labels, consolidating the code to do so in one place for each
target.

llvm-svn: 28050
2006-05-02 05:37:32 +00:00
Nate Begeman
7ed816f900 JumpTable support! What this represents is working asm and jit support for
x86 and ppc for 100% dense switch statements when relocations are non-PIC.
This support will be extended and enhanced in the coming days to support
PIC, and less dense forms of jump tables.

llvm-svn: 27947
2006-04-22 18:53:45 +00:00
Jim Laskey
f3cc740d75 Change interface to DwarfWriter.
llvm-svn: 26991
2006-03-23 18:09:44 +00:00
Evan Cheng
7ec94f2ff7 Added getTargetLowering() to TargetMachine. Refactored targets to support this.
llvm-svn: 26742
2006-03-13 23:20:37 +00:00
Jim Laskey
91d5ce2531 Use "llvm.metadata" section for debug globals. Filter out these globals in the
asm printer.

llvm-svn: 26599
2006-03-07 22:00:35 +00:00
Evan Cheng
03940bfcfe - Emit subsections_via_symbols for Darwin.
- Conditionalize Dwarf debugging output (Darwin only for now).

llvm-svn: 26582
2006-03-07 02:23:26 +00:00
Evan Cheng
2327759419 Enable Dwarf debugging info.
llvm-svn: 26581
2006-03-07 02:02:57 +00:00
Chris Lattner
72d24be146 "." isn't enough to get a private label on linux, use ".L".
llvm-svn: 26327
2006-02-23 05:25:02 +00:00
Evan Cheng
2977507828 PIC related bug fixes.
1. Various asm printer bug.
2. Lowering bug. Now TargetGlobalAddress is wrapped in X86ISD::TGAWrapper.

llvm-svn: 26324
2006-02-23 02:43:52 +00:00
Evan Cheng
6501c0cfc0 Use .zerofill on x86/darwin.
llvm-svn: 26196
2006-02-15 01:56:23 +00:00
Chris Lattner
2e1a495967 Darwin doesn't support #APP/#NO_APP
llvm-svn: 26066
2006-02-08 23:42:22 +00:00
Evan Cheng
de20d3fb32 Fixed a local common symbol bug.
llvm-svn: 26044
2006-02-07 23:32:58 +00:00
Evan Cheng
a505719b8a For ELF, .comm takes alignment value as the optional 3rd argument. It must be
specified in bytes.

llvm-svn: 26043
2006-02-07 21:54:08 +00:00
Evan Cheng
15369d0b89 Darwin ABI issues: weak, linkonce, etc. dynamic-no-pic support is complete.
Also fixed a function stub bug. Added weak and linkonce support for
x86 Linux.

llvm-svn: 26038
2006-02-07 08:38:37 +00:00
Chris Lattner
74fd4905bc Use getPreferredAlignmentLog.
llvm-svn: 25980
2006-02-05 01:45:04 +00:00
Chris Lattner
95555853ad Use the shared asmprinter code for printing special llvm globals
llvm-svn: 24695
2005-12-13 06:32:50 +00:00
Chris Lattner
0975e89328 Add ELF and darwin support for static ctors and dtors
llvm-svn: 24693
2005-12-13 04:53:51 +00:00
Chris Lattner
3efe6171f1 Use HasDotTypeDotSizeDirective instead of forELF
llvm-svn: 24481
2005-11-21 23:06:54 +00:00
Chris Lattner
fb4a026c32 Remove a level of indentation by using a continue.
llvm-svn: 24479
2005-11-21 22:48:18 +00:00
Chris Lattner
77bd127e14 Use subtarget information computed by X86Subtarget instead of rolling our own.
llvm-svn: 24477
2005-11-21 22:39:40 +00:00
Chris Lattner
0a2fc68b8a Add a forELF flag, allowing the removal of forCygwin and simplification of
conditionals.

llvm-svn: 24475
2005-11-21 22:19:48 +00:00
Chris Lattner
fe8b9b90d4 simplify and genericize this code
llvm-svn: 24473
2005-11-21 19:50:31 +00:00
Chris Lattner
9a74c980e8 prune #include
llvm-svn: 24468
2005-11-21 08:33:17 +00:00
Chris Lattner
03d9332c4f Switch to using the shared constant pool printer, along with using shorter
CPI ids

llvm-svn: 24467
2005-11-21 08:32:23 +00:00
Chris Lattner
3e2c6c1d15 Adjust to capitalized AsmPrinter method names
llvm-svn: 24456
2005-11-21 07:51:23 +00:00
Chris Lattner
83215f8935 convert the rest of this over to use SwitchSection
llvm-svn: 24448
2005-11-21 07:16:34 +00:00
Chris Lattner
a19d2349b1 Start using the AsmPrinter shared SwitchSection code. This allows the X86
backend to implement global variables in sections.

llvm-svn: 24447
2005-11-21 07:11:11 +00:00
Chris Lattner
e5d0064a9d Rename SwitchSection -> switchSection to avoid conflicting with a future
change.

llvm-svn: 24443
2005-11-21 06:55:27 +00:00
Chris Lattner
00a2d1554b Naturally align doubles in the constant pool, set PrivateGlobalPrefix on
darwin, use it when printing the constant pool indices so the labels are
appropriately private, emit cp entries to .const instead of .data on darwin
and only emit a single .section for the constant pool, not one for each
entry.

llvm-svn: 24440
2005-11-21 06:46:22 +00:00
Jeff Cohen
bd51ec7461 Eliminate all remaining tabs and trailing spaces.
llvm-svn: 22523
2005-07-27 06:12:32 +00:00
Nate Begeman
c93c1c5148 A couple more darwinisms
llvm-svn: 22450
2005-07-16 01:59:47 +00:00
Nate Begeman
faf9b5b763 Commit some pending darwin changes before subtarget support.
llvm-svn: 22388
2005-07-12 01:37:28 +00:00
Chris Lattner
af83621722 Fix crazy indentation
llvm-svn: 22380
2005-07-11 06:25:47 +00:00
Nate Begeman
70532b9f00 Add support for assembling .s files on mac os x for intel
Add support for running bugpoint on mac os x for intel

llvm-svn: 22351
2005-07-08 00:23:26 +00:00
Nate Begeman
12d2961fd2 The statistic needs to be in the correct namespace.
llvm-svn: 22327
2005-07-01 23:56:38 +00:00
Chris Lattner
b299933fc7 Refactor X86AsmPrinter.cpp into multiple files. Patch contributed
by Aaron Gray, cleaned up by me.

llvm-svn: 22324
2005-07-01 22:44:09 +00:00
Nate Begeman
31e3028bac Make the x86 asm printer darwin-aware. This mostly entails doing the same
thing as cygwin most of the time, and printing our alignments in log2
rather than number of bytes.

llvm-svn: 22316
2005-06-30 00:53:20 +00:00
John Criswell
00c8485c77 Fixed indentation.
llvm-svn: 22270
2005-06-20 19:59:22 +00:00
Misha Brukman
bf3f6181fd * Remove trailing whitespace
* Convert tabs to spaces

llvm-svn: 21426
2005-04-21 23:38:14 +00:00
Chris Lattner
c9a3ea81bf Fix the missing symbols problem Bill was hitting. Patch contributed by
Bill Wendling!!

llvm-svn: 20649
2005-03-17 15:38:16 +00:00
Chris Lattner
4b688a1c70 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!

llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Reid Spencer
b0ca4aa8cd Patch to make assembly output compatible with mingw compilation (identical
to cygwin)

llvm-svn: 20520
2005-03-08 17:02:05 +00:00
Reid Spencer
5c7b6e83f0 Support Cygwin assembly generation. The cygwin version of Gnu ASsembler
doesn't support certain directives and symbols on cygwin are prefixed with
an underscore. This patch makes the necessary adjustments to the output.

llvm-svn: 19775
2005-01-23 03:52:14 +00:00
Chris Lattner
a5f0ba59a0 Print a load of a null pointer (in intel mode) like this:
mov %AX, WORD PTR [0]

instead of like this:

        mov %AX, WORD PTR []

llvm-svn: 19501
2005-01-12 04:07:11 +00:00
Chris Lattner
360988bae2 Print a load of a null pointer like this:
movw 0, %ax

instead of like this:

        movw , %ax

llvm-svn: 19500
2005-01-12 04:05:19 +00:00
Chris Lattner
4b1d58bf4b Adjust to changes in asmwriter filenames
llvm-svn: 18987
2004-12-16 17:33:24 +00:00
Misha Brukman
8c1b4a5b9d GhostLinkage should not reach asm printing stage
llvm-svn: 17750
2004-11-14 21:03:49 +00:00
Chris Lattner
09b7f968e0 Don't print unneeded labels
llvm-svn: 17714
2004-11-13 23:27:11 +00:00
Chris Lattner
892b15538d Give the asmprinter the ability to print memrefs with a constant pool index,
index reg and scale

llvm-svn: 17081
2004-10-17 07:16:32 +00:00
Chris Lattner
812d56631a Give the X86 asm printer the ability to print out addressing modes that have
constant displacements from global variables.  Patch by Jeff Cohen!

llvm-svn: 17009
2004-10-15 04:44:53 +00:00
Chris Lattner
0228f228df * Prune #includes
* Update comments
* Rearrange code a bit
* Finally ELIMINATE the GAS workaround emitter for Intel mode.  woot!

llvm-svn: 16647
2004-10-04 07:31:08 +00:00
Chris Lattner
581948c8f6 Add support for emitting AT&T style .s files, and make it the default. Users
may now choose their output format with the -x86-asm-syntax={intel|att} flag.

llvm-svn: 16646
2004-10-04 07:24:48 +00:00
Chris Lattner
8d44dcca97 Add support for the -x86-asm-syntax flag, which can be used to choose between
Intel and AT&T style assembly language.  The ultimate goal of this is to
eliminate the GasBugWorkaroundEmitter class, but for now AT&T style emission
is not fully operational.

llvm-svn: 16639
2004-10-03 20:36:57 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Chris Lattner
8c5096d223 Rename var
llvm-svn: 15897
2004-08-18 02:22:55 +00:00
Chris Lattner
d3d5c1d2a2 Start using alignment output routines from AsmPrinter.
Changes to make this more similar to the ppc asmprinter

llvm-svn: 15890
2004-08-17 19:25:42 +00:00
Chris Lattner
052cebe33c Use the AsmPrinter emitGlobalConstant.
llvm-svn: 15872
2004-08-17 06:48:55 +00:00
Chris Lattner
bf5dba50c5 Start using the AsmPrinter to emit our first class constants. This also
drops our half-assed support for cygwin, which noone uses and doesn't work
anyway.

llvm-svn: 15839
2004-08-16 23:16:06 +00:00
Chris Lattner
b09bc9d4e3 Remove a dead method
llvm-svn: 15659
2004-08-11 07:07:14 +00:00
Chris Lattner
3fc9d4490c Finally, the entire instruction asmprinter is now generated from tblgen, woo!
llvm-svn: 15658
2004-08-11 07:02:04 +00:00
Chris Lattner
3cef2f82ff Add asmprintergen support for the last X86 instruction that needs it: pcrelative calls.
llvm-svn: 15657
2004-08-11 06:59:12 +00:00
Chris Lattner
f34003128d Move hacks up
llvm-svn: 15654
2004-08-11 06:09:55 +00:00
Chris Lattner
b66b9cd4a9 Convert asmprinter to new style of instruction printer
Start asmprintergen'ifying machine instrs with memory operands.

llvm-svn: 15646
2004-08-11 02:25:00 +00:00
Alkis Evlogimenos
f853362a44 Stop using getValues().
llvm-svn: 15487
2004-08-04 08:44:43 +00:00
Chris Lattner
de4844f84d Get rid of 3 of the 4 'printimplicit' flags. Implicit operands are now
explicitly listed in the asm string.

llvm-svn: 15397
2004-08-01 08:22:29 +00:00
Chris Lattner
0a6fedb451 Handle registers a bit more efficiently
llvm-svn: 15395
2004-08-01 08:12:41 +00:00