aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* MC: Add support for disabling "temporary label" behavior. Useful for debuggingDaniel Dunbar2011-03-281-3/+6
| | | | | | on Darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128430 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove duplicated code.Rafael Espindola2011-01-231-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124054 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed version of 121434 with no new memory leaks.Rafael Espindola2010-12-101-2/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121471 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert my previous patch to make the valgrind bots happy.Rafael Espindola2010-12-101-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121461 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial support for the cfi directives. This is just enough to getRafael Espindola2010-12-091-2/+3
| | | | | | | | | | | f: .cfi_startproc nop .cfi_endproc assembled (on ELF). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121434 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename temporary symbols if they conflict with artificial symbols createdRafael Espindola2010-12-011-10/+35
| | | | | | | | | by the assembler. This was blocking parsing any large .s produced by clang for example. Fixes PR8596. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120603 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Whitespace.Michael J. Spencer2010-11-261-14/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120166 91177308-0d34-0410-b5e6-96231b3b80d8
* Add .loc methods to the streamer.Rafael Espindola2010-11-161-1/+1
| | | | | | | 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
* Parse and remember discriminators in .loc line. I try to output them withRafael Espindola2010-11-131-1/+1
| | | | | | | another patch. This lets us parse a bit more of the gcc 4.5 output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118975 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial comdat implementation.Rafael Espindola2010-11-111-2/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118805 91177308-0d34-0410-b5e6-96231b3b80d8
* Use MCSectionELF in places we know we have an ELF section.Rafael Espindola2010-11-101-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118699 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed version of 118639 with an extra assert to catch similar problemsRafael Espindola2010-11-091-2/+2
| | | | | | earlier. Implicit bool -> int conversions are evil! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118651 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert previous patch. Missed a case.Rafael Espindola2010-11-091-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118645 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove IsExplicit. It was always false.Rafael Espindola2010-11-091-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118639 91177308-0d34-0410-b5e6-96231b3b80d8
* Incorporate suggestions by Daniel Dunbar after his review. Thanks Daniel!Kevin Enderby2010-10-041-7/+3
| | | | | | | | | | | | | | | | | | 1) Changed ValidateDwarfFileNumber() to isValidDwarfFileNumber() to be better named. Since it is just a predicate and isn't actually changing any state. 2) Added a missing return in the comments for setCurrentDwarfLoc() in include/llvm/MC/MCContext.h for fix formatting. 3) Changed clearDwarfLocSeen() to ClearDwarfLocSeen() since it does change state. 4) Simplified the last test in isValidDwarfFileNumber() to just a one line boolean test of MCDwarfFiles[FileNumber] != 0 for the final return statement. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115551 91177308-0d34-0410-b5e6-96231b3b80d8
* Move logic of determining ELF entsize from the .s printer to initializationJan Wen Voung2010-09-301-0/+4
| | | | | | | | | time. That way, the EntrySize field is initialized for other code paths, namely, the .ll -> .o code path. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115141 91177308-0d34-0410-b5e6-96231b3b80d8
* This is the second of three patches to implement support for the .loc directiveKevin Enderby2010-08-311-1/+1
| | | | | | | | | | | and output the dwarf line number tables. This takes the current loc info after an instruction is assembled and saves the needed info into an object that has vector and for each section. These objects will be used for the final patch to build and emit the encoded dwarf line number tables. Again for now this is only in the Mach-O streamer but at some point will move to a more generic place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112668 91177308-0d34-0410-b5e6-96231b3b80d8
* First bit of support for the dwarf .loc directive. This patch updates theKevin Enderby2010-08-241-1/+17
| | | | | | | | | | | needed parsing for the .loc directive and saves the current info from that into the context. The next patch will take the current loc info after an instruction is assembled and save that info into a vector for each section for use to build the line number tables. The patch after that will encode the info from those vectors into the output file as the dwarf line tables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111956 91177308-0d34-0410-b5e6-96231b3b80d8
* Add ELF ObjectWriter and Streamer support.Matt Fleming2010-08-161-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111172 91177308-0d34-0410-b5e6-96231b3b80d8
* Next bit of support for the dwarf .file directive. This patch takes theKevin Enderby2010-08-091-1/+6
| | | | | | | | | previously collected info from the .file directives and outputs the encoded bytes for it. For now this is only in the Mach-O streamer but at some point will move to a more generic place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110617 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop leaking std::strings in GetDwarfFile.Benjamin Kramer2010-07-291-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109746 91177308-0d34-0410-b5e6-96231b3b80d8
* Added first bit of support for the dwarf .file directive. This patch collectsKevin Enderby2010-07-281-0/+61
| | | | | | | | the info from the .file directive and makes file and directory tables that will eventually be put out as part of the dwarf info in the output file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109651 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert some tab stops into spaces.Duncan Sands2010-07-121-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108130 91177308-0d34-0410-b5e6-96231b3b80d8
* Added the darwin .secure_log_unique and .secure_log_reset directives.Kevin Enderby2010-06-281-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107077 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify MCContext::(Next|Get)InstanceBenjamin Kramer2010-05-181-24/+8
| | | | | | | | - Allocate MCLabels in the context so they don't leak. - Avoid duplicated densemap lookup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104020 91177308-0d34-0410-b5e6-96231b3b80d8
* Added support in MC for Directional Local Labels.Kevin Enderby2010-05-171-0/+45
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103989 91177308-0d34-0410-b5e6-96231b3b80d8
* add COFF support for COMDAT sections, patch by Nathan Jeffords!Chris Lattner2010-05-071-4/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103304 91177308-0d34-0410-b5e6-96231b3b80d8
* switch MCSectionCOFF from a syntactic to semantic representation,Chris Lattner2010-05-071-1/+20
| | | | | | | patch by Peter Housel! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103267 91177308-0d34-0410-b5e6-96231b3b80d8
* move elf section uniquing to MCContext. Along the wayChris Lattner2010-04-081-2/+26
| | | | | | | merge XCore's section into MCSectionELF git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100812 91177308-0d34-0410-b5e6-96231b3b80d8
* move macho section uniquing from MCParser and TLOF to MCContext whereChris Lattner2010-04-081-2/+46
| | | | | | | | | the compiler and asmparser now unique to the same sections. This fixes rdar://7835021. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100807 91177308-0d34-0410-b5e6-96231b3b80d8
* Rip out the 'is temporary' nonsense from the MCContext interface toChris Lattner2010-03-301-12/+8
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99902 91177308-0d34-0410-b5e6-96231b3b80d8
* fix GetOrCreateTemporarySymbol to require a name, clientsChris Lattner2010-03-171-11/+0
| | | | | | | | | should use CreateTempSymbol() if they don't care about the name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98712 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a memory leak yjasskin pointed out: MCSymbol is bump pointerChris Lattner2010-03-151-10/+14
| | | | | | | | | | | allocated and thus not freed. This is cool except that it contains and std::string so the string data didn't get freed. In any case there is no reason to redundantly store the string data in the MCSymbol anyway, just make the MCSymbol ref the string data in the MCContext StringMap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98536 91177308-0d34-0410-b5e6-96231b3b80d8
* add a new CreateTempSymbol method, the use case forChris Lattner2010-03-141-0/+6
| | | | | | | | CreateTempSymbol vs GetOrCreateTemporarySymbol are completely different. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98486 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance MCContext::GetOrCreateTemporarySymbol() to create a new symbolChris Lattner2010-03-111-0/+6
| | | | | | | with an arbitrary unique name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98294 91177308-0d34-0410-b5e6-96231b3b80d8
* change MCContext to always have an MCAsmInfo.Chris Lattner2010-03-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98293 91177308-0d34-0410-b5e6-96231b3b80d8
* empty symbols aren't possible, the mcsymbol ctor aborts on them.Chris Lattner2010-03-111-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98288 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded includes.Daniel Dunbar2010-03-101-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98167 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate MCContext::CreateSymbol and CreateTemporarySymbol.Chris Lattner2010-03-101-11/+10
| | | | | | | | Add a new GetOrCreateTemporarySymbol method and a version that takes a twine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98118 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass StringRef by value.Daniel Dunbar2009-11-061-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86251 91177308-0d34-0410-b5e6-96231b3b80d8
* add a twine version of MCContext::GetOrCreateSymbol.Chris Lattner2009-10-191-1/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84561 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Switch MCContext value table to storing MCExprs.Daniel Dunbar2009-10-161-17/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84228 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc/Mach-O: Don't put assembler temporary labels in the symbol table.Daniel Dunbar2009-08-261-1/+0
| | | | | | | | | - I moved section creation back into AsmParser. I think policy decisions like this should be pushed higher, not lower, when possible (in addition the assembler has flags which change this behavior, for example). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80162 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-mc: Change MCContext value table to take const MCSymbol*s.Daniel Dunbar2009-08-261-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80079 91177308-0d34-0410-b5e6-96231b3b80d8
* sink uniquing of sections out of MCContext into the ELF and PECOFF TLOF ↵Chris Lattner2009-08-131-5/+0
| | | | | | | | | implementations. MCContext no longer maintains a string -> section map. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78874 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78870 91177308-0d34-0410-b5e6-96231b3b80d8
* split MCSection stuff out to its own .cpp file, add a newChris Lattner2009-07-311-12/+0
| | | | | | | MCSectionWithKind subclass of MCSection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77684 91177308-0d34-0410-b5e6-96231b3b80d8
* create sections with MCSection::Create instead of Context->getOrCreateSection.Chris Lattner2009-07-311-8/+15
| | | | | | | This is needed to allow polymorphic sections. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77680 91177308-0d34-0410-b5e6-96231b3b80d8
* Move MCContext and friends to StringRef based APIs.Daniel Dunbar2009-07-271-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77251 91177308-0d34-0410-b5e6-96231b3b80d8
* We decided to not worry about Atoms for now, it should be straightforward toDaniel Dunbar2009-06-241-17/+6
| | | | | | | | | reintroduce them later. Also, don't require MCSection* when creating a symbol. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74081 91177308-0d34-0410-b5e6-96231b3b80d8