summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fixed a bug in the code to create a dwarf file and directory table entires whenKevin Enderby2011-11-011-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 143521
* First part of support for generating dwarf for assembly source files with theKevin Enderby2011-11-011-0/+2
| | | | | | | | | | | | -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 llvm-svn: 143509
* Add support for a new extension to the .file directive:Nick Lewycky2011-10-171-15/+18
| | | | | | | | | | .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. llvm-svn: 142300
* Hoist vector.size() computation out of the loop. No functionality change.Nick Lewycky2011-10-121-1/+2
| | | | llvm-svn: 141807
* Goodbye TargetAsmInfo. This eliminate last bit of CodeGen and Target in llvm-mc.Evan Cheng2011-07-201-5/+2
| | | | | | | 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. llvm-svn: 135611
* Add MCObjectFileInfo and sink the MCSections initialization code fromEvan Cheng2011-07-201-2/+3
| | | | | | | | TargetLoweringObjectFileImpl down to MCObjectFileInfo. TargetAsmInfo is done to one last method. It's *almost* gone! llvm-svn: 135569
* Sink getDwarfRegNum, getLLVMRegNum, getSEHRegNum from TargetRegisterInfo downEvan Cheng2011-07-181-2/+4
| | | | | | | | | to MCRegisterInfo. Also initialize the mapping at construction time. This patch eliminate TargetRegisterInfo from TargetAsmInfo. It's another step towards fixing the layering violation. llvm-svn: 135424
* Make the StringMaps attached to MCContext use the MCContext's allocator; Eli Friedman2011-04-181-1/+3
| | | | | | reduces the number of calls to malloc(). llvm-svn: 129687
* Don't store Twine temporaries, it's not safe.Benjamin Kramer2011-04-091-8/+6
| | | | | | And don't append the name over and over again in the loop. llvm-svn: 129210
* MC: Add support for disabling "temporary label" behavior. Useful for debuggingDaniel Dunbar2011-03-281-3/+6
| | | | | | on Darwin. llvm-svn: 128430
* Remove duplicated code.Rafael Espindola2011-01-231-1/+2
| | | | llvm-svn: 124054
* Fixed version of 121434 with no new memory leaks.Rafael Espindola2010-12-101-2/+6
| | | | llvm-svn: 121471
* Revert my previous patch to make the valgrind bots happy.Rafael Espindola2010-12-101-3/+2
| | | | llvm-svn: 121461
* 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). llvm-svn: 121434
* 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. llvm-svn: 120603
* Fix Whitespace.Michael J. Spencer2010-11-261-14/+14
| | | | llvm-svn: 120166
* 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. llvm-svn: 119384
* 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. llvm-svn: 118975
* Initial comdat implementation.Rafael Espindola2010-11-111-2/+20
| | | | llvm-svn: 118805
* Use MCSectionELF in places we know we have an ELF section.Rafael Espindola2010-11-101-2/+1
| | | | llvm-svn: 118699
* Fixed version of 118639 with an extra assert to catch similar problemsRafael Espindola2010-11-091-2/+2
| | | | | | earlier. Implicit bool -> int conversions are evil! llvm-svn: 118651
* Revert previous patch. Missed a case.Rafael Espindola2010-11-091-2/+2
| | | | llvm-svn: 118645
* Remove IsExplicit. It was always false.Rafael Espindola2010-11-091-2/+2
| | | | llvm-svn: 118639
* 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. llvm-svn: 115551
* 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. llvm-svn: 115141
* 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. llvm-svn: 112668
* 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. llvm-svn: 111956
* Add ELF ObjectWriter and Streamer support.Matt Fleming2010-08-161-2/+2
| | | | llvm-svn: 111172
* 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. llvm-svn: 110617
* Stop leaking std::strings in GetDwarfFile.Benjamin Kramer2010-07-291-8/+8
| | | | llvm-svn: 109746
* 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. llvm-svn: 109651
* Convert some tab stops into spaces.Duncan Sands2010-07-121-2/+2
| | | | llvm-svn: 108130
* Added the darwin .secure_log_unique and .secure_log_reset directives.Kevin Enderby2010-06-281-0/+7
| | | | llvm-svn: 107077
* Simplify MCContext::(Next|Get)InstanceBenjamin Kramer2010-05-181-24/+8
| | | | | | | - Allocate MCLabels in the context so they don't leak. - Avoid duplicated densemap lookup. llvm-svn: 104020
* Added support in MC for Directional Local Labels.Kevin Enderby2010-05-171-0/+45
| | | | llvm-svn: 103989
* add COFF support for COMDAT sections, patch by Nathan Jeffords!Chris Lattner2010-05-071-4/+7
| | | | llvm-svn: 103304
* switch MCSectionCOFF from a syntactic to semantic representation,Chris Lattner2010-05-071-1/+20
| | | | | | patch by Peter Housel! llvm-svn: 103267
* move elf section uniquing to MCContext. Along the wayChris Lattner2010-04-081-2/+26
| | | | | | merge XCore's section into MCSectionELF llvm-svn: 100812
* 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. llvm-svn: 100807
* 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. llvm-svn: 99902
* fix GetOrCreateTemporarySymbol to require a name, clientsChris Lattner2010-03-171-11/+0
| | | | | | | should use CreateTempSymbol() if they don't care about the name. llvm-svn: 98712
* 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. llvm-svn: 98536
* add a new CreateTempSymbol method, the use case forChris Lattner2010-03-141-0/+6
| | | | | | | CreateTempSymbol vs GetOrCreateTemporarySymbol are completely different. llvm-svn: 98486
* enhance MCContext::GetOrCreateTemporarySymbol() to create a new symbolChris Lattner2010-03-111-0/+6
| | | | | | with an arbitrary unique name. llvm-svn: 98294
* change MCContext to always have an MCAsmInfo.Chris Lattner2010-03-111-1/+1
| | | | llvm-svn: 98293
* empty symbols aren't possible, the mcsymbol ctor aborts on them.Chris Lattner2010-03-111-4/+0
| | | | llvm-svn: 98288
* Remove unneeded includes.Daniel Dunbar2010-03-101-1/+0
| | | | llvm-svn: 98167
* eliminate MCContext::CreateSymbol and CreateTemporarySymbol.Chris Lattner2010-03-101-11/+10
| | | | | | | Add a new GetOrCreateTemporarySymbol method and a version that takes a twine. llvm-svn: 98118
* Pass StringRef by value.Daniel Dunbar2009-11-061-4/+4
| | | | llvm-svn: 86251
* add a twine version of MCContext::GetOrCreateSymbol.Chris Lattner2009-10-191-1/+9
| | | | llvm-svn: 84561
OpenPOWER on IntegriCloud