summaryrefslogtreecommitdiff
path: root/lib/MC/MCAsmStreamer.cpp
Commit message (Collapse)AuthorAge
* Second try at making direct object emission produce the same resultsRafael Espindola2010-12-06
| | | | | | | as llc + llvm-mc. This time ELF is not changed and I tested that llvm-gcc bootstrap on darwin10 using darwin9's assembler and linker. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121006 91177308-0d34-0410-b5e6-96231b3b80d8
* There are two reasons why we might want to useRafael Espindola2010-12-04
| | | | | | | | | | | | | | | | foo = a - b .long foo instead of just .long a - b First, on darwin9 64 bits the assembler produces the wrong result. Second, if "a" is the end of the section all darwin assemblers (9, 10 and mc) will not consider a - b to be a constant but will if the dummy foo is created. Split how we handle these cases. The first one is something MC should take care of. The second one has to be handled by the caller. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120889 91177308-0d34-0410-b5e6-96231b3b80d8
* Next step: Only pad debug_line when the target is darwin. Add a FIXME to avoidRafael Espindola2010-12-04
| | | | | | | | | | | doing that if the target is darwin10 or newer. This fixes *) Direct object emission was producing objects without the workaround on darwin9. *) Assembly printing was producing objects with the workaround on linux. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120866 91177308-0d34-0410-b5e6-96231b3b80d8
* Make EmitIntValue more efficient and more like what we do for leb128. TheRafael Espindola2010-12-03
| | | | | | difference is much smaller (about 0.3s) but significant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120787 91177308-0d34-0410-b5e6-96231b3b80d8
* Do with uleb the same trick we now do with dwarf line/address advances. ThisRafael Espindola2010-12-03
| | | | | | avoids creating leb128 fragments and speeds up the test in PR8711 to 33s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120774 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to resolve symbol differences early, and if successful create a plainRafael Espindola2010-12-03
| | | | | | | data fragment. This reduces the time to assemble the test in 8711 from 60s to 54s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120767 91177308-0d34-0410-b5e6-96231b3b80d8
* It may not be an option to skip .debug_line if there are file reference in ↵Devang Patel2010-12-03
| | | | | | already emitted debug info. So, for now, emit dummy line table entry to make older linker and assemblers happy. This is not a new behavior, original AsmPrinter emitted similar line table entries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120760 91177308-0d34-0410-b5e6-96231b3b80d8
* Use set directive for StartMinusEndExpr.Devang Patel2010-12-02
| | | | | | | This is a fix for llvm-gcc-i386-darwin9 buildbot failure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120742 91177308-0d34-0410-b5e6-96231b3b80d8
* If tehre are not any line entry then do not try to emit .debug_line section.Devang Patel2010-12-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120637 91177308-0d34-0410-b5e6-96231b3b80d8
* Make EmitIntValue non virtual.Rafael Espindola2010-11-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120271 91177308-0d34-0410-b5e6-96231b3b80d8
* Add basic CFI methods to the streamer interface.Rafael Espindola2010-11-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119972 91177308-0d34-0410-b5e6-96231b3b80d8
* Added support for the Mach-O .symbol_resolver directive. rdar://8673046Kevin Enderby2010-11-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119816 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix llvm-gcc boostrap on OS X by avoiding printing sleb and uleb whenRafael Espindola2010-11-19
| | | | | | possible. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119785 91177308-0d34-0410-b5e6-96231b3b80d8
* Change some methods in MCDwarf.cpp to be able to handle an arbitraryRafael Espindola2010-11-19
| | | | | | | | | | | | MCStreamer instead of just MCObjectStreamer. Address changes cannot be as efficient as we have to use DW_LNE_set_addres, but at least most of the logic is shared. This will be used so that, with CodeGen still using EmitDwarfLocDirective, llvm-gcc is able to produce debug_line sections without needing an assembler that supports .loc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119777 91177308-0d34-0410-b5e6-96231b3b80d8
* Add .loc methods to the streamer.Rafael Espindola2010-11-16
| | | | | | | Next: Add support for the !HasDotLocAndDotFile case to the MCAsmStreamer and then switch codegen to use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119384 91177308-0d34-0410-b5e6-96231b3b80d8
* correct the fixup comment printer to work on big endian platforms.Chris Lattner2010-11-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119122 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix warning and add support for printing gnu_unique_object.Rafael Espindola2010-11-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118981 91177308-0d34-0410-b5e6-96231b3b80d8
* Add '.code 32' assembler directive to MC streamers.Jim Grosbach2010-11-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118309 91177308-0d34-0410-b5e6-96231b3b80d8
* MC'ize the '.code 16' and '.thumb_func' ARM directives.Jim Grosbach2010-11-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118301 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 118023 back, but with proper spelling for .uleb128/.sleb128.Rafael Espindola2010-11-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118254 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for expressions in .sleb/.uleb directives.Rafael Espindola2010-11-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118023 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement .weakref.Rafael Espindola2010-11-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117911 91177308-0d34-0410-b5e6-96231b3b80d8
* Tiny patch for proof-of-concept cleanup of ARMAsmPrinter::EmitStartOfAsmFile()Jason W Kim2010-09-30
| | | | | | | | | Small test for sanity check of resulting ARM .s file. Tested against -r115129. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115133 91177308-0d34-0410-b5e6-96231b3b80d8
* allow target-specific label suffixes, patch by Yuri Gribov!Chris Lattner2010-09-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114592 91177308-0d34-0410-b5e6-96231b3b80d8
* grammar tweakageJim Grosbach2010-09-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114561 91177308-0d34-0410-b5e6-96231b3b80d8
* remove trailing whitespaceJim Grosbach2010-09-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114560 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a InitSections method to the streamer interface.Rafael Espindola2010-09-15
| | | | | | | | | | | | | | The ELF implementation now creates text, data and bss to match the gnu as behavior. The text streamer still has the old MachO specific behavior since the testsuite checks that it will error when a directive is given before a setting the current section for example. A nice benefit is that -n is not required anymore when producing ELF files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114027 91177308-0d34-0410-b5e6-96231b3b80d8
* Add AsmParser support for the ELF .previous directive. Patch by Roman Divacky.Benjamin Kramer2010-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112849 91177308-0d34-0410-b5e6-96231b3b80d8
* Plug the remaining MC leaks by giving MCObjectStreamer/MCAsmStreamer ↵Benjamin Kramer2010-07-29
| | | | | | ownership of the TargetAsmBackend and the MCCodeEmitter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109767 91177308-0d34-0410-b5e6-96231b3b80d8
* Added the darwin .weak_def_can_be_hidden directive.Kevin Enderby2010-07-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107886 91177308-0d34-0410-b5e6-96231b3b80d8
* "This is just a cosmetic change in MCAsmStreamer.cpp/EmitSymbolAttribute: ↵Chris Lattner2010-06-21
| | | | | | | | | | | | | all attributes have now a \t before and after, as done for '.type'. This makes the output look consistent, as well as help some third party assemblers expecting the attributes to be in the second column." Patch by Arnaud de Grandmaison! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106469 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't call flush() at a library level which isn't checking for errorsDan Gohman2010-06-01
| | | | | | | and doesn't know where the output is going. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105274 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Change MCInst::dump_pretty to not include a trailing newline.Daniel Dunbar2010-05-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104696 91177308-0d34-0410-b5e6-96231b3b80d8
* Make EmitTBSSSymbol take a section argument so that we can find it later.Eric Christopher2010-05-18
| | | | | | | Fix up callers and users. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104057 91177308-0d34-0410-b5e6-96231b3b80d8
* Assume that we'll handle mangling the symbols earlier and just put theEric Christopher2010-05-17
| | | | | | | symbol to the file as we have it. Simplifies out tbss handling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103928 91177308-0d34-0410-b5e6-96231b3b80d8
* Add AsmParser support for darwin tbss directive.Eric Christopher2010-05-14
| | | | | | | Nothing uses this yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103757 91177308-0d34-0410-b5e6-96231b3b80d8
* break coff symbol definition stuff out into proper MCStreamer callbacks,Chris Lattner2010-05-08
| | | | | | | patch by Nathan Jeffords! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103346 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/Mach-O: Mark absolute variable's appropriately, and add Mach-O support forDaniel Dunbar2010-05-05
| | | | | | | writing them. - <rdar://problem/7885351> integrated assembler broken for i386 objc code git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103112 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Reject attempts to define a variable symbol.Daniel Dunbar2010-05-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103111 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Rename MCSymbol::{g,s}etValue -> MCSymbol::{g,s}etVariableValue.Daniel Dunbar2010-05-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103095 91177308-0d34-0410-b5e6-96231b3b80d8
* fix an ugly wart in the MCInstPrinter api where theChris Lattner2010-04-04
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100307 91177308-0d34-0410-b5e6-96231b3b80d8
* allow attaching comments to raw text.Chris Lattner2010-04-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100292 91177308-0d34-0410-b5e6-96231b3b80d8
* add a new EmitInlineAsm function to asmprinter to handle inline asm.Chris Lattner2010-04-03
| | | | | | | | If we have an MCAsmStreamer, we continue to emit asm textually, otherwise we (currently) emit an error to errs and ignore it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100289 91177308-0d34-0410-b5e6-96231b3b80d8
* MCInst: Add ::dump_pretty.Daniel Dunbar2010-03-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99216 91177308-0d34-0410-b5e6-96231b3b80d8
* fix an MCInstPrinter leak that jyasskin pointed out:Chris Lattner2010-03-19
| | | | | | | createAsmStreamer now takes ownership of the instprinter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98939 91177308-0d34-0410-b5e6-96231b3b80d8
* remove MAI argument from createAsmStreamer since itChris Lattner2010-03-12
| | | | | | | can get it from the context now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98361 91177308-0d34-0410-b5e6-96231b3b80d8
* genericize MCAsmStreamer::EmitCodeAlignment to support other targetsChris Lattner2010-02-23
| | | | | | | so that it doesn't break them when the code generator starts using it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96966 91177308-0d34-0410-b5e6-96231b3b80d8
* This is the first patch to put the needed bits in place to eventually allow codeKevin Enderby2010-02-23
| | | | | | | | | | | | to be aligned with optimal nops. This patch does not change any functionality and when the compiler is changed to use EmitCodeAlignment() it should also not change the resulting output. Once the compiler change is made and everything looks good the next patch with the table of optimal X86 nops will be added to WriteNopData() changing the output. There are many FIXMEs in this patch which will be removed when we have better target hooks (coming soon I hear). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96963 91177308-0d34-0410-b5e6-96231b3b80d8
* add a new MCInstPrinter::getOpcodeName interface, when it is Chris Lattner2010-02-11
| | | | | | | | implemented, llvm-mc --show-inst now uses it to print the instruction opcode as well as the number. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95929 91177308-0d34-0410-b5e6-96231b3b80d8
* make getFixupKindInfo return a const reference, allowingChris Lattner2010-02-11
| | | | | | | | the tables to be const. Teach MCCodeEmitter to handle the target-indep kinds so that we don't crash on them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95924 91177308-0d34-0410-b5e6-96231b3b80d8