summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
* llvm-mc/Mach-O: Support .o emission for .org and .align.Daniel Dunbar2009-08-212-17/+91
| | | | llvm-svn: 79684
* llvm-mc/Mach-O: Support byte and fill value emission.Daniel Dunbar2009-08-212-27/+140
| | | | llvm-svn: 79652
* Update CMakeLists.Benjamin Kramer2009-08-211-0/+3
| | | | llvm-svn: 79617
* llvm-mc: Start MCAssembler and MCMachOStreamer.Daniel Dunbar2009-08-212-0/+398
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Together these form the (Mach-O) back end of the assembler. - MCAssembler is the actual assembler backend, which is designed to have a reasonable API. This will eventually grow to support multiple object file implementations, but for now its Mach-O/i386 only. - MCMachOStreamer adapts the MCStreamer "actions" API to the MCAssembler API, e.g. converting the various directives into fragments, managing state like the current section, and so on. - llvm-mc will use the new backend via '-filetype=obj', which may eventually be, but is not yet, since I hear that people like assemblers which actually assemble. - The only thing that works at the moment is changing sections. For the time being I have a Python Mach-O dumping tool in test/scripts so this stuff can be easily tested, eventually I expect to replace this with a real LLVM tool. - More doxyments to come. I assume that since this stuff doesn't touch any of the things which are part of 2.6 that it is ok to put this in not so long before the freeze, but if someone objects let me know, I can pull it. llvm-svn: 79612
* fix asmstreaming of 2/4 byte elements with pow-2 alignments.Chris Lattner2009-08-191-1/+8
| | | | llvm-svn: 79408
* switch asmprinter to emit alignments through OutStreamer.Chris Lattner2009-08-191-14/+29
| | | | llvm-svn: 79406
* eliminate AsmPrinter::SwitchToSection and just have clientsChris Lattner2009-08-191-0/+1
| | | | | | talk to the MCStreamer directly instead. llvm-svn: 79405
* null streamer needs to maintain the current section as well.Chris Lattner2009-08-181-1/+3
| | | | llvm-svn: 79343
* Make AsmStreamer maintain a notion of the current section, pushing it up ↵Chris Lattner2009-08-182-4/+2
| | | | | | | | | | | | 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
* change AsmPrinter to switch sections using AsmStreamer instead ofChris Lattner2009-08-172-7/+5
| | | | | | | | | 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
* give MCAsmStreamer a TargetAsmInfo.Chris Lattner2009-08-171-4/+7
| | | | llvm-svn: 79222
* formatting cleanups, no functionality change.Chris Lattner2009-08-171-43/+36
| | | | llvm-svn: 79221
* add support for target-specific ELF section flags, add a new MCSectionXCoreChris Lattner2009-08-151-4/+6
| | | | | | | class which represents the XCore cp/dp section flags. No functionality change yet. llvm-svn: 79077
* llvm-mc: Fix bugs where bytes were unintentionally being printed as signed.Daniel Dunbar2009-08-141-1/+1
| | | | | | | - 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
* *try* to use a better name to describe how common symbols are marked on the ↵Bruno Cardoso Lopes2009-08-141-2/+4
| | | | | | elf object file. llvm-svn: 79029
* llvm-mc: When handling a .set, make sure to print subsequent references to theDaniel Dunbar2009-08-141-2/+9
| | | | | | | | 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
* llvm-mc: zerofill shouldn't print quotes around the section,segment.Daniel Dunbar2009-08-141-2/+1
| | | | llvm-svn: 79017
* CMake: updated list of source files for library MC.Oscar Fuentes2009-08-141-0/+2
| | | | llvm-svn: 78988
* Update llvm-mc / MCAsmStreamer to print the instruction using the actual targetDaniel Dunbar2009-08-141-43/+21
| | | | | | | | | | | 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
* Add MCSymbol::{print, dump}Daniel Dunbar2009-08-142-3/+56
| | | | llvm-svn: 78983
* Add MCValue::{print, dump}Daniel Dunbar2009-08-141-0/+30
| | | | llvm-svn: 78982
* llvm-mc: Move MCAsmToken::getLoc() into MC library where it belongs.Daniel Dunbar2009-08-141-0/+5
| | | | llvm-svn: 78980
* Fix MCSectionELF::ShouldOmitSectionDirective's matching of .data andDan Gohman2009-08-131-3/+3
| | | | | | | friends so that it doesn't match sections like .data.rel.local, which should not be emitted as section directives. llvm-svn: 78963
* llvm-mc: Add dummy MCStreamer implementation, (eventually) for use in profiling.Daniel Dunbar2009-08-132-5/+74
| | | | | | | | - Currently unused. - A few other random comment fixes lumped in. llvm-svn: 78960
* Remove HasCrazyBSS and add a flag in TAI to indicate that '.section' Bruno Cardoso Lopes2009-08-131-9/+10
| | | | | | must be emitted for PowerPC-Linux '.bss' section llvm-svn: 78958
* Add a method to return if the ELF section contains only common symbols!Bruno Cardoso Lopes2009-08-131-0/+10
| | | | llvm-svn: 78937
* Change MCSectionELF to represent a section semantically instead ofBruno Cardoso Lopes2009-08-133-85/+124
| | | | | | | syntactically as a string, very similiar to what Chris did with MachO. The parsing support and validation is not introduced yet. llvm-svn: 78890
* sink uniquing of sections out of MCContext into the ELF and PECOFF TLOF ↵Chris Lattner2009-08-132-21/+2
| | | | | | | | implementations. MCContext no longer maintains a string -> section map. llvm-svn: 78874
* add some comments: MCContext owns the MCSections, but it bump pointer allocatesChris Lattner2009-08-131-0/+2
| | | | | | them, so it doesn't have to explicitly free them. llvm-svn: 78870
* split MachO section handling stuff out to its out .h/.cpp file.Chris Lattner2009-08-104-270/+281
| | | | llvm-svn: 78576
* Make the big switch: Change MCSectionMachO to represent a section *semantically*Chris Lattner2009-08-102-12/+261
| | | | | | | | | | | | | | | | 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
* always end a section with \n on elf.Chris Lattner2009-08-091-0/+2
| | | | llvm-svn: 78534
* sink the 'name' and 'isdirective' state out of MCSection into its derived ↵Chris Lattner2009-08-082-19/+28
| | | | | | | | classes. This totally optimizes PIC16 sections by not having an 'isdirective' bit anymore!! ;-) llvm-svn: 78517
* 1. Make MCSection an abstract class.Chris Lattner2009-08-081-5/+109
| | | | | | | | | 2. Move section switch printing to MCSection virtual method which takes a TAI. This eliminates textual formatting stuff from TLOF. 3. Eliminate SwitchToSectionDirective, getSectionFlagsAsString, and TLOFELF::AtIsCommentChar. llvm-svn: 78510
* make target-specific TLOF impls (except PIC16) create target-specificChris Lattner2009-08-081-2/+2
| | | | | | MCSection instances. llvm-svn: 78500
* stub out PECOFF/MachO/ELF MCSection classesChris Lattner2009-08-081-2/+20
| | | | llvm-svn: 78499
* Change SectionKind to be a property that is true of a *section*, itChris Lattner2009-08-011-5/+6
| | | | | | | | | | | | | | | | | | should have no state that is specific to particular globals in the section. In this case, it means the removal of the "isWeak" and "ExplicitSection" bits. MCSection uses the new form of SectionKind. To handle isWeak, I introduced a new SectionInfo class, which is SectionKind + isWeak, and it is used by the part of the code generator that does classification of a specific global. The ExplicitSection disappears. It is moved onto MCSection as a new "IsDirective" bit. Since the Name of a section is either a section or directive, it makes sense to keep this bit in MCSection. Ultimately the creator of MCSection should canonicalize (e.g.) .text to whatever the actual section is. llvm-svn: 77803
* All MCSections are now required to have a SectionKind.Chris Lattner2009-08-011-8/+5
| | | | llvm-svn: 77787
* llvm-mc: Fix .s output to quote section & symbol names when necessary.Daniel Dunbar2009-07-311-12/+51
| | | | llvm-svn: 77749
* split MCSection stuff out to its own .cpp file, add a newChris Lattner2009-07-313-12/+32
| | | | | | MCSectionWithKind subclass of MCSection. llvm-svn: 77684
* create sections with MCSection::Create instead of Context->getOrCreateSection.Chris Lattner2009-07-311-8/+15
| | | | | | This is needed to allow polymorphic sections. llvm-svn: 77680
* Expose Tokens to target specific assembly parsers.Daniel Dunbar2009-07-281-1/+1
| | | | llvm-svn: 77337
* llvm-mc: Implement .abort fully in the front endDaniel Dunbar2009-07-271-10/+0
| | | | llvm-svn: 77272
* llvm-mc: Move AsmLexer::getCurStrVal to StringRef based API.Daniel Dunbar2009-07-271-3/+3
| | | | | | - My DFS traversal of LLVM is, at least for now, nearly complete! :) llvm-svn: 77258
* Move MCContext and friends to StringRef based APIs.Daniel Dunbar2009-07-271-6/+6
| | | | llvm-svn: 77251
* Removed the DumpSymbolsandMacros and LoadSymbolsandMacros MCStreamer API asKevin Enderby2009-07-201-12/+0
| | | | | | | | | 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
* Add MCAsmLexer interface.Daniel Dunbar2009-07-202-0/+19
| | | | | | - This provides the AsmLexer interface to the target specific assembly parsers. llvm-svn: 76460
* Add MCAsmParser interface.Daniel Dunbar2009-07-202-0/+19
| | | | | | | - This provides the AsmParser interface to the target specific assembly parsers. llvm-svn: 76453
* Update CMake file.Ted Kremenek2009-07-171-0/+1
| | | | llvm-svn: 76264
* llvm-mc: Add -triple, and start fetching the target asm printer.Daniel Dunbar2009-07-171-0/+19
| | | | llvm-svn: 76257
OpenPOWER on IntegriCloud