summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* MC: don't create a backtrace for diagnostics.Jim Grosbach2014-03-141-1/+1
| | | | | | | | | | | For better or worse, this is currently the normal error reporting path when dealing with backend errors from inline assembly. It's not just internal compiler issues that come through here, so we shouldn't be creating a backtrace on this path. rdar://16329947 llvm-svn: 203979
* MCContext: Remove redundant assignmentDavid Blaikie2014-03-141-2/+0
| | | | | | | The member variable is not initialized in the ctor so it's already empty. No need to empty it again. llvm-svn: 203963
* MCDwarf: Rename MCDwarfFileTable to MCDwarfLineTableDavid Blaikie2014-03-131-2/+2
| | | | | | | This type now represents all the data for the DWARF line table: directory names, file names, and the line table proper. llvm-svn: 203858
* MCDwarf: Sink file/directory creation down into MCDwarfFileTable form MCContextDavid Blaikie2014-03-131-50/+1
| | | | llvm-svn: 203836
* MCDwarf: Oh, and move the directory string over to std::string as wellDavid Blaikie2014-03-131-6/+3
| | | | | | (see r203831 for similar stuff) llvm-svn: 203833
* MCDwarf: Simplify MCDwarfFile to just use std::string instead of cunning use ↵David Blaikie2014-03-131-16/+10
| | | | | | | | | | | | | of MCContext's allocator. There aren't /that/ many files, and we are already using various maps and other standard containers that don't use MCContext's allocator to store these values, so this doesn't seem to be critical and simplifies the design (I'll be moving construction out of MCContext shortly so it'd be annoying to have to pass the allocator around to allocate these things... and we'll have non-MCContext users (debug_line.dwo) shortly) llvm-svn: 203831
* MCDwarf: Simply MCDwarfFile since it really is just a StringRef and unsigned.David Blaikie2014-03-131-1/+3
| | | | llvm-svn: 203827
* Use printable names to implement directional labels.Rafael Espindola2014-03-131-13/+20
| | | | | | | | | | | | | | This changes the implementation of local directional labels to use a dedicated map. With that it can then just use CreateTempSymbol, which is what the rest of MC uses. CreateTempSymbol doesn't do a great job at making sure the names are unique (or being efficient when the names are not needed), but that should probably be fixed in a followup patch. This fixes pr18928. llvm-svn: 203826
* Remove stale commentDavid Blaikie2014-03-131-4/+0
| | | | llvm-svn: 203823
* MCDwarf: Refactor line table handling into a single data structureDavid Blaikie2014-03-131-7/+5
| | | | | | | | | | | | | | | | | This replaces several "compile unit ID -> thing" mappings in favor of one mapping from CUID to the whole line table structure (files, directories, and lines). This is another step along the way to refactoring out reusable components of line table handling for use when generating debug_line.dwo for fission type units. Also, might be a good basis to fold some of this handling down into MCStreamers to avoid the special case of "One line table when doing asm printing, line table per CU otherwise" by building it into the different MCStreamer implementations. llvm-svn: 203821
* MCDwarf: Invert the Section+CU->LineEntries mapping so the CU is the primary ↵David Blaikie2014-03-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | dimension This makes the mapping consistent with other CU->X mappings in the MCContext, helping pave the way to refactor all these values into a single data structure per CU and thus a single map. I haven't renamed the data structure as that would make the patch churn even higher (the MCLineSection name no longer makes sense, as this structure now contains lines for multiple sections covered by a single CU, rather than lines for a single section in multiple CUs) and further refactorings will follow that may remove this type entirely. For convenience, I also gave the MCLineSection value semantics so we didn't have to do the lazy construction, manual delete, etc. (& for those playing at home, refactoring the line printing into a single data structure will eventually alow that data structure to be reused to own the debug_line.dwo line table used for type unit file name resolution) llvm-svn: 203726
* Correct typo ("a entry" -> "an entry")David Blaikie2014-03-121-1/+1
| | | | llvm-svn: 203678
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-071-1/+0
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
* Fix a crash that occurs when PWD is invalid.Andrew Trick2013-12-101-2/+2
| | | | | | | | | | | | | | | | | | | | MCJIT needs to be able to run in hostile environments, even when PWD is invalid. There's no need to crash MCJIT in this case. The obvious fix is to simply leave MCContext's CompilationDir empty when PWD can't be determined. This way, MCJIT clients, and other clients that link with LLVM don’t need a valid working directory. If we do want to guarantee valid CompilationDir, that should be done only for clients of getCompilationDir(). This is as simple as checking for an empty string. The only current use of getCompilationDir is EmitGenDwarfInfo, which won’t conceivably run with an invalid working dir. However, in the purely hypothetically and untestable case that this happens, the AT_comp_dir will be omitted from the compilation_unit DIE. llvm-svn: 196874
* whitespaceAndrew Trick2013-12-101-2/+2
| | | | llvm-svn: 196873
* Correct word hyphenationsAlp Toker2013-12-051-1/+1
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities and contractions in nearby lines. llvm-svn: 196471
* Avoid buffer copies when a Twine already is a StringRef.David Blaikie2013-12-031-2/+1
| | | | llvm-svn: 196301
* Support multiple COFF sections with the same name but different COMDAT.Rafael Espindola2013-11-191-13/+31
| | | | | | | | | | | | | | | | | | This is the first step to fix pr17918. It extends the .section directive a bit, inspired by what the ELF one looks like. The problem with using linkonce is that given .section foo .linkonce.... .section foo .linkonce we would already have switched sections when getting to .linkonce. The cleanest solution seems to be to add the comdat information in the .section itself. llvm-svn: 195148
* MC: Support multiple sections with the same name in the same comdat groupDavid Blaikie2013-10-221-6/+12
| | | | | | Code review by Eric Christopher and Rafael Espindola. llvm-svn: 193209
* MC: Implement COFF .linkonce directiveNico Rieck2013-07-061-5/+13
| | | | llvm-svn: 185753
* Use pointers to the MCAsmInfo and MCRegInfo.Bill Wendling2013-06-181-5/+5
| | | | | | | | | Someone may want to do something crazy, like replace these objects if they change or something. No functionality change intended. llvm-svn: 184175
* Silence warning in Release builds.Benjamin Kramer2013-06-161-0/+1
| | | | llvm-svn: 184059
* Replace use of PathV1.h in MCContext.cpp.Rafael Espindola2013-06-141-2/+4
| | | | | | GetCurrentDirectory is now unused. Remove it. llvm-svn: 184003
* Don't use PathV1.h in Signals.h.Rafael Espindola2013-06-131-0/+1
| | | | llvm-svn: 183947
* Debug Info: use SmallVector instead of std::vector in MCDwarfDirsCUMap and ↵Manman Ren2013-03-121-3/+3
| | | | | | MCDwarfFilesCUMap llvm-svn: 176893
* Debug Info: store the files and directories for each compile unit.Manman Ren2013-03-071-4/+7
| | | | | | | | | | | | | | We now emit a line table for each compile unit. To reduce the prologue size of each line table, the files and directories used by each compile unit are stored in std::map<unsigned, std::vector< > > instead of std::vector< >. The prologue for a lto'ed image can be as big as 93K. Duplicating 93K for each compile unit causes a huge increase of debug info. With this patch, each prologue will only emit the files required by the compile unit. rdar://problem/13342023 llvm-svn: 176605
* clear new map and initialize new variablePedro Artigas2013-02-201-0/+2
| | | | llvm-svn: 175578
* Dwarf: support for LTO where a single object file can have multiple line tablesManman Ren2013-02-051-1/+1
| | | | | | | | | We generate one line table for each compilation unit in the object file. Reviewed by Eric and Kevin. rdar://problem/13067005 llvm-svn: 174445
* Formatting.Eric Christopher2012-12-181-1/+1
| | | | llvm-svn: 170394
* Add support for passing -main-file-name all the way through toEric Christopher2012-12-181-0/+6
| | | | | | | | the assembler. Part of PR14624 llvm-svn: 170390
* Prepare LLVM to fix PR14625, exposing a hook in MCContext to manage theChandler Carruth2012-12-171-1/+2
| | | | | | | | | | compilation directory. This defaults to the current working directory, just as it always has, but now an assembler can choose to override it with a custom directory. I've taught llvm-mc about this option and added a test case. llvm-svn: 170371
* Make the MCStreamer have a reset method and call that after finalization of ↵Pedro Artigas2012-12-121-19/+15
| | | | | | | | the asm printer, also changed MCContext to a single reset only method for simplicity as requested on the list llvm-svn: 170041
* fixed valgrind issues of prior commit, this change applies r169456 changes ↵Pedro Artigas2012-12-061-8/+42
| | | | | | | | | | | | back to the tree with fixes. on darwin no valgrind issues exist in the tests that used to fail. original change description: change MCContext to work on the doInitialization/doFinalization model reviewed by Evan Cheng <evan.cheng@apple.com> llvm-svn: 169553
* Revert r169456, "change MCContext to work on the ↵NAKAMURA Takumi2012-12-061-31/+6
| | | | | | | | doInitialization/doFinalization model" It broke many builders. llvm-svn: 169462
* change MCContext to work on the doInitialization/doFinalization modelPedro Artigas2012-12-061-6/+31
| | | | | | reviewed by Evan Cheng <evan.cheng@apple.com> llvm-svn: 169456
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-7/+7
| | | | | | | | | | | | | | | | | 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. =] llvm-svn: 169131
* Avoid symbol name clash when filling TOC.Roman Divacky2012-09-181-0/+6
| | | | | | Patch by Adhemerval Zanella. llvm-svn: 164141
* MCContext.cpp: Fixup for my odd previous commit. No functional changes.NAKAMURA Takumi2012-07-031-1/+1
| | | | llvm-svn: 159645
* MCContext::GetDwarfFile(): Make FileName parsing tolerant of DOSish pathsep ↵NAKAMURA Takumi2012-07-031-5/+5
| | | | | | | | with PathV2. It fixes failure in test/MC/MachO/gen-dwarf.s on Win32 w/o bash. llvm-svn: 159640
* Add simple support for keeping MCFixup source information.Jim Grosbach2012-01-261-0/+19
| | | | | | | Can be used to issue more user friendly diagnostics for faulty relocation constructs and such. llvm-svn: 149092
* Add SourceMgr to MCContext for backend diagnostics.Jim Grosbach2012-01-261-2/+2
| | | | llvm-svn: 149090
* 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
OpenPOWER on IntegriCloud