summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCSection.cpp
Commit message (Collapse)AuthorAgeFilesLines
* IWYU for llvm-config.h in llvm, additions.Nico Weber2018-04-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See r331124 for how I made a list of files missing the include. I then ran this Python script: for f in open('filelist.txt'): f = f.strip() fl = open(f).readlines() found = False for i in xrange(len(fl)): p = '#include "llvm/' if not fl[i].startswith(p): continue if fl[i][len(p):] > 'Config': fl.insert(i, '#include "llvm/Config/llvm-config.h"\n') found = True break if not found: print 'not found', f else: open(f, 'w').write(''.join(fl)) and then looked through everything with `svn diff | diffstat -l | xargs -n 1000 gvim -p` and tried to fix include ordering and whatnot. No intended behavior change. llvm-svn: 331184
* Reverting r315590; it did not include changes for llvm-tblgen, which is ↵Aaron Ballman2017-10-151-1/+1
| | | | | | | | causing link errors for several people. Error LNK2019 unresolved external symbol "public: void __cdecl `anonymous namespace'::MatchableInfo::dump(void)const " (?dump@MatchableInfo@?A0xf4f1c304@@QEBAXXZ) referenced in function "public: void __cdecl `anonymous namespace'::AsmMatcherEmitter::run(class llvm::raw_ostream &)" (?run@AsmMatcherEmitter@?A0xf4f1c304@@QEAAXAEAVraw_ostream@llvm@@@Z) llvm-tblgen D:\llvm\2017\utils\TableGen\AsmMatcherEmitter.obj 1 llvm-svn: 315854
* [dump] Remove NDEBUG from test to enable dump methods [NFC]Don Hinton2017-10-121-1/+1
| | | | | | | | | | | | | | | Summary: Add LLVM_FORCE_ENABLE_DUMP cmake option, and use it along with LLVM_ENABLE_ASSERTIONS to set LLVM_ENABLE_DUMP. Remove NDEBUG and only use LLVM_ENABLE_DUMP to enable dump methods. Move definition of LLVM_ENABLE_DUMP from config.h to llvm-config.h so it'll be picked up by public headers. Differential Revision: https://reviews.llvm.org/D38406 llvm-svn: 315590
* Mark dump() methods as const. NFCSam Clegg2017-06-211-1/+1
| | | | | | | | | Add const qualifier to any dump() method where adding one was trivial. Differential Revision: https://reviews.llvm.org/D34481 llvm-svn: 305963
* Sort the remaining #include lines in include/... and lib/....Chandler Carruth2017-06-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | I did this a long time ago with a janky python script, but now clang-format has built-in support for this. I fed clang-format every line with a #include and let it re-sort things according to the precise LLVM rules for include ordering baked into clang-format these days. I've reverted a number of files where the results of sorting includes isn't healthy. Either places where we have legacy code relying on particular include ordering (where possible, I'll fix these separately) or where we have particular formatting around #include lines that I didn't want to disturb in this patch. This patch is *entirely* mechanical. If you get merge conflicts or anything, just ignore the changes in this patch and run clang-format over your #include lines in the files. Sorry for any noise here, but it is important to keep these things stable. I was seeing an increasing number of patches with irrelevant re-ordering of #include lines because clang-format was used. This patch at least isolates that churn, makes it easy to skip when resolving conflicts, and gets us to a clean baseline (again). llvm-svn: 304787
* [MC] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-02-081-10/+10
| | | | | | minor fixes (NFC). llvm-svn: 294526
* Cleanup dump() functions.Matthias Braun2017-01-281-0/+2
| | | | | | | | | | | | | | | | | | We had various variants of defining dump() functions in LLVM. Normalize them (this should just consistently implement the things discussed in http://lists.llvm.org/pipermail/cfe-dev/2014-January/034323.html For reference: - Public headers should just declare the dump() method but not use LLVM_DUMP_METHOD or #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) - The definition of a dump method should look like this: #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) LLVM_DUMP_METHOD void MyClass::dump() { // print stuff to dbgs()... } #endif llvm-svn: 293359
* MC: Move MCSection::begin/end to header, NFCDuncan P. N. Exon Smith2016-09-121-8/+0
| | | | llvm-svn: 281188
* [MC] Remove guard(s). NFCI.Davide Italiano2016-08-221-2/+0
| | | | | | | All the methods are already marked with LLVM_DUMP_METHOD. llvm-svn: 279428
* Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith ↵Yaron Keren2016-01-291-1/+1
| | | | | | | | r259192 post commit comment. clang part in r259232, this is the LLVM part of the patch. llvm-svn: 259240
* MC: Remove implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith2015-10-101-1/+1
| | | | llvm-svn: 249922
* Fix pr24486.Rafael Espindola2015-10-051-1/+1
| | | | | | | | | | | | | | | | | | This extends the work done in r233995 so that now getFragment (in addition to getSection) also works for variable symbols. With that the existing logic to decide if a-b can be computed works even if a or b are variables. Given that, the expression evaluation can avoid expanding variables as aggressively and that in turn lets the relocation code see the original variable. In order for this to work with the asm streamer, there is now a dummy fragment per section. It is used to assign a section to a symbol when no other fragment exists. This patch is a joint work by Maxim Ostapenko andy myself. llvm-svn: 249303
* Store a bit in MCSection saying if it was registered with MCAssembler.Rafael Espindola2015-06-011-1/+1
| | | | | | With this we can replace a SetVector with a plain std::vector. llvm-svn: 238706
* Use a bitfield. NFC.Rafael Espindola2015-06-011-1/+2
| | | | llvm-svn: 238705
* Fix NDEBUG build.Rafael Espindola2015-05-271-0/+2
| | | | llvm-svn: 238332
* Delete MCSectionData.Rafael Espindola2015-05-271-24/+23
| | | | llvm-svn: 238331
* Delete dead code. NFC.Rafael Espindola2015-05-271-4/+0
| | | | llvm-svn: 238330
* Move getSubsectionInsertionPoint to MCSection.Rafael Espindola2015-05-271-0/+32
| | | | llvm-svn: 238320
* Stop using MCSectionData in MCAsmLayout.h.Rafael Espindola2015-05-261-0/+2
| | | | llvm-svn: 238170
* Turn MCSectionData into a field of MCSection.Rafael Espindola2015-05-251-0/+11
| | | | | | | This also changes MCAssembler to store a vector of MCSections instead of an iplist of MCSectionData. llvm-svn: 238159
* Move MCSectionData to MCSection.h.Rafael Espindola2015-05-251-0/+17
| | | | | | Another step in merging MCSectionData and MCSection. llvm-svn: 238158
* Move bundle info from MCSectionData to MCSection.Rafael Espindola2015-05-251-0/+18
| | | | llvm-svn: 238143
* Move alignment from MCSectionData to MCSection.Rafael Espindola2015-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This starts merging MCSection and MCSectionData. There are a few issues with the current split between MCSection and MCSectionData. * It optimizes the the not as important case. We want the production of .o files to be really fast, but the split puts the information used for .o emission in a separate data structure. * The ELF/COFF/MachO hierarchy is not represented in MCSectionData, leading to some ad-hoc ways to represent the various flags. * It makes it harder to remember where each item is. The attached patch starts merging the two by moving the alignment from MCSectionData to MCSection. Most of the patch is actually just dropping 'const', since MCSectionData is mutable, but MCSection was not. llvm-svn: 237936
* Refactor how passes get a symbol at the end of a section.Rafael Espindola2015-03-231-0/+9
| | | | | | | | | | There is now a canonical symbol at the end of a section that different passes can request. This also allows us to assert that we don't switch back to a section whose end symbol has already been printed. llvm-svn: 233026
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-1/+1
| | | | | | | | | | | | | | | | | 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
* switch MCSectionCOFF from a syntactic to semantic representation,Chris Lattner2010-05-071-27/+0
| | | | | | patch by Peter Housel! llvm-svn: 103267
* Put MCSectionCOFF::Name into the MCContext instead of leaking it.Jeffrey Yasskin2010-03-221-1/+5
| | | | llvm-svn: 99231
* Pass StringRef by value.Daniel Dunbar2009-11-061-1/+1
| | | | llvm-svn: 86251
* rename TAI -> MAI, being careful not to make MAILJMP instructions :)Chris Lattner2009-08-221-1/+1
| | | | llvm-svn: 79777
* Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.Chris Lattner2009-08-221-2/+2
| | | | llvm-svn: 79763
* Change MCSectionELF to represent a section semantically instead ofBruno Cardoso Lopes2009-08-131-85/+0
| | | | | | | syntactically as a string, very similiar to what Chris did with MachO. The parsing support and validation is not introduced yet. llvm-svn: 78890
* sink uniquing of sections out of MCContext into the ELF and PECOFF TLOF ↵Chris Lattner2009-08-131-16/+2
| | | | | | | | implementations. MCContext no longer maintains a string -> section map. llvm-svn: 78874
* split MachO section handling stuff out to its out .h/.cpp file.Chris Lattner2009-08-101-269/+0
| | | | llvm-svn: 78576
* Make the big switch: Change MCSectionMachO to represent a section *semantically*Chris Lattner2009-08-101-11/+258
| | | | | | | | | | | | | | | | instead of syntactically as a string. This means that it keeps track of the segment, section, flags, etc directly and asmprints them in the right format. This also includes parsing and validation support for llvm-mc and "attribute(section)", so we should now start getting errors about invalid section attributes from the compiler instead of the assembler on darwin. Still todo: 1) Uniquing of darwin mcsections 2) Move all the Darwin stuff out to MCSectionMachO.[cpp|h] 3) there are a few FIXMEs, for example what is the syntax to get the S_GB_ZEROFILL segment type? llvm-svn: 78547
* always end a section with \n on elf.Chris Lattner2009-08-091-0/+2
| | | | llvm-svn: 78534
* sink the 'name' and 'isdirective' state out of MCSection into its derived ↵Chris Lattner2009-08-081-7/+20
| | | | | | | | classes. This totally optimizes PIC16 sections by not having an 'isdirective' bit anymore!! ;-) llvm-svn: 78517
* 1. Make MCSection an abstract class.Chris Lattner2009-08-081-5/+109
| | | | | | | | | 2. Move section switch printing to MCSection virtual method which takes a TAI. This eliminates textual formatting stuff from TLOF. 3. Eliminate SwitchToSectionDirective, getSectionFlagsAsString, and TLOFELF::AtIsCommentChar. llvm-svn: 78510
* make target-specific TLOF impls (except PIC16) create target-specificChris Lattner2009-08-081-2/+2
| | | | | | MCSection instances. llvm-svn: 78500
* stub out PECOFF/MachO/ELF MCSection classesChris Lattner2009-08-081-2/+20
| | | | llvm-svn: 78499
* Change SectionKind to be a property that is true of a *section*, itChris Lattner2009-08-011-5/+6
| | | | | | | | | | | | | | | | | | should have no state that is specific to particular globals in the section. In this case, it means the removal of the "isWeak" and "ExplicitSection" bits. MCSection uses the new form of SectionKind. To handle isWeak, I introduced a new SectionInfo class, which is SectionKind + isWeak, and it is used by the part of the code generator that does classification of a specific global. The ExplicitSection disappears. It is moved onto MCSection as a new "IsDirective" bit. Since the Name of a section is either a section or directive, it makes sense to keep this bit in MCSection. Ultimately the creator of MCSection should canonicalize (e.g.) .text to whatever the actual section is. llvm-svn: 77803
* All MCSections are now required to have a SectionKind.Chris Lattner2009-08-011-8/+5
| | | | llvm-svn: 77787
* split MCSection stuff out to its own .cpp file, add a newChris Lattner2009-07-311-0/+31
MCSectionWithKind subclass of MCSection. llvm-svn: 77684
OpenPOWER on IntegriCloud