Dan Gohman
26719acdb7
Add a const.
...
llvm-svn: 101777
2010-04-19 15:39:27 +00:00
Chris Lattner
65d1e40895
teach the x86 asm parser how to handle segment prefixes
...
in memory operands. rdar://7874844
llvm-svn: 101661
2010-04-17 18:56:34 +00:00
Chris Lattner
a5798151a3
refactor .if handling code a bit.
...
llvm-svn: 101659
2010-04-17 18:14:27 +00:00
Chris Lattner
124dc743bc
implement mc asmparser support for '.', which gets the
...
current PC. rdar://7834775
We now produce an identical .o file compared to the cctools
assembler for something like this:
_f0:
L0:
jmp L1
.long . - L0
L1:
jmp A
.long . - L1
.zerofill __DATA,_bss,A,0
llvm-svn: 101227
2010-04-14 04:40:28 +00:00
Sean Callanan
b76f351c0b
Quick fix for build errors caused by undefined
...
NULL.
llvm-svn: 101180
2010-04-13 21:36:35 +00:00
Sean Callanan
29a7152676
Fixed a nasty layering violation in the edis source
...
code. It used to #include the enhanced disassembly
information for the targets it supported straight
out of lib/Target/{X86,ARM,...} but now it uses a
new interface provided by MCDisassembler, and (so
far) implemented by X86 and ARM.
Also removed hacky #define-controlled initialization
of targets in edis. If clients only want edis to
initialize a limited set of targets, they can set
--enable-targets on the configure command line.
llvm-svn: 101179
2010-04-13 21:21:57 +00:00
Chris Lattner
e154403f78
delete a forwarding function.
...
llvm-svn: 100815
2010-04-08 21:34:17 +00:00
Chris Lattner
1cf4bded13
move elf section uniquing to MCContext. Along the way
...
merge XCore's section into MCSectionELF
llvm-svn: 100812
2010-04-08 21:26:26 +00:00
Chris Lattner
0225dbbfee
remove the TargetLoweringObjectFileMachO::getMachoSection
...
api and update clients to use MCContext instead.
llvm-svn: 100808
2010-04-08 20:40:11 +00:00
Chris Lattner
60ff59e5c1
move macho section uniquing from MCParser and TLOF to MCContext where
...
the compiler and asmparser now unique to the same sections. This fixes
rdar://7835021.
llvm-svn: 100807
2010-04-08 20:30:37 +00:00
Chris Lattner
f753452587
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
ecdad4bb0c
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
2f1c065cef
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
8fb6be1886
fix an ugly wart in the MCInstPrinter api where the
...
raw_ostream to print an instruction to had to be specified
at MCInstPrinter construction time instead of being able
to pick at each call to printInstruction.
llvm-svn: 100307
2010-04-04 05:04:31 +00:00
Chris Lattner
b6769a8513
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
4e8e791414
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
8e4cf6f425
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
Daniel Dunbar
d04906b49e
llvm-mc: Add a -mc-relax-all option, which relaxes every fixup. We always need
...
exactly two passes in that case, and don't ever need to recompute any layout,
so this is a nice baseline for relaxation performance.
llvm-svn: 99563
2010-03-25 22:49:09 +00:00
Daniel Dunbar
21e9834bc1
MC: Stop restarting layout on every relaxation.
...
- Still O(N^2), just a faster form, and now its the MCAsmLayout's fault.
On the .s I am tuning against (combine.s from 403.gcc):
--
ddunbar@lordcrumb:MC$ diff stats-before.txt stats-after.txt
5,10c5,10
< 1728 assembler - Number of assembler layout and relaxation steps
< 7707 assembler - Number of emitted assembler fragments
< 120588 assembler - Number of emitted object file bytes
< 2233448 assembler - Number of evaluated fixups
< 1727 assembler - Number of relaxed instructions
< 6723845 mcexpr - Number of MCExpr evaluations
---
> 3 assembler - Number of assembler layout and relaxation steps
> 7707 assembler - Number of emitted assembler fragments
> 120588 assembler - Number of emitted object file bytes
> 14796 assembler - Number of evaluated fixups
> 1727 assembler - Number of relaxed instructions
> 67889 mcexpr - Number of MCExpr evaluations
--
Feel free to LOL at the -before numbers, if you like.
I am a little surprised we make more than 2 relaxation passes. It's pretty
trivial for us to do relaxation out-of-order if that would give a speedup.
llvm-svn: 99543
2010-03-25 19:35:56 +00:00
Daniel Dunbar
4935edfb58
MC: Simplify main section layout process by moving alignment into LayoutSection.
...
llvm-svn: 99529
2010-03-25 18:16:42 +00:00
Daniel Dunbar
8d2b718d91
MC: Sink Section address assignment into LayoutSection.
...
llvm-svn: 99528
2010-03-25 18:16:38 +00:00
Daniel Dunbar
de3fc7d4d8
MC: Explicity track section and fragment ordinals.
...
llvm-svn: 99500
2010-03-25 07:10:11 +00:00
Daniel Dunbar
797b44b26c
MC: Route access to SectionData offset and file size through MCAsmLayout.
...
llvm-svn: 99474
2010-03-25 02:00:07 +00:00
Daniel Dunbar
4b6b2a1a1f
MC: Route access to Fragment offset and effective size through MCAsmLayout.
...
llvm-svn: 99473
2010-03-25 02:00:02 +00:00
Daniel Dunbar
70fbcbc1cd
MC: Eliminate MC{Fragment,{Section,Symbol}Data}::getAddress.
...
llvm-svn: 99467
2010-03-25 01:03:24 +00:00
Dan Gohman
8493042e4d
Docuemntation corrections from John Myers.
...
llvm-svn: 99454
2010-03-25 00:03:04 +00:00
Daniel Dunbar
3a79d30c6c
MC: Direct all {fragment,section,symbol} address access through the MCAsmLayout object.
...
llvm-svn: 99380
2010-03-24 03:43:40 +00:00
Daniel Dunbar
47743ae59a
MC: Add TargetAsmBackend::MayNeedRelaxation, for checking whether a particular instruction + fixups might need relaxation.
...
llvm-svn: 99249
2010-03-23 03:13:05 +00:00
Daniel Dunbar
ae8d914c58
MC: Tweak MCInstFragment to include the encoded data and fixups, so that we don't need to recompute them during relaxation. I will revisit this once all the other pieces of fast relaxation are in place.
...
llvm-svn: 99244
2010-03-23 01:39:05 +00:00
Jeffrey Yasskin
b9c181ea1a
Put MCSectionCOFF::Name into the MCContext instead of leaking it.
...
llvm-svn: 99231
2010-03-22 23:26:12 +00:00
Daniel Dunbar
0f6983752f
MC: Add MCInstFragment, not used yet.
...
llvm-svn: 99229
2010-03-22 23:16:48 +00:00
Daniel Dunbar
4b5c134c5b
MC: Fix a few more cases we were passing an MCDataFragment when a MCFragment would do, and sprinkle in some const.
...
llvm-svn: 99218
2010-03-22 21:49:41 +00:00
Daniel Dunbar
38fd48e06b
MCInst: Add ::dump_pretty.
...
llvm-svn: 99216
2010-03-22 21:49:34 +00:00
Daniel Dunbar
6a91d2767b
MC: Change MCObjectWriter::RecordRelocation to take an MCFragment (instead of a MCDataFragment). Object files should only need the generic MCFragment features.
...
llvm-svn: 99205
2010-03-22 20:35:50 +00:00
Daniel Dunbar
264c33a099
MC: Eliminate MCFragment::getMaxFileSize.
...
llvm-svn: 99203
2010-03-22 20:35:43 +00:00
Daniel Dunbar
6ea8fe65e7
MC: Share the MCAsmLayout object, although its still not used for anything important.
...
llvm-svn: 99202
2010-03-22 20:35:35 +00:00
Douglas Gregor
0e5e5d7ba4
Acccess control is lame
...
llvm-svn: 98962
2010-03-19 15:36:58 +00:00
Douglas Gregor
08ed09f4f6
struct -> class, to silence a Clang warning
...
llvm-svn: 98961
2010-03-19 15:31:09 +00:00
Daniel Dunbar
7252b48af1
MCCodeEmitter: Add target independent fixup flag for is-pc-relative.
...
llvm-svn: 98954
2010-03-19 10:43:23 +00:00
Daniel Dunbar
c47468760e
MC: Sink code emitter into MCAssembler.
...
llvm-svn: 98953
2010-03-19 10:43:18 +00:00
Daniel Dunbar
74330a6389
MC/Mach-O: Move to MachObjectWriter.{h,cpp}.
...
llvm-svn: 98952
2010-03-19 10:43:15 +00:00
Daniel Dunbar
c9bcbc86a8
MC: Split MCObjectWriter out of MCAssembler.cpp.
...
llvm-svn: 98949
2010-03-19 09:28:59 +00:00
Daniel Dunbar
b2aafb5fe9
MC/Mach-O: Lift the fixup evaluation and application up (to the same place), and eliminate MCAsmFixup::FixedValue.
...
llvm-svn: 98944
2010-03-19 07:09:47 +00:00
Daniel Dunbar
01aca21857
MC/Mach-O: Factor out ExecutePostLayoutBinding, to separate the post-layout changes the object writer may need to make to the assembler from the actual .o writing.
...
llvm-svn: 98943
2010-03-19 07:09:33 +00:00
Chris Lattner
32452cf12f
fix an MCInstPrinter leak that jyasskin pointed out:
...
createAsmStreamer now takes ownership of the instprinter.
llvm-svn: 98939
2010-03-19 05:48:53 +00:00
Daniel Dunbar
0a3b893a3e
MC/Mach-O/x86_64: Add getAtom[ForAddress].
...
- These find the defining symbol which identifies the containing atom for a symbol or address. They are currently very slow, but will be eliminated eventually.
llvm-svn: 98925
2010-03-19 03:18:15 +00:00
Daniel Dunbar
377fb36813
MC/Mach-O: Factor out isSymbolLinkerVisible method; "linker visible" is a made up term to refer to non-temporary labels + temporary labels in sections-which-require symbols. For Darwin, it corresponds to symbols which effectively define an atom.
...
llvm-svn: 98923
2010-03-19 03:18:09 +00:00
Daniel Dunbar
8b149ce7fd
MCValue: Change to holding MCSymbolRefExprs instead of MCSymbols, we will need this for accessing to symbol modifiers.
...
llvm-svn: 98791
2010-03-18 00:59:10 +00:00
Daniel Dunbar
cc3d1188fb
Add MCSymbol::isInSection.
...
llvm-svn: 98790
2010-03-18 00:59:02 +00:00
Chris Lattner
962d3d700b
fix GetOrCreateTemporarySymbol to require a name, clients
...
should use CreateTempSymbol() if they don't care about the
name.
llvm-svn: 98712
2010-03-17 05:41:18 +00:00