1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

1573 Commits

Author SHA1 Message Date
Jim Grosbach
a538b5240e MC: Unknown assembler directives are now hard errors.
Previously, an unsupported/unknown assembler directive issued a warning.
That's generally unsafe, and inconsistent with the behaviour of pretty
much every system assembler. Now that the MC assemblers are mature
enough to be the default on multiple targets, it's reasonable to
issue errors for these.

For target or platform directives that need to stay warnings, we
should add explicit handlers for them in, e.g., ELFAsmParser.cpp,
DarwinAsmParser.cpp, et. al., and issue the warning there.

rdar://9246275

llvm-svn: 155926
2012-05-01 18:38:27 +00:00
Jim Grosbach
fc228ff796 MC: Remove errant EatToEndOfStatement() in asm parser.
The caller is already responsible for eating any additional input on the
line. Putting an additional EatToEndOfStatement() in ParseStatement()
causes an entire extra statement to be consumed when treating warnings
as errors. For example, test/MC/macros.s will assert() because the
.endmacro directive is missed as a result.

rdar://11355843

llvm-svn: 155925
2012-05-01 18:38:24 +00:00
Jim Grosbach
9e97ef84db MC assembly parser handling for trailing comma in macro instantiation.
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

llvm-svn: 154863
2012-04-16 21:18:49 +00:00
Benjamin Kramer
3a0f5a0df3 Compute hashes directly with hash_combine instead of taking a detour through FoldingSetNodeID.
llvm-svn: 154495
2012-04-11 14:06:39 +00:00
David Chisnall
a098752b13 Use the correct section types on Solaris for unwind data on both x86 and x86-64.
Patch by Dmitri Shubin!

llvm-svn: 154391
2012-04-10 11:44:33 +00:00
Alexis Hunt
5c14769849 Output UTF-8-encoded characters as identifier characters into assembly
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.

llvm-svn: 154235
2012-04-07 00:37:53 +00:00
Sean Callanan
f467eceb2a Fixed two leaks in the MC disassembler. The MC
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.

llvm-svn: 154192
2012-04-06 18:21:09 +00:00
Benjamin Kramer
2f6189e2a5 Move getOpcodeName from the various target InstPrinters into the superclass MCInstPrinter.
All implementations used the same code.

llvm-svn: 153866
2012-04-02 08:32:38 +00:00
Craig Topper
dbc259a436 Make MCInstrInfo available to the MCInstPrinter. This will be used to remove getInstructionName and the static data it contains since the same tables are already in MCInstrInfo.
llvm-svn: 153860
2012-04-02 06:09:36 +00:00
Craig Topper
bf6a47d0ec Prune some includes
llvm-svn: 153502
2012-03-27 07:54:11 +00:00
Craig Topper
76f7896f49 Prune some includes and forward declarations.
llvm-svn: 153429
2012-03-26 06:58:25 +00:00
Akira Hatanaka
d848fb8bf9 Add a hook in MCELFObjectTargetWriter to allow targets to sort relocation
entries in the relocation table before they are written out to the file. 

llvm-svn: 153345
2012-03-23 23:06:45 +00:00
Jim Grosbach
984b0f5ffe Assembler should accept redefinitions of unused variable symbols.
rdar://11027851

llvm-svn: 153137
2012-03-20 21:33:21 +00:00
Jim Grosbach
3f98400327 Tidy up.
llvm-svn: 153136
2012-03-20 21:33:17 +00:00
Jim Grosbach
138c2143c3 MC asm parser macro argument count was wrong when empty.
evaluated to '1' when the argument list was empty (should be '0').

rdar://11057257

llvm-svn: 152967
2012-03-17 00:11:42 +00:00
Michael J. Spencer
e8ce31af5d Implement relocation-overflow behavior for PE/COFF.
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!

llvm-svn: 152787
2012-03-15 09:03:03 +00:00
Jim Grosbach
2eea383b12 Make MCRegisterInfo available to the the MCInstPrinter.
Used to allow context sensitive printing of super-register or sub-register
references.

llvm-svn: 152043
2012-03-05 19:33:20 +00:00
Rafael Espindola
837258385f Correctly initialize LineSectionSymbol. Thanks to Duncan Sands for noticing it.
llvm-svn: 151979
2012-03-03 14:24:15 +00:00
Derek Schuff
db82ff1e09 Make MemoryObject accessor members const again
llvm-svn: 151687
2012-02-29 01:09:06 +00:00
Rafael Espindola
646dff508a On ELF, create relocations to the abbreviation and line sections when producing
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.

llvm-svn: 151655
2012-02-28 21:13:05 +00:00
Jim Grosbach
02bf78f5ca ARM BL/BLX instruction fixups should use relocations.
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

llvm-svn: 151571
2012-02-27 21:36:23 +00:00
Eric Christopher
3975f7b73a Grammar-o.
llvm-svn: 151418
2012-02-25 01:02:44 +00:00
Jim Grosbach
34ae41aecb ARM Thumb symbol references in assembly need the low bit set.
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

llvm-svn: 151345
2012-02-24 05:12:18 +00:00
Michael J. Spencer
ba986d585c Emit global ctors into .CRT$XCU instead of .ctors on Win32. Patch by Joe Groff!
llvm-svn: 151289
2012-02-23 21:56:08 +00:00
Benjamin Kramer
6fe4d97e20 Bump SmallString to the minimum required amount for raw_ostream to avoid allocation.
It's is a bit annoying, we should hide this implementation detail better.

llvm-svn: 151284
2012-02-23 21:15:21 +00:00
Daniel Dunbar
cac06bf0c6 MC: Fix the MCNullStreamer which was broken in r147763.
llvm-svn: 151213
2012-02-22 23:49:50 +00:00
Chandler Carruth
34c9c293e1 Switch the llvm::Triple class to immediately parse the triple string on
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.

llvm-svn: 151024
2012-02-21 03:39:36 +00:00
Ahmed Charles
745c53c2a7 Remove dead code. Improve llvm_unreachable text. Simplify some control flow.
llvm-svn: 150918
2012-02-19 11:37:01 +00:00
Kevin Enderby
36596f0ae8 Fix typo in comment ldopen() -> dlopen().
llvm-svn: 150836
2012-02-17 19:26:00 +00:00
Kevin Enderby
ba7e6a7525 Put back the initializing the targets in the disassembler API with a comment as
to why this is needed.  This broke the darwin's otool(1) program.  This change
was made in r144385.

llvm-svn: 150832
2012-02-17 19:18:29 +00:00
David Chisnall
57bacb511d Generate the correct EH frame section types on Solaris, this time without breaking other platforms...
llvm-svn: 150819
2012-02-17 17:31:15 +00:00
David Chisnall
d237b9b330 Revert r150814. It turns out that there is a good reason for this after all...
llvm-svn: 150818
2012-02-17 16:51:02 +00:00
David Chisnall
6c7c6fe0c2 Don't lazily allocate eh_frame. We're not lazily allocating things like the 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).

llvm-svn: 150814
2012-02-17 16:32:07 +00:00
David Meyer
ce969dfbf0 For ELF, also call fixSymbolsInTLSFixups() on expressions passed to EmitValue (literal values). Previously only called on expressions in instructions. New test cases added to tls.s, tls-i386.s. Resolves PR11981.
llvm-svn: 150582
2012-02-15 15:09:06 +00:00
Anton Korobeynikov
5996573d4b Add support for implicit TLS model used with MS VC runtime.
Patch by Kai Nacke!

llvm-svn: 150307
2012-02-11 17:26:53 +00:00
Craig Topper
639b152ca5 Convert assert(0) to llvm_unreachable
llvm-svn: 149967
2012-02-07 05:05:23 +00:00
Derek Schuff
f522835510 Enable streaming of bitcode
This CL delays reading of function bodies from initial parse until
materialization, allowing overlap of compilation with bitcode download.

llvm-svn: 149918
2012-02-06 22:30:29 +00:00
Sean Callanan
122fc49297 Modified the Enhanced Disassembler to create and
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.

llvm-svn: 149773
2012-02-04 07:45:35 +00:00
Akira Hatanaka
874523adc5 Add a new MachineJumpTableInfo entry type, EK_GPRel64BlockAddress, which is
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.

llvm-svn: 149668
2012-02-03 04:33:00 +00:00
Kevin Enderby
cb876a7560 Fixed a crash in llvm-mc for Mach-O when a symbol difference expression uses a
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.

llvm-svn: 149442
2012-01-31 23:02:57 +00:00
Devang Patel
b8688eac99 Add assembler dialect attribute in asm parser which lets target specific asm parser change dialect on the fly.
llvm-svn: 149396
2012-01-31 18:14:05 +00:00
Benjamin Kramer
d10dc94cac Silence GCC's -Wreturn-type warning.
llvm-svn: 149179
2012-01-28 15:28:41 +00:00
Rafael Espindola
c74f450f77 Small improvement to the recursion detection logic from the previous commit.
llvm-svn: 149175
2012-01-28 06:22:14 +00:00
Rafael Espindola
82e15e4544 Handle recursive variable definitions directly. This gives us better error
messages and allows us to fix PR11865.

llvm-svn: 149174
2012-01-28 05:57:00 +00:00
Jim Grosbach
4492fd6b9f Source information in 'expected relocatable expression' diagnostic.
llvm-svn: 149105
2012-01-27 00:51:23 +00:00
Jim Grosbach
6280a1137f Better diagnostic for malformed .org assembly directive.
Provide source line number information.

llvm-svn: 149101
2012-01-27 00:37:08 +00:00
Jim Grosbach
2bc9a9f339 Tidy up.
llvm-svn: 149096
2012-01-26 23:47:45 +00:00
Jim Grosbach
a3c09652c6 Add simple support for keeping MCFixup source information.
Can be used to issue more user friendly diagnostics for faulty
relocation constructs and such.

llvm-svn: 149092
2012-01-26 23:20:11 +00:00
Jim Grosbach
fbf782200a Add SourceMgr to MCContext for backend diagnostics.
llvm-svn: 149090
2012-01-26 23:20:05 +00:00
James Molloy
402abeda73 Add support for the R_ARM_TARGET1 relocation, which should be given to 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.

llvm-svn: 149057
2012-01-26 09:25:43 +00:00