Daniel Dunbar
4daaf9d3f4
Pass StringRef by value.
...
llvm-svn: 86251
2009-11-06 10:58:06 +00:00
Daniel Dunbar
4943610506
Minor formatting tweaks.
...
llvm-svn: 84235
2009-10-16 01:58:15 +00:00
Daniel Dunbar
af3162e523
MC: Tweak variable assignment diagnostics, and make reassignment of non-absolute
...
variables and symbols invalid.
llvm-svn: 84232
2009-10-16 01:57:39 +00:00
Daniel Dunbar
a4df6e46a4
MC: When parsing a variable reference, substitute absolute variables immediately
...
since they are allowed to be redefined.
llvm-svn: 84230
2009-10-16 01:34:54 +00:00
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
8724d994d0
'printMCInst' doesn't print newlines after instructions anymore.
...
llvm-svn: 81723
2009-09-13 22:24:34 +00:00
Chris Lattner
d4f19950e3
Thread an MCAsmInfo pointer through the various MC printing APIs,
...
and fix a few things using << on MCSymbols to use ->print(). No
functionality change other than unbreaking my previous patch.
llvm-svn: 80890
2009-09-03 05:46:51 +00:00
Chris Lattner
2f6f020b42
inline insertion operators.
...
llvm-svn: 80888
2009-09-03 05:33:01 +00:00
Chris Lattner
25817ab343
output alignment value in hex so that we get:
...
.align 3, 0x90
instead of,
.align 3, 144
suggested by eric.
llvm-svn: 80875
2009-09-03 04:01:10 +00:00
Daniel Dunbar
3a44b6da61
llvm-mc: Pass values to MCStreamer as MCExprs, not MCValues.
...
llvm-svn: 80578
2009-08-31 08:09:28 +00:00
Daniel Dunbar
b897e807c4
llvm-mc: Simplify EmitAssignment ('.set' is identical to '=').
...
llvm-svn: 80577
2009-08-31 08:09:09 +00:00
Daniel Dunbar
fcb32716eb
llvm-mc: Switch MCInst to storing an MCExpr* instead of an MCValue.
...
Also, use MCInst::print instead of custom code in MCAsmPrinter.
llvm-svn: 80575
2009-08-31 08:08:38 +00:00
Daniel Dunbar
bc61205626
llvm-mc: MCStreamer cleanups. - Remove EmitLocalSymbol, this is unsupported for now.
...
- Switch Emit{CommonSymbol,Zerofill} to take alignment in bytes (for consistency).
llvm-svn: 80484
2009-08-30 06:17:16 +00:00
Daniel Dunbar
09ed9fabde
llvm-mc: Emit .lcomm as .zerofill.
...
llvm-svn: 80343
2009-08-28 05:48:46 +00:00
Daniel Dunbar
aace3b9577
llvm-mc: Add const to EmitZeroFill section argument.
...
llvm-svn: 80341
2009-08-28 05:48:22 +00:00
Daniel Dunbar
b11e3eb82f
llvm-mc: Print encodings after the instruction, and only when we have an asm
...
printer.
llvm-svn: 80233
2009-08-27 07:58:57 +00:00
Daniel Dunbar
fd042a5019
Sketch TargetRegistry support for MCCodeEmitter abstract interface.
...
- Of course, nothing actually can provide this interface yet.
llvm-svn: 80188
2009-08-27 00:51:57 +00:00
Chris Lattner
8d06945fff
rename TAI -> MAI, being careful not to make MAILJMP instructions :)
...
llvm-svn: 79777
2009-08-22 21:43:10 +00:00
Chris Lattner
5d8af49626
Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.
...
llvm-svn: 79763
2009-08-22 20:48:53 +00:00
Daniel Dunbar
2bb8df3b5d
llvm-mc: Clean up some handling of symbol/section association to be more correct
...
(external was really undefined and there wasn't an explicit representation for
absolute symbols).
- This still needs some cleanup to how the absolute "pseudo" section is dealt
with, but I haven't figured out the nicest approach yet.
llvm-svn: 79733
2009-08-22 07:22:36 +00:00
Chris Lattner
aeed3004c1
fix asmstreaming of 2/4 byte elements with pow-2 alignments.
...
llvm-svn: 79408
2009-08-19 06:35:36 +00:00
Chris Lattner
57b873fda0
switch asmprinter to emit alignments through OutStreamer.
...
llvm-svn: 79406
2009-08-19 06:12:02 +00:00
Chris Lattner
9cbc9c2d13
eliminate AsmPrinter::SwitchToSection and just have clients
...
talk to the MCStreamer directly instead.
llvm-svn: 79405
2009-08-19 05:49:37 +00:00
Chris Lattner
b82fc63e02
Make AsmStreamer maintain a notion of the current section, pushing it up from the
...
MCAsmStreamer. Based on this, eliminate the current section from AsmPrinter.
While I'm at it, clean up the last of the horrible "switch to null section" stuff
and add an assert. This change is in preparation for completely eliminating
asmprinter::switchtosection.
llvm-svn: 79324
2009-08-18 06:15:16 +00:00
Chris Lattner
fc68e5368b
change AsmPrinter to switch sections using AsmStreamer instead of
...
doing it directly. This requires const'izing a bunch of stuff that
took sections, but this seems like the right semantic thing to do:
emitting a label to a section shouldn't mutate the MCSection object
itself, for example.
llvm-svn: 79227
2009-08-17 05:49:08 +00:00
Chris Lattner
69a19050c0
give MCAsmStreamer a TargetAsmInfo.
...
llvm-svn: 79222
2009-08-17 04:23:44 +00:00
Chris Lattner
a1acc7cab5
formatting cleanups, no functionality change.
...
llvm-svn: 79221
2009-08-17 04:17:34 +00:00
Daniel Dunbar
3c9ab92a24
llvm-mc: Fix bugs where bytes were unintentionally being printed as signed.
...
- We now print all of 403.gcc cleanly (llvm-mc -> 'as' as diffed to 'as'), minus two
'rep;movsl' instructions (which I missed before).
llvm-svn: 79031
2009-08-14 19:59:24 +00:00
Daniel Dunbar
b9d9ce9513
llvm-mc: When handling a .set, make sure to print subsequent references to the
...
symbol as the symbol name itself, not the expression it was defined to. These
have different semantics due to the quirky .set behavior (which absolutizes an
expression that would otherwise be treated as a relocation).
llvm-svn: 79025
2009-08-14 19:10:46 +00:00
Daniel Dunbar
b00271e266
llvm-mc: zerofill shouldn't print quotes around the section,segment.
...
llvm-svn: 79017
2009-08-14 18:51:45 +00:00
Daniel Dunbar
dc5840c57c
Update llvm-mc / MCAsmStreamer to print the instruction using the actual target
...
specific printer (this only works on x86, for now).
- This makes it possible to do some correctness checking of the parsing and
matching, since we can compare the results of 'as' on the original input, to
those of 'as' on the output from llvm-mc.
- In theory, we could now have an easy ATT -> Intel syntax converter. :)
llvm-svn: 78986
2009-08-14 03:48:55 +00:00
Daniel Dunbar
d4c5293717
llvm-mc: Add dummy MCStreamer implementation, (eventually) for use in profiling.
...
- Currently unused.
- A few other random comment fixes lumped in.
llvm-svn: 78960
2009-08-13 23:36:34 +00:00
Chris Lattner
3e6da637f6
split MachO section handling stuff out to its out .h/.cpp file.
...
llvm-svn: 78576
2009-08-10 18:15:01 +00:00
Chris Lattner
cc70d578be
Make the big switch: Change MCSectionMachO to represent a section *semantically*
...
instead of syntactically as a string. This means that it keeps track of the
segment, section, flags, etc directly and asmprints them in the right format.
This also includes parsing and validation support for llvm-mc and
"attribute(section)", so we should now start getting errors about invalid
section attributes from the compiler instead of the assembler on darwin.
Still todo:
1) Uniquing of darwin mcsections
2) Move all the Darwin stuff out to MCSectionMachO.[cpp|h]
3) there are a few FIXMEs, for example what is the syntax to get the
S_GB_ZEROFILL segment type?
llvm-svn: 78547
2009-08-10 01:39:42 +00:00
Chris Lattner
9e2c3aa666
sink the 'name' and 'isdirective' state out of MCSection into its derived classes.
...
This totally optimizes PIC16 sections by not having an 'isdirective' bit anymore!! ;-)
llvm-svn: 78517
2009-08-08 23:39:42 +00:00
Daniel Dunbar
a848745eb4
llvm-mc: Fix .s output to quote section & symbol names when necessary.
...
llvm-svn: 77749
2009-07-31 23:04:32 +00:00
Daniel Dunbar
3edfc4bb16
llvm-mc: Implement .abort fully in the front end
...
llvm-svn: 77272
2009-07-27 23:20:52 +00:00
Daniel Dunbar
5f73e9d3f8
llvm-mc: Move AsmLexer::getCurStrVal to StringRef based API.
...
- My DFS traversal of LLVM is, at least for now, nearly complete! :)
llvm-svn: 77258
2009-07-27 21:49:56 +00:00
Kevin Enderby
f1c0daa6a7
Removed the DumpSymbolsandMacros and LoadSymbolsandMacros MCStreamer API as
...
the parsing of the .dump and .load should be done in the assembly parser and
not have any need for an MCStreamer API. Changed the code for now so these
just produce an error saying these specific directives are not yet implemented
since they are likely no longer used and may never need to be implemented.
llvm-svn: 76462
2009-07-20 20:25:37 +00:00
Kevin Enderby
f641ecc6e8
Removed the SubsectionsViaSymbols MCStreamer API and replaced it with a generic
...
EmitAssemblerFlag API which takes a value from the added AssemblerFlag
enumerated constants.
llvm-svn: 76087
2009-07-16 17:56:39 +00:00
Chris Lattner
4939bd13ad
implement .include in the lexer/parser instead of passing it into the streamer.
...
llvm-svn: 75896
2009-07-16 06:14:39 +00:00
Kevin Enderby
312f8559cb
Added llvm-mc support for parsing the .dump and .load directives.
...
llvm-svn: 75786
2009-07-15 15:30:11 +00:00
Kevin Enderby
3e47cf1dda
Added llvm-mc support for parsing the .include directive.
...
llvm-svn: 75711
2009-07-14 23:21:55 +00:00
Kevin Enderby
5821cee99b
Added llvm-mc support for parsing the .lsym directive.
...
llvm-svn: 75685
2009-07-14 21:35:03 +00:00
Kevin Enderby
0b1331c43b
Added llvm-mc support for parsing the .desc directive.
...
llvm-svn: 75645
2009-07-14 18:17:10 +00:00
Torok Edwin
f955a6ef49
llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
...
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").
llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Kevin Enderby
af095fcfb8
Added llvm-mc support for parsing the .abort directive.
...
llvm-svn: 75545
2009-07-13 23:15:14 +00:00
Kevin Enderby
a461788d6a
add llvm-mc support for parsing the .subsections_via_symbols directive.
...
llvm-svn: 75500
2009-07-13 21:03:15 +00:00
Torok Edwin
ae8a3ff177
assert(0) -> LLVM_UNREACHABLE.
...
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.
llvm-svn: 75379
2009-07-11 20:10:48 +00:00
Chris Lattner
84bf9fed2b
add support for .zerofill, patch by Kevin Enderby!
...
llvm-svn: 75301
2009-07-10 22:20:30 +00:00
Chris Lattner
56638bb644
add llvm-mc support for parsing the .lcomm directive, patch by Kevin Enderby!
...
llvm-svn: 75148
2009-07-09 17:25:12 +00:00
Chris Lattner
2bea79b45b
Implement parsing support for the .comm directive. Patch by
...
Kevin Enderby!
llvm-svn: 74944
2009-07-07 20:30:46 +00:00
Daniel Dunbar
efcb5ad32e
Dump MCInsts in the MC .s printer, for now.
...
llvm-svn: 74593
2009-07-01 06:35:03 +00:00
Daniel Dunbar
72c0434597
llvm-mc: Parse .{,b,p2}align{,w,l} directives.
...
llvm-svn: 74478
2009-06-29 23:46:59 +00:00
Torok Edwin
28c47d108c
Initialize CurSection in constructor.
...
Not doing so causes some unittests to fail, because CurSection is uninitialized.
llvm-svn: 74442
2009-06-29 19:59:10 +00:00
Daniel Dunbar
134907cafc
Rename MCValue::getCst to getConstant and add MCValue::isConstant.
...
llvm-svn: 74440
2009-06-29 19:51:00 +00:00
Daniel Dunbar
3d3f776dc9
MC: Truncate values when printing, to keep 'as' happy.
...
llvm-svn: 74201
2009-06-25 21:03:18 +00:00
Daniel Dunbar
5f2b8ca5e4
Sketch streamer support for .align, .org functionality.
...
llvm-svn: 74109
2009-06-24 19:25:34 +00:00
Daniel Dunbar
082dc70875
We decided to not worry about Atoms for now, it should be straightforward to
...
reintroduce them later.
Also, don't require MCSection* when creating a symbol.
llvm-svn: 74081
2009-06-24 17:00:42 +00:00
Daniel Dunbar
4f0c4c766c
MCStreamer: Add a few more "symbol attributes".
...
llvm-svn: 74077
2009-06-24 16:36:52 +00:00
Daniel Dunbar
691e6009bd
MCStreamer: Test printing values.
...
llvm-svn: 74076
2009-06-24 16:05:35 +00:00
Chris Lattner
61a6509f6a
add trivial support for passing label definitions through the MCStreamer.
...
This is suboptimal in several aspects, see the commented out assertion.
I need to talk to Daniel about this.
llvm-svn: 74057
2009-06-24 04:31:49 +00:00
Daniel Dunbar
0e5051b251
Start MCAsmStreamer implementation.
...
llvm-svn: 74044
2009-06-24 01:03:06 +00:00