summaryrefslogtreecommitdiff
path: root/tools/llvm-mc/llvm-mc.cpp
Commit message (Collapse)AuthorAge
...
* llvm-mc/Mach-O: Add MCCodeEmitter support, for encoding instructions.Daniel Dunbar2009-08-27
| | | | | | | - No relocations yet, of course. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80235 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Only show instruction encodings with --show-encoding.Daniel Dunbar2009-08-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80230 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Tweak MCCodeEmitter skeleton.Daniel Dunbar2009-08-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80193 91177308-0d34-0410-b5e6-96231b3b80d8
* Sketch TargetRegistry support for MCCodeEmitter abstract interface.Daniel Dunbar2009-08-27
| | | | | | | - Of course, nothing actually can provide this interface yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80188 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc/Mach-O: Unique sections properly, so we don't get duplicate textDaniel Dunbar2009-08-26
| | | | | | | | | sections, etc. - The quick and dirty way, just clone the TargetLoweringObjectFile code. Eventually this should be shared... somehow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80168 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LLVM command-line tools overwrite their output files without -f.Dan Gohman2009-08-25
| | | | | | | | | | | | | | | | | This is conventional command-line tool behavior. -f now just means "enable binary output on terminals". Add a -f option to llvm-extract and llvm-link, for consistency. Remove F_Force from raw_fd_ostream and enable overwriting and truncating by default. Introduce an F_Excl flag to permit users to enable a failure when the file already exists. This flag is currently unused. Update Makefiles and documentation accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79990 91177308-0d34-0410-b5e6-96231b3b80d8
* Change raw_fd_ostream to take flags as an optional bitmask Chris Lattner2009-08-23
| | | | | | | | | | | | | | | | | | | instead of as two bools. Use this to add a F_Append flag which has the obvious behavior. Other unrelated changes conflated into this patch: 1. REmove EH stuff from llvm-dis and llvm-as, the try blocks are dead. 2. Simplify the filename inference code in llvm-as/llvm-dis, because raw_fd_ostream does the right thing with '-'. 3. Switch machine verifier to use raw_ostream instead of ostream (Which is the thing that needed append in the first place). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79807 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.Chris Lattner2009-08-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79763 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Start MCAssembler and MCMachOStreamer.Daniel Dunbar2009-08-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79612 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a commento.Daniel Dunbar2009-08-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79427 91177308-0d34-0410-b5e6-96231b3b80d8
* give MCAsmStreamer a TargetAsmInfo.Chris Lattner2009-08-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79222 91177308-0d34-0410-b5e6-96231b3b80d8
* Update llvm-mc / MCAsmStreamer to print the instruction using the actual targetDaniel Dunbar2009-08-14
| | | | | | | | | | | | 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. :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78986 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Honor -o option (and add -f).Daniel Dunbar2009-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78640 91177308-0d34-0410-b5e6-96231b3b80d8
* split MachO section handling stuff out to its out .h/.cpp file.Chris Lattner2009-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78576 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the big switch: Change MCSectionMachO to represent a section *semantically*Chris Lattner2009-08-10
| | | | | | | | | | | | | | | | | | 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? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78547 91177308-0d34-0410-b5e6-96231b3b80d8
* sink the 'name' and 'isdirective' state out of MCSection into its derived ↵Chris Lattner2009-08-08
| | | | | | | | | classes. This totally optimizes PIC16 sections by not having an 'isdirective' bit anymore!! ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78517 91177308-0d34-0410-b5e6-96231b3b80d8
* switch this to create coff sections for now, it doesn't really matter for Chris Lattner2009-08-08
| | | | | | | | llvm-mc's purpose yet and we'll want to switch to creating semantic sections at some point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78509 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove now unused arguments from TargetRegistry::lookupTarget.Daniel Dunbar2009-08-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77950 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SectionKind::get() private.Chris Lattner2009-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77835 91177308-0d34-0410-b5e6-96231b3b80d8
* update for API change.Chris Lattner2009-08-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77804 91177308-0d34-0410-b5e6-96231b3b80d8
* All MCSections are now required to have a SectionKind.Chris Lattner2009-08-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77787 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a bunch of failing tests now that MCContext::GetSection doesn't create ↵Chris Lattner2009-07-31
| | | | | | sections. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77689 91177308-0d34-0410-b5e6-96231b3b80d8
* Move X86 instruction parsing into X86/AsmParser.Daniel Dunbar2009-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77384 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide generic MCAsmParser when constructing target specific parsers.Daniel Dunbar2009-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77362 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch AsmLexer::Lex to returning a reference to the current token.Daniel Dunbar2009-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77328 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop some AsmLexer methods in favor of their AsmToken equivalents.Daniel Dunbar2009-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77323 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Sink token enum into AsmToken.Daniel Dunbar2009-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77322 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor commonality in triple match routines into helper template for registeringDaniel Dunbar2009-07-26
| | | | | | | classes, and migrate existing targets over. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77126 91177308-0d34-0410-b5e6-96231b3b80d8
* Add TargetRegistry::lookupTarget.Daniel Dunbar2009-07-26
| | | | | | | | | | | | | | | - This is a simplified mechanism which just looks up a target based on the target triple, with a few additional flags. - Remove getClosestStaticTargetForModule, the moral equivalent is now: lookupTarget(Mod->getTargetTriple, true, false, ...); - This no longer does the fuzzy matching with target data (based on endianness and pointer width) that getClosestStaticTargetForModule was doing, but this was deemed unnecessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77111 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MCAsmParser interface.Daniel Dunbar2009-07-20
| | | | | | | | - This provides the AsmParser interface to the target specific assembly parsers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76453 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Default -triple to LLVM_HOSTTRIPLE.Daniel Dunbar2009-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76260 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Add -triple, and start fetching the target asm printer.Daniel Dunbar2009-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76257 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Fill in the rest of tokens for 'as-lex' mode.Daniel Dunbar2009-07-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74598 91177308-0d34-0410-b5e6-96231b3b80d8
* add some of the new tokens, others are still missing.Chris Lattner2009-07-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74595 91177308-0d34-0410-b5e6-96231b3b80d8
* Normalize SourceMgr messages.Daniel Dunbar2009-06-30
| | | | | | | | | | | | | - Don't print "Parsing" in front of every message. - Take additional "type" argument which is prepended to the message (with ": ") if given. - Update clients to print errors (warnings) as: <filename>:<line number>: error(warning): ... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74489 91177308-0d34-0410-b5e6-96231b3b80d8
* Basic .s parsing for .asci[iz], .fill, .space, {.byte, .short, ... }Daniel Dunbar2009-06-24
| | | | | | | | - Includes some DG tests in test/MC/AsmParser, which are rather primitive since we don't have a -verify mode yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74139 91177308-0d34-0410-b5e6-96231b3b80d8
* add trivial support for passing label definitions through the MCStreamer.Chris Lattner2009-06-24
| | | | | | | | This is suboptimal in several aspects, see the commented out assertion. I need to talk to Daniel about this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74057 91177308-0d34-0410-b5e6-96231b3b80d8
* create an MCStreamer and provide it to AsmParser.Chris Lattner2009-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74039 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement full support for parsing primary expressions. We can now parseChris Lattner2009-06-22
| | | | | | | | | | | | | all of health and voronoi (ignoring directives). We only get 409 lines into 176.gcc though because we don't have binary operators yet: Parsing 176.gcc.llc.s:409: unexpected token in operand list movsbl _arityvec+1(,%edi,8), %eax ^ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73877 91177308-0d34-0410-b5e6-96231b3b80d8
* rename SourceMgr::PrintError to PrintMessage.Chris Lattner2009-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73861 91177308-0d34-0410-b5e6-96231b3b80d8
* stub out parser for asm files. Change invariant on lexer to alwaysChris Lattner2009-06-21
| | | | | | | | | print its error message when it returns an asmtok::Error token. Compute a proper error code for llvm-mc in 'lex' mode. Add new -as-lex option to enable lexing mode (vs parsing mode). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73859 91177308-0d34-0410-b5e6-96231b3b80d8
* add string literals.Chris Lattner2009-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73858 91177308-0d34-0410-b5e6-96231b3b80d8
* implement enough of a lexer to get through Olden/health/Output/health.llc.sChris Lattner2009-06-21
| | | | | | | | without errors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73855 91177308-0d34-0410-b5e6-96231b3b80d8
* some baby steps.Chris Lattner2009-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73848 91177308-0d34-0410-b5e6-96231b3b80d8
* start wiring up support for asm parsing.Chris Lattner2009-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73846 91177308-0d34-0410-b5e6-96231b3b80d8
* fix file headerChris Lattner2009-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73733 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a skeleton driver for new machine code level fun. llvm-mc is meantChris Lattner2009-06-18
to be a test driver of other components in the system, which will develop over time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73732 91177308-0d34-0410-b5e6-96231b3b80d8