summaryrefslogtreecommitdiff
path: root/lib/MC/MCContext.cpp
Commit message (Collapse)AuthorAge
...
* Revert r169456, "change MCContext to work on the ↵NAKAMURA Takumi2012-12-06
| | | | | | | | doInitialization/doFinalization model" It broke many builders. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169462 91177308-0d34-0410-b5e6-96231b3b80d8
* change MCContext to work on the doInitialization/doFinalization modelPedro Artigas2012-12-06
| | | | | | | | reviewed by Evan Cheng <evan.cheng@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169456 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-03
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid symbol name clash when filling TOC.Roman Divacky2012-09-18
| | | | | | | Patch by Adhemerval Zanella. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164141 91177308-0d34-0410-b5e6-96231b3b80d8
* MCContext.cpp: Fixup for my odd previous commit. No functional changes.NAKAMURA Takumi2012-07-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159645 91177308-0d34-0410-b5e6-96231b3b80d8
* MCContext::GetDwarfFile(): Make FileName parsing tolerant of DOSish pathsep ↵NAKAMURA Takumi2012-07-03
| | | | | | | | with PathV2. It fixes failure in test/MC/MachO/gen-dwarf.s on Win32 w/o bash. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159640 91177308-0d34-0410-b5e6-96231b3b80d8
* Add simple support for keeping MCFixup source information.Jim Grosbach2012-01-26
| | | | | | | Can be used to issue more user friendly diagnostics for faulty relocation constructs and such. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149092 91177308-0d34-0410-b5e6-96231b3b80d8
* Add SourceMgr to MCContext for backend diagnostics.Jim Grosbach2012-01-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149090 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed a bug in the code to create a dwarf file and directory table entires whenKevin Enderby2011-11-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | it is separating the directory part from the basename of the FileName. Noticed that this: .file 1 "dir/foo" when assembled got the two parts switched. Using the Mac OS X dwarfdump tool it can be seen easily: % dwarfdump -a a.out include_directories[ 1] = 'foo' Dir Mod Time File Len File Name ---- ---------- ---------- --------------------------- file_names[ 1] 1 0x00000000 0x00000000 dir ... Which should be: ... include_directories[ 1] = 'dir' Dir Mod Time File Len File Name ---- ---------- ---------- --------------------------- file_names[ 1] 1 0x00000000 0x00000000 foo git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143521 91177308-0d34-0410-b5e6-96231b3b80d8
* First part of support for generating dwarf for assembly source files with theKevin Enderby2011-11-01
| | | | | | | | | | | | | -g flag. In this part we generate the .file for the source being assembled and the .loc's for the assembled instructions. The next part will be to generate the dwarf Compile Unit DIE and a dwarf subprogram DIE for each non-temporary label. Once the next part is done test cases will be added. rdar://9275556 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143509 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for a new extension to the .file directive:Nick Lewycky2011-10-17
| | | | | | | | | | | .file filenumber "directory" "filename" This removes one join+split of the directory+filename in MC internals. Because bitcode files have independent fields for directory and filenames in debug info, this patch may change the .o files written by existing .bc files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142300 91177308-0d34-0410-b5e6-96231b3b80d8
* Hoist vector.size() computation out of the loop. No functionality change.Nick Lewycky2011-10-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141807 91177308-0d34-0410-b5e6-96231b3b80d8
* Goodbye TargetAsmInfo. This eliminate last bit of CodeGen and Target in llvm-mc.Evan Cheng2011-07-20
| | | | | | | | There is still a bit more refactoring left to do in Targets. But we are now very close to fixing all the layering issues in MC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135611 91177308-0d34-0410-b5e6-96231b3b80d8
* Add MCObjectFileInfo and sink the MCSections initialization code fromEvan Cheng2011-07-20
| | | | | | | | | TargetLoweringObjectFileImpl down to MCObjectFileInfo. TargetAsmInfo is done to one last method. It's *almost* gone! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135569 91177308-0d34-0410-b5e6-96231b3b80d8
* Sink getDwarfRegNum, getLLVMRegNum, getSEHRegNum from TargetRegisterInfo downEvan Cheng2011-07-18
| | | | | | | | | | to MCRegisterInfo. Also initialize the mapping at construction time. This patch eliminate TargetRegisterInfo from TargetAsmInfo. It's another step towards fixing the layering violation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135424 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the StringMaps attached to MCContext use the MCContext's allocator; Eli Friedman2011-04-18
| | | | | | | | reduces the number of calls to malloc(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129687 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't store Twine temporaries, it's not safe.Benjamin Kramer2011-04-09
| | | | | | And don't append the name over and over again in the loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129210 91177308-0d34-0410-b5e6-96231b3b80d8
* MC: Add support for disabling "temporary label" behavior. Useful for debuggingDaniel Dunbar2011-03-28
| | | | | | 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-23
| | | | 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-10
| | | | 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-10
| | | | 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-09
| | | | | | | | | | | 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-01
| | | | | | | | | 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-26
| | | | 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-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
* Parse and remember discriminators in .loc line. I try to output them withRafael Espindola2010-11-13
| | | | | | | 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-11
| | | | 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-10
| | | | 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-09
| | | | | | 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-09
| | | | 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-09
| | | | 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-04
| | | | | | | | | | | | | | | | | | 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-30
| | | | | | | | | 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-31
| | | | | | | | | | | 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-24
| | | | | | | | | | | 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-16
| | | | 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-09
| | | | | | | | | 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-29
| | | | 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-28
| | | | | | | | 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-12
| | | | 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-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107077 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify MCContext::(Next|Get)InstanceBenjamin Kramer2010-05-18
| | | | | | | | - 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-17
| | | | 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-07
| | | | 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-07
| | | | | | | 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-08
| | | | | | | 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-08
| | | | | | | | | 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-30
| | | | | | | | | | 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-17
| | | | | | | | | 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-15
| | | | | | | | | | | 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