aboutsummaryrefslogtreecommitdiff
path: root/lib/MC
AgeCommit message (Collapse)Author
2012-04-16MC assembly parser handling for trailing comma in macro instantiation.Jim Grosbach
A trailing comma means no argument at all (i.e., as if the comma were not present), not an empty argument to the invokee. rdar://11252521 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154863 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-11Compute hashes directly with hash_combine instead of taking a detour through ↵Benjamin Kramer
FoldingSetNodeID. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154495 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-10Use the correct section types on Solaris for unwind data on both x86 and x86-64.David Chisnall
Patch by Dmitri Shubin! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154391 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-07Output UTF-8-encoded characters as identifier characters into assemblySean Hunt
by default. This is a behaviour configurable in the MCAsmInfo. I've decided to turn it on by default in (possibly optimistic) hopes that most assemblers are reasonably sane. If this proves a problem, switching to default seems reasonable. I'm not sure if this is the opportune place to test, but it seemed good to make sure it was tested somewhere. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154235 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-06Fixed two leaks in the MC disassembler. The MCSean Callanan
disassembler requires a MCSubtargetInfo and a MCInstrInfo to exist in order to initialize the instruction printer and disassembler; however, although the printer and disassembler keep references to these objects they do not own them. Previously, the MCSubtargetInfo and MCInstrInfo objects were just leaked. I have extended LLVMDisasmContext to own these objects and delete them when it is destroyed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154192 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-02Move getOpcodeName from the various target InstPrinters into the superclass ↵Benjamin Kramer
MCInstPrinter. All implementations used the same code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153866 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-02Make MCInstrInfo available to the MCInstPrinter. This will be used to remove ↵Craig Topper
getInstructionName and the static data it contains since the same tables are already in MCInstrInfo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153860 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-27Prune some includesCraig Topper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153502 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-26Prune some includes and forward declarations.Craig Topper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153429 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-23Add a hook in MCELFObjectTargetWriter to allow targets to sort relocationAkira Hatanaka
entries in the relocation table before they are written out to the file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153345 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-20Assembler should accept redefinitions of unused variable symbols.Jim Grosbach
rdar://11027851 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153137 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-20Tidy up.Jim Grosbach
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153136 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-17MC asm parser macro argument count was wrong when empty.Jim Grosbach
evaluated to '1' when the argument list was empty (should be '0'). rdar://11057257 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152967 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-15Implement relocation-overflow behavior for PE/COFF.Michael J. Spencer
This needs a test, but it will take some time to figure out the best way to get an input that will produce > 2^16 relocs. Patch by Graydon Hoare! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152787 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05Make MCRegisterInfo available to the the MCInstPrinter.Jim Grosbach
Used to allow context sensitive printing of super-register or sub-register references. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152043 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03Correctly initialize LineSectionSymbol. Thanks to Duncan Sands for noticing it.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151979 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-29Make MemoryObject accessor members const againDerek Schuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151687 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-28On ELF, create relocations to the abbreviation and line sections when producingRafael Espindola
debug info for assembly files. We were already doing the right thing when producing debug info for C/C++. ELF linkers don't know dwarf, so they depend on these relocations to produce valid dwarf output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151655 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-27ARM BL/BLX instruction fixups should use relocations.Jim Grosbach
We on the linker to resolve calls to the appropriate BL/BLX instruction to make interworking function correctly. It uses the symbol in the relocation to do that, so we need to be careful about being too clever. To enable this for ARM mode, split the BL/BLX fixup kind off from the unconditional-branch fixups. rdar://10927209 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151571 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25Grammar-o.Eric Christopher
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151418 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-24ARM Thumb symbol references in assembly need the low bit set.Jim Grosbach
Add support for a missed case when the symbols in a difference expression are in the same section but not the same fragment. rdar://10924681 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151345 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-23Emit global ctors into .CRT$XCU instead of .ctors on Win32. Patch by Joe Groff!Michael J. Spencer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151289 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-23Bump SmallString to the minimum required amount for raw_ostream to avoid ↵Benjamin Kramer
allocation. It's is a bit annoying, we should hide this implementation detail better. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151284 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-22MC: Fix the MCNullStreamer which was broken in r147763.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151213 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21Switch the llvm::Triple class to immediately parse the triple string onChandler Carruth
construction. Simplify its interface, implementation, and users accordingly as there is no longer an 'uninitialized' state to check for. Also, fixes a bug lurking in the interface as there was one method that didn't correctly check for initialization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151024 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19Remove dead code. Improve llvm_unreachable text. Simplify some control flow.Ahmed Charles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150918 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17Fix typo in comment ldopen() -> dlopen().Kevin Enderby
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150836 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17Put back the initializing the targets in the disassembler API with a comment asKevin Enderby
to why this is needed. This broke the darwin's otool(1) program. This change was made in r144385. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150832 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17Generate the correct EH frame section types on Solaris, this time without ↵David Chisnall
breaking other platforms... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150819 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17Revert r150814. It turns out that there is a good reason for this after all...David Chisnall
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150818 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-17Don't lazily allocate eh_frame. We're not lazily allocating things like the ↵David Chisnall
LSDA, which are only used when the eh frame is used, so this lazy allocation doesn't really make sense. Fix the type of eh_frame on Solaris so that Sun ld doesn't fail to combine them (thus making it impossible for the unwind library to find them and breaking exceptions). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150814 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-15For ELF, also call fixSymbolsInTLSFixups() on expressions passed to ↵David Meyer
EmitValue (literal values). Previously only called on expressions in instructions. New test cases added to tls.s, tls-i386.s. Resolves PR11981. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150582 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-11Add support for implicit TLS model used with MS VC runtime.Anton Korobeynikov
Patch by Kai Nacke! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150307 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-07Convert assert(0) to llvm_unreachableCraig Topper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149967 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06Enable streaming of bitcodeDerek Schuff
This CL delays reading of function bodies from initial parse until materialization, allowing overlap of compilation with bitcode download. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149918 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-04Modified the Enhanced Disassembler to create andSean Callanan
cache disassemblers according to the string value of the target triple, not according to the enum of the triple CPU. The reason for this is that certain attributes of the instruction set are not reflected in the enum, but only in the string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149773 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-03Add a new MachineJumpTableInfo entry type, EK_GPRel64BlockAddress, which isAkira Hatanaka
needed to emit a 64-bit gp-relative relocation entry. Make changes necessary for emitting jump tables which have entries with directive .gpdword. This patch does not implement the parts needed for direct object emission or JIT. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149668 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31Fixed a crash in llvm-mc for Mach-O when a symbol difference expression uses aKevin Enderby
symbol from an assignment. In this case the symbol did not have a fragment so MCObjectWriter::IsSymbolRefDifferenceFullyResolved() should not have been calling IsSymbolRefDifferenceFullyResolvedImpl() with a NULL fragment and should just have returned false in that case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149442 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-31Add assembler dialect attribute in asm parser which lets target specific asm ↵Devang Patel
parser change dialect on the fly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149396 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-28Silence GCC's -Wreturn-type warning.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149179 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-28Small improvement to the recursion detection logic from the previous commit.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149175 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-28Handle recursive variable definitions directly. This gives us better errorRafael Espindola
messages and allows us to fix PR11865. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149174 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27Source information in 'expected relocatable expression' diagnostic.Jim Grosbach
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149105 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-27Better diagnostic for malformed .org assembly directive.Jim Grosbach
Provide source line number information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149101 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26Tidy up.Jim Grosbach
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149096 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26Add simple support for keeping MCFixup source information.Jim Grosbach
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
2012-01-26Add SourceMgr to MCContext for backend diagnostics.Jim Grosbach
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149090 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-26Add support for the R_ARM_TARGET1 relocation, which should be given to ↵James Molloy
relocations applied to all C++ constructors and destructors. This enables the linker to match concrete relocation types (absolute or relative) with whatever library or C++ support code is being linked against. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149057 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-25Properly emit ctors / dtors with priorities into desired sectionsAnton Korobeynikov
and let linker handle the rest. This finally fixes PR5329 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148990 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-24ARM Darwin symbol ref differences w/o subsection-via-symbols.Jim Grosbach
When not using subsections via symbols, the assembler can resolve symbol differences (including pcrel references) to non-local labels at assembly time, not just those in the same atom. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148865 91177308-0d34-0410-b5e6-96231b3b80d8