summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix some comment typos.Benjamin Kramer2015-08-081-2/+2
| | | | llvm-svn: 244402
* [MC/Dwarf] Allow to specify custom parameters for linetable emission.Frederic Riss2015-08-073-52/+54
| | | | | | | | | NFC patch for current users, but llvm-dsymutil will use the new functionality to adapt to the input linetable. Based on a patch by Adrian Prantl. llvm-svn: 244318
* Force the MachO generated for Darwin to have VERSION_MIN load commandSteven Wu2015-08-051-0/+10
| | | | | | | | | On Darwin, it is required to stamp the object file with VERSION_MIN load command. This commit will provide a VERSRION_MIN load command to the MachO file that doesn't specify the version itself by inferring from Target Triple. llvm-svn: 244059
* Use range-based for loops. NFCCraig Topper2015-08-021-31/+26
| | | | llvm-svn: 243859
* [llvm-mc] Add --no-warn flag with -W alias to disable outputting warnings ↵Colin LeMahieu2015-07-272-1/+3
| | | | | | while assembling. llvm-svn: 243338
* [llvm-mc] Pushing plumbing through for --fatal-warnings flag.Colin LeMahieu2015-07-271-2/+2
| | | | llvm-svn: 243334
* Fix a -Winconsistent-missing-override failure in the .intel_syntaxChandler Carruth2015-07-221-1/+1
| | | | | | patch. llvm-svn: 242890
* [X86] Add .intel_syntax noprefix directive to intel-syntax x86 asm outputMichael Kuperstein2015-07-222-0/+13
| | | | | | | Patch by: michael.zuckerman@intel.com Differential Revision: http://reviews.llvm.org/D11223 llvm-svn: 242886
* [MC] Correctly escape .safeseh's symbolDavid Majnemer2015-07-131-1/+2
| | | | | | This fixes PR24107. llvm-svn: 242050
* MC: Only allow changing feature bits in MCSubtargetInfoDuncan P. N. Exon Smith2015-07-101-5/+12
| | | | | | | | | | | | | | | | | Disallow all mutation of `MCSubtargetInfo` expect the feature bits. Besides deleting the assignment operators -- which were dead "code" -- this restricts `InitMCProcessorInfo()` to subclass initialization sequences, and exposes a new more limited function called `setDefaultFeatures()` for use by the ARMAsmParser `.cpu` directive. There's a small functional change here: ARMAsmParser used to adjust `MCSubtargetInfo::CPUSchedModel` as a side effect of calling `InitMCProcessorInfo()`, but I've removed that suspicious behaviour. Since the AsmParser shouldn't be doing any scheduling, there shouldn't be any observable change... llvm-svn: 241961
* MC: Remove MCSubtargetInfo() default constructorDuncan P. N. Exon Smith2015-07-101-15/+5
| | | | | | | | | | | | | | | | | | | | | Force all creators of `MCSubtargetInfo` to immediately initialize it, merging the default constructor and the initializer into an initializing constructor. Besides cleaning up the code a little, this makes it clear that the initializer is never called again later. Out-of-tree backends need a trivial change: instead of calling: auto *X = new MCSubtargetInfo(); InitXYZMCSubtargetInfo(X, ...); return X; they should call: return createXYZMCSubtargetInfoImpl(...); There's no real functionality change here. llvm-svn: 241957
* MC: Remove MCSubtargetInfo::InitCPUSched()Duncan P. N. Exon Smith2015-07-101-5/+0
| | | | | | | | | | | | Remove all calls to `MCSubtargetInfo::InitCPUSched()` and merge its body into the only relevant caller, `MCSubtargetInfo::InitMCProcessorInfo()`. We were only calling the former after explicitly calling the latter with the same CPU; it's confusing to have both methods exposed. Besides a minor (surely unmeasurable) speedup in ARM and X86 from avoiding running the logic twice, no functionality change. llvm-svn: 241956
* Add <type_traits> for is_pod, fixing r241947Duncan P. N. Exon Smith2015-07-101-0/+1
| | | | llvm-svn: 241949
* MC: Remove the copy of MCSchedModel in MCSubtargetInfoDuncan P. N. Exon Smith2015-07-103-6/+39
| | | | | | | | | | | `MCSchedModel` is large. Make `MCSchedModel::GetDefaultSchedModel()` return by-reference instead of by-value, so we can store a pointer in `MCSubtargetInfo::CPUSchedModel` instead of a copy. Note: since `MCSchedModel` is POD, this doesn't create a static constructor. llvm-svn: 241947
* [MC] Switch static const to an enum to silence MSVC linker warningsDavid Majnemer2015-07-101-3/+0
| | | | | | | Integral class statics are handled oddly in MSVC, we don't need them in this case, use an enum instead. llvm-svn: 241945
* MC: Constify MCSubtargetInfo in getDeprecationInfo(), NFCDuncan P. N. Exon Smith2015-07-081-1/+1
| | | | | | | There's no reason to be able to mutate `MCSubtargetInfo` in `getDeprecationInfo()`. Constify the reference. llvm-svn: 241693
* Change the last few internal StringRef triples into Triple objects.Daniel Sanders2015-07-061-1/+5
| | | | | | | | | | | | | | | | | | | | Summary: This concludes the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. At this point, the StringRef-form of GNU Triples should only be used in the public API (including IR serialization) and a couple objects that directly interact with the API (most notably the Module class). The next step is to replace these Triple objects with the TargetTuple object that will represent our authoratative/unambiguous internal equivalent to GNU Triples. Reviewers: rengolin Subscribers: llvm-commits, jholewinski, ted, rengolin Differential Revision: http://reviews.llvm.org/D10962 llvm-svn: 241472
* Fix spelling, NFC.Yaron Keren2015-07-041-1/+1
| | | | llvm-svn: 241392
* Convert a member variable to a local one.Rafael Espindola2015-07-021-3/+3
| | | | llvm-svn: 241284
* Pack MCSymbol::Flags in to the bitfield with other members. NFC.Pete Cooper2015-07-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All file formats only needed 16-bits right now which is enough to fit in to the padding with other fields. This reduces the size of MCSymbol to 24-bytes on a 64-bit system. The layout is now 0 | class llvm::MCSymbol 0 | class llvm::PointerIntPair SectionOrFragmentAndHasName 0 | intptr_t Value | [sizeof=8, dsize=8, align=8 | nvsize=8, nvalign=8] 8 | unsigned int IsTemporary 8 | unsigned int IsRedefinable 8 | unsigned int IsUsed 8 | _Bool IsRegistered 8 | unsigned int IsExternal 8 | unsigned int IsPrivateExtern 8 | unsigned int Kind 9 | unsigned int IsUsedInReloc 9 | unsigned int SymbolContents 9 | unsigned int CommonAlignLog2 10 | uint32_t Flags 12 | uint32_t Index 16 | union 16 | uint64_t Offset 16 | uint64_t CommonSize 16 | const class llvm::MCExpr * Value | [sizeof=8, dsize=8, align=8 | nvsize=8, nvalign=8] | [sizeof=24, dsize=24, align=8 | nvsize=24, nvalign=8] llvm-svn: 241196
* Encode MCSymbol alignment as log2(align).Pete Cooper2015-07-011-0/+2
| | | | | | | | | | | | | Given that alignments are always powers of 2, just encode it this way. This matches how we encode alignment on IR GlobalValue's for example. This compresses the CommonAlign member down to 5 bits which allows it to pack better with the surrounding fields. Reviewed by Duncan Exon Smith. llvm-svn: 241189
* Fix PR23872: Integrated assembler error message when using .type directive ↵Gabor Ballabas2015-07-011-4/+10
| | | | | | | | | | | with @ in AArch32 assembly. The AArch32 assembler parses the '@' as a comment symbol, so the error message shouldn't suggest that '@<type>' is a valid replacement when assembling for AArch32 target. Differential Revision: http://reviews.llvm.org/D10651 llvm-svn: 241149
* Pack MCSymbol::HasName in to a spare bit in the section/fragment union.Pete Cooper2015-06-301-1/+1
| | | | | | | | | | | | This is part of an effort to pack the average MCSymbol down to 24 bytes. The HasName bit was pushing the size of the bitfield over to another word, so this change uses a PointerIntPair to fit in it to unused bits of a PointerUnion. Reviewed by Rafael Espíndola llvm-svn: 241115
* Reverting r241058 because it's causing buildbot failures.Ranjeet Singh2015-06-301-3/+1
| | | | llvm-svn: 241061
* There are a few places where subtarget features are stillRanjeet Singh2015-06-301-1/+3
| | | | | | | | | represented by uint64_t, this patch replaces these usages with the FeatureBitset (std::bitset) type. Differential Revision: http://reviews.llvm.org/D10542 llvm-svn: 241058
* [MC] Ensure that pending labels are flushed when -mc-relax-all flag is usedPetr Hosek2015-06-271-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The current implementation doesn't always flush all pending labels beforeemitting data which can result in an incorrectly placed labels in case when when instruction bundling is enabled and -mc-relax-all flag is being used. To address this issue, we always flush pending labels before emitting data. The change was tested by running PNaCl toolchain trybots with -mc-relax-all flag set. Fixes https://code.google.com/p/nativeclient/issues/detail?id=4063 Test Plan: Regression test attached Reviewers: mseaborn Subscribers: jfb, llvm-commits Differential Revision: http://reviews.llvm.org/D10325 llvm-svn: 240870
* [MC] Align fragments when -mc-relax-all flag is usedPetr Hosek2015-06-271-6/+12
| | | | | | | | | | | | | | | | | | | | | | | Summary: Ensure that fragments are bundle aligned when instruction bundling is enabled and the -mc-relax-all flag is set. This is implicitly assumed by the bundle padding implementation but this assumption does not hold when custom alignment is being used. The change was tested by running PNaCl toolchain trybots with -mc-relax-all flag set. Fixes https://code.google.com/p/nativeclient/issues/detail?id=4063 Test Plan: Regression test attached Reviewers: mseaborn Subscribers: jfb, llvm-commits Differential Revision: http://reviews.llvm.org/D10044 llvm-svn: 240869
* IAS: Use the root macro instanciation for locationFrederic Riss2015-06-251-2/+2
| | | | | | | | | | | | | | r224810 fixed the handling of macro debug locations in AsmParser. This patch fixes the logic to actually do what was intended: it uses the first macro of the macro stack instead of the last one. The updated testcase shows that the current scheme doesn't work when macro instanciations are nested and multiple files are used. Reviewers: compnerd Differential Revision: http://reviews.llvm.org/D10463 llvm-svn: 240705
* Diagnose undefined temporary symbols.Rafael Espindola2015-06-251-0/+5
| | | | | | | | | | | | We already disallowed .global .Lfoo so this is reasonable. This is a small cherry pick from r240130. llvm-svn: 240681
* [mips] [IAS] Fix parsing of memory offset expressions with parenthesis depth >1.Toma Tabacu2015-06-251-0/+23
| | | | | | | | | | | | | | | | | | | Summary: In an expression such as "(((a+b)+c)+d)", parseParenExpression() would only parse the "a+b)+c", which would result in an error later on in the parser. This means that we can only parse one level of inner parentheses. In order to fix this, I added a new function called parseParenExprOfDepth(), which parses a specified number of trailing parenthesis expressions (except for the outermost parenthesis), and changed MipsAsmParser to use it in parseMemOffset instead of parseParenExpression(). Reviewers: dsanders, rafael Reviewed By: dsanders, rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9742 llvm-svn: 240625
* Enable StackMap Serialization for COFFSwaroop Sridhar2015-06-251-0/+5
| | | | | | | | | | | | | | | | | | Summary This change turns on the emission of __LLVM_Stackmaps section when generating COFF binaries. Test Plan Added a scenario to the test case: test\CodeGen\X86\statepoint-stackmap-format.ll. Code Review: http://reviews.llvm.org/D10680 llvm-svn: 240613
* Revert r240302 ("Bring r240130 back.").Daniel Jasper2015-06-233-25/+19
| | | | | | | | | | | | | This causes errors like: ld: error: blah.o: requires dynamic R_X86_64_PC32 reloc against '' which may overflow at runtime; recompile with -fPIC blah.cc:function f(): error: undefined reference to '' blah.o:g(): error: undefined reference to '' I have not yet come up with an appropriate reproduction. llvm-svn: 240394
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-2313-18/+18
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* MCExpr: Avoid UB by evaluating this shift as unsignedJustin Bogner2015-06-231-1/+1
| | | | | | | | We hit undefined behaviour in some MCExpr tests when the LHS of a left shift is -1. Twos-complement semantics are completely reasonable here, so we should just do the shift in unsigned. llvm-svn: 240385
* Fix PR23914.Evgeniy Stepanov2015-06-221-1/+1
| | | | | | | r226830 moved the declaration of Buf to a nested scope, resulting in a dangling reference (in StringRef Name), and a use-after-free. llvm-svn: 240357
* Move MCSymbol Value in to the union of Offset and CommonSize.Pete Cooper2015-06-221-0/+4
| | | | | | | | | | | | | | | | This is a reapplication of r239440 which was reverted in r239441. There are no changes to this patch from then, but this had instead exposed a bug in .thumb_set which was fixed in r240318. Having fixed that bug, it is now safe to re-apply this code. Original commit message below: It wasn't possible to have a variable Symbol with offset or 'isCommon' so this just enables better packing of the MCSymbol class. Reviewed by Rafael Espindola. llvm-svn: 240320
* Change .thumb_set to have the same error checks as .set.Pete Cooper2015-06-221-70/+106
| | | | | | | | | | | | | | According to the documentation, .thumb_set is 'the equivalent of a .set directive'. We didn't have equivalent behaviour in terms of all the errors we could throw, for example, when a symbol is redefined. This change refactors parseAssignment so that it can be used by .set and .thumb_set and implements tests for .thumb_set for all the errors thrown by that method. Reviewed by Rafael Espíndola. llvm-svn: 240318
* Bring r240130 back.Rafael Espindola2015-06-223-19/+25
| | | | | | | | | | | | | | | | | | | | | | Now that pr23900 is fixed, we can bring it back with no changes. Original message: Make all temporary symbols unnamed. What this does is make all symbols that would otherwise start with a .L (or L on MachO) unnamed. Some of these symbols still show up in the symbol table, but we can just make them unnamed. In order to make sure we produce identical results when going thought assembly, all .L (not just the compiler produced ones), are now unnamed. Running llc on llvm-as.opt.bc, the peak memory usage goes from 208.24MB to 205.57MB. llvm-svn: 240302
* Update ELFObjectWriter::reset() following r238073.Yaron Keren2015-06-201-0/+1
| | | | llvm-svn: 240218
* Revert 240130, it caused crashes (repro in PR23900).Nico Weber2015-06-194-27/+23
| | | | llvm-svn: 240193
* Fix header path in CMake. NFC.Pete Cooper2015-06-191-1/+1
| | | | | | | The ADDITIONAL_HEADER_DIRS command can be used to tell UIs that a given library owns certain headers. The path for MCParser was missing MC/ in it. llvm-svn: 240175
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-1913-18/+18
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* Make all temporary symbols unnamed.Rafael Espindola2015-06-193-19/+25
| | | | | | | | | | | | | | | | What this does is make all symbols that would otherwise start with a .L (or L on MachO) unnamed. Some of these symbols still show up in the symbol table, but we can just make them unnamed. In order to make sure we produce identical results when going thought assembly, all .L (not just the compiler produced ones), are now unnamed. Running llc on llvm-as.opt.bc, the peak memory usage goes from 208.24MB to 205.57MB. llvm-svn: 240130
* [MC] Adding prettyPrintAsm to MCTargetStreamer to allow targets to ↵Colin LeMahieu2015-06-182-1/+10
| | | | | | specialize how instructions are printed to asm. llvm-svn: 240050
* Devirtualize and pack MCFragment to reduce memory usage.Pete Cooper2015-06-172-49/+79
| | | | | | | | | | | | | MCFragment didn't really need vtables. The majority of virtual methods were just getters and setters. This removes the vtables and uses dispatch on the kind to do things like delete which needs to get the appropriate class. This reduces memory on the verify use list order test case by about 2MB out of 800MB. Reviewed by Rafael Espíndola llvm-svn: 239952
* Move IsUsedInReloc from MCSymbolELF to MCSymbol.Rafael Espindola2015-06-172-24/+2
| | | | | | There is a free bit is MCSymbol and MachO needs the same information. llvm-svn: 239933
* Use named temporaries for directional labels.Rafael Espindola2015-06-171-9/+10
| | | | | | | | | | Directional labels can show up in symbol tables (and we have a llvm-mc test for that). Given that, we need to make sure they are named. With that out of the way, use setUseNamesOnTempLabels in llvm-mc so that it too benefits from the memory saving. llvm-svn: 239914
* [MC/Dwarf] Encode DW_CFA_advance_loc in target endianess.Benjamin Kramer2015-06-171-9/+8
| | | | | | This matches GNU as output. llvm-svn: 239911
* Recommit r239721: Replace string GNU Triples with llvm::Triple in ↵Daniel Sanders2015-06-161-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | InitMCObjectFileInfo. NFC. Summary: This affects other tools so the previous C++ API has been retained as a deprecated function for the moment. Clang has been updated with a trivial patch (not covered by the pre-commit review) to avoid breaking -Werror builds. Other in-tree tools will be fixed with similar patches. This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. The first time this was committed it accidentally fixed an inconsistency in triples in llvm-mc and this caused a failure. This inconsistency was fixed in r239808. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10366 llvm-svn: 239812
* [CodeGen] Introduce a FAULTING_LOAD_OP pseudo-op.Sanjoy Das2015-06-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This instruction encodes a loading operation that may fault, and a label to branch to if the load page-faults. The locations of potentially faulting loads and their "handler" destinations are recorded in a FaultMap section, meant to be consumed by LLVM's clients. Nothing generates FAULTING_LOAD_OP instructions yet, but they will be used in a future change. The documentation (FaultMaps.rst) needs improvement and I will update this diff with a more expanded version shortly. Depends on D10196 Reviewers: rnk, reames, AndyAyers, ab, atrick, pgavlin Reviewed By: atrick, pgavlin Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10197 llvm-svn: 239740
OpenPOWER on IntegriCloud