Rafael Espindola
4f8e36e163
Fix the FIXME.
...
llvm-svn: 114639
2010-09-23 14:14:56 +00:00
Sean Callanan
389f8119e1
Fixed a crash in the enhanced disassembler where
...
because of the lack of a newline, AsmToken::Eof
was being found instead of AsmToken::EndOfStatement.
llvm-svn: 114621
2010-09-23 02:14:12 +00:00
Jim Grosbach
d8735f1db1
Add support for ELF PLT references for ARM MC asm printing. Adding a
...
new VariantKind to the MCSymbolExpr seems like overkill, but I'm not sure
there's a more straightforward way to get the printing difference captured.
(i.e., x86 uses @PLT, ARM uses (PLT)).
llvm-svn: 114613
2010-09-22 23:27:36 +00:00
Rafael Espindola
3cfff6e0c5
Avoid some Mach-O specific alignment being done on ELF.
...
llvm-svn: 114594
2010-09-22 22:27:05 +00:00
Chris Lattner
04d9e1641f
allow target-specific label suffixes, patch by Yuri Gribov!
...
llvm-svn: 114592
2010-09-22 22:19:53 +00:00
Rafael Espindola
ef6cf9dce9
Fix typo and add a FIXME.
...
llvm-svn: 114570
2010-09-22 19:04:41 +00:00
Jim Grosbach
8899a330c7
grammar tweakage
...
llvm-svn: 114561
2010-09-22 18:18:30 +00:00
Jim Grosbach
f8956463a7
remove trailing whitespace
...
llvm-svn: 114560
2010-09-22 18:16:55 +00:00
Rafael Espindola
a2d73f0a38
Correctly align bss.
...
llvm-svn: 114556
2010-09-22 17:43:04 +00:00
Chris Lattner
1c5e55f787
fix rdar://8456417 - llvm-mc can't do basic math
...
llvm-svn: 114532
2010-09-22 05:05:16 +00:00
Rafael Espindola
93f3fb8aca
Revert unrelated change that was accidentally included in the previous commit.
...
llvm-svn: 114383
2010-09-21 00:40:19 +00:00
Rafael Espindola
02af3cdd58
Implement support for .local and its "interesting" interactions with .comm.
...
llvm-svn: 114382
2010-09-21 00:24:38 +00:00
Rafael Espindola
78fc1f7f66
Produce a R_X86_64_32 when the value is >=0.
...
llvm-svn: 114339
2010-09-20 19:20:47 +00:00
Rafael Espindola
9c3a9bf8aa
Make sure the STT_FILE symbol is the first one in the symbol table.
...
llvm-svn: 114285
2010-09-18 15:03:21 +00:00
Rafael Espindola
acd5bacfb9
Avoid relocations in a common case.
...
llvm-svn: 114229
2010-09-17 22:34:41 +00:00
Daniel Dunbar
ea0a5aee7b
Fix an MSVC warning.
...
llvm-svn: 114184
2010-09-17 16:34:24 +00:00
Daniel Dunbar
ed92665b19
MC/Mach-O/i386: Fix a crash in relocation handling.
...
llvm-svn: 114176
2010-09-17 15:21:50 +00:00
Daniel Dunbar
a43c86b354
MC/AsmParser: Add support for 'a + 4@GOTPCREL' and friends, by reconsing the
...
expression to include the modifier.
- Gross, but this a corner case we don't expect to see often in practice, but
it is worth accepting.
- Also improves diagnostics on invalid modifiers.
llvm-svn: 114154
2010-09-17 02:47:07 +00:00
Rafael Espindola
d542892fc0
Print the address of sections as 0 and create the metadata sections in the
...
same order as gnu as.
llvm-svn: 114109
2010-09-16 19:46:31 +00:00
Rafael Espindola
fa964e153e
Make sure that names like .note.GNU-stack are accepted as valid section names.
...
llvm-svn: 114091
2010-09-16 17:05:55 +00:00
Rafael Espindola
58aa9e8010
Add support for the .zero directive.
...
llvm-svn: 114077
2010-09-16 15:03:59 +00:00
Rafael Espindola
8a987c002e
Add a InitSections method to the streamer interface.
...
The ELF implementation now creates text, data and bss to match the gnu as
behavior.
The text streamer still has the old MachO specific behavior since
the testsuite checks that it will error when a directive is given
before a setting the current section for example.
A nice benefit is that -n is not required anymore when producing
ELF files.
llvm-svn: 114027
2010-09-15 21:48:40 +00:00
Michael J. Spencer
90f807fda5
Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."
...
This reverts commit r113632
Conflicts:
cmake/modules/AddLLVM.cmake
llvm-svn: 113819
2010-09-13 23:59:48 +00:00
Rafael Espindola
5b005d087c
Factoring and potential bug fix. The elf "flags" cannot be used as masks.
...
For example, setting STT_OBJECT (1) and STT_FUNC (2), should not produce
a STT_SECTION (3).
llvm-svn: 113759
2010-09-13 17:39:45 +00:00
Rafael Espindola
ce9b27497e
Add support for leb128 of absolute expressions.
...
llvm-svn: 113691
2010-09-11 16:45:15 +00:00
Chris Lattner
ffe1efe7ef
fix the asmparser so that the target is responsible for skipping to
...
the end of the line on a parser error, allowing skipping to happen
for syntactic errors but not for semantic errors. Before we would
miss emitting a diagnostic about the second line, because we skipped
it due to the semantic error on the first line:
foo %eax
bar %al
This fixes rdar://8414033 - llvm-mc ignores lines after an invalid instruction mnemonic errors
llvm-svn: 113688
2010-09-11 16:18:25 +00:00
Michael J. Spencer
98ad3f2ea7
CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.
...
llvm-svn: 113632
2010-09-10 21:14:25 +00:00
Daniel Dunbar
547563df12
llvm-mc: Don't crash when using -n and we see a directive before the initial section.
...
- This is annoying, because we have to scatter this check everywhere that could emit real data, but I see no better solution.
llvm-svn: 113552
2010-09-09 22:42:59 +00:00
Daniel Dunbar
07c0ca2a51
llvm-mc: Make sure we exit != 0 if any errors are encountered.
...
llvm-svn: 113551
2010-09-09 22:42:56 +00:00
Benjamin Kramer
7ca791ef4f
MCELF: Write relocation fragments in the right endian.
...
- This code is gross, but does the job for now.
llvm-svn: 113509
2010-09-09 18:01:29 +00:00
Roman Divacky
536c4ab8bd
Make ELF OS ABI dependent on the OS from target triple.
...
llvm-svn: 113508
2010-09-09 17:57:50 +00:00
Daniel Dunbar
8c7fe0e9d0
MC: Give a (lame) hard error if a .org directive would create an unreasonably
...
large object file (> 1GB).
llvm-svn: 113494
2010-09-09 16:23:33 +00:00
Roman Divacky
c0f16ab31a
ELF_STB_Local is 0 so setting and checking it must be done specially
...
llvm-svn: 113375
2010-09-08 18:08:40 +00:00
Roman Divacky
d56d1cd938
Unresolved weak symbols have value equal zero.
...
llvm-svn: 113358
2010-09-08 14:29:45 +00:00
Chris Lattner
0e0f9094e9
change the MC "ParseInstruction" interface to make it the
...
implementation's job to check for and lex the EndOfStatement
marker.
llvm-svn: 113347
2010-09-08 05:10:46 +00:00
Benjamin Kramer
2447226e73
MCELF: Align symtab, relocation sections and section headers properly. Patch by Krister Wombell.
...
llvm-svn: 113155
2010-09-06 16:11:52 +00:00
Bill Wendling
da6d7dd741
Get rid of "passing signed into unsigned parameter" warning on PPC.
...
llvm-svn: 112995
2010-09-03 19:09:46 +00:00
Benjamin Kramer
dd16ed1618
Add AsmParser support for the ELF .previous directive. Patch by Roman Divacky.
...
llvm-svn: 112849
2010-09-02 18:53:37 +00:00
Benjamin Kramer
4d2c506037
Allow MCSA_WeakRef in ELF. Patch by Roman Divacky.
...
llvm-svn: 112834
2010-09-02 17:18:32 +00:00
Devang Patel
bbbd35d042
Fix .debug_range for linux. Patch by Krister Wombell.
...
llvm-svn: 112830
2010-09-02 16:43:44 +00:00
Devang Patel
9e8ee9242f
Use absolute label for DW_AT_stmt_list if a target does not prefer offset here.
...
This patch was developed on top of original patch by Artur Pietrek.
llvm-svn: 112678
2010-08-31 23:50:19 +00:00
Kevin Enderby
cc1c9257f6
This is the second of three patches to implement support for the .loc directive
...
and output the dwarf line number tables. This takes the current loc info after
an instruction is assembled and saves the needed info into an object that has
vector and for each section. These objects will be used for the final patch to
build and emit the encoded dwarf line number tables. Again for now this is only
in the Mach-O streamer but at some point will move to a more generic place.
llvm-svn: 112668
2010-08-31 22:55:11 +00:00
Benjamin Kramer
3f8b8c1f5b
Allow creation of SHT_NULL sections, from Roman Divacky.
...
llvm-svn: 112605
2010-08-31 17:03:33 +00:00
Benjamin Kramer
6c5076f317
MCELF: The value of all common symbols is the offset from the start of the section. Patch by Roman Divacky.
...
llvm-svn: 112492
2010-08-30 17:20:17 +00:00
Benjamin Kramer
b540b09a7c
The value is offset from the start of the section for non-common symbols, submitted by Jordan Gordeev.
...
llvm-svn: 112473
2010-08-30 12:00:16 +00:00
Benjamin Kramer
ca65cc9222
Index external symbols by symbol table instead of parent section, by Roman Divacky.
...
llvm-svn: 112472
2010-08-30 11:59:29 +00:00
Benjamin Kramer
3aabb3eb53
Mark all common symbols external. This is not exactly correct but it lets apps
...
link for now and can be adjusted later. Patch by Roman Divacky.
llvm-svn: 112471
2010-08-30 11:56:55 +00:00
Chris Lattner
b2dbdbc795
squish dead code.
...
llvm-svn: 112350
2010-08-28 03:21:03 +00:00
Benjamin Kramer
f5c811611e
MCELF: Port EmitInstruction changes from MachO streamer. Patch by Roman Divacky.
...
llvm-svn: 112260
2010-08-27 10:40:51 +00:00
Benjamin Kramer
4e04c2e69f
MCELF: Always overwrite FixedValue.
...
llvm-svn: 112259
2010-08-27 10:38:39 +00:00
Benjamin Kramer
537450a5e8
MCELF: Fix a thinko of mine.
...
llvm-svn: 112203
2010-08-26 18:12:04 +00:00
Benjamin Kramer
a1f93ec939
MCELF: Compensate for the addend on i386. Patch by Roman Divacky, with some cleanups.
...
llvm-svn: 112197
2010-08-26 17:23:02 +00:00
Benjamin Kramer
ebee78319c
MCELF: Use precomputed symbol indices, patch by Roman Divacky.
...
llvm-svn: 112079
2010-08-25 20:09:43 +00:00
Michael J. Spencer
052ffacb48
MC: Fix inconsistant naming in COFF object writer. Patch by Cameron Esfahani.
...
llvm-svn: 112076
2010-08-25 19:27:27 +00:00
Kevin Enderby
bb121d1dc2
Change the parsing of .loc back to allow the LineNumber field to be optional as
...
it is with other assemblers.
llvm-svn: 111967
2010-08-24 21:14:47 +00:00
Michael J. Spencer
526e183800
Fix COFF x86-64 relocations. PR7960.
...
Multiple symbol reloc handling part of the patch by Cameron Esfahani.
llvm-svn: 111963
2010-08-24 21:04:52 +00:00
Kevin Enderby
024b04ad93
First bit of support for the dwarf .loc directive. This patch updates the
...
needed parsing for the .loc directive and saves the current info from that
into the context. The next patch will take the current loc info after an
instruction is assembled and save that info into a vector for each section for
use to build the line number tables. The patch after that will encode the info
from those vectors into the output file as the dwarf line tables.
llvm-svn: 111956
2010-08-24 20:32:42 +00:00
Daniel Dunbar
bd6901864b
MC/AsmParser: Change ParseExpression to use ParseIdentifier(), to support
...
dollars in identifiers.
llvm-svn: 111946
2010-08-24 19:13:42 +00:00
Daniel Dunbar
7859dfd71b
MC/Parser: Accept leading dollar signs in identifiers.
...
- Implemented by manually splicing the tokens. If this turns out to be
problematically platform specific, a more elegant solution would be to
implement some context dependent lexing support.
llvm-svn: 111934
2010-08-24 18:12:12 +00:00
Benjamin Kramer
958ba693b5
Relocate against parent if the symbol is not in section or it's a common symbol, from Roman Divacky.
...
llvm-svn: 111925
2010-08-24 17:34:39 +00:00
Chris Lattner
115fdde871
fix rdar://7997827 - Accept and ignore LL and ULL suffixes on integer literals.
...
Also fix 0b010 syntax to actually work while we're at it :-)
llvm-svn: 111876
2010-08-24 00:43:25 +00:00
Benjamin Kramer
b08a868783
Fix thinko. Having no tests is great ...
...
llvm-svn: 111848
2010-08-23 21:32:00 +00:00
Benjamin Kramer
005c0b532e
Reduce code duplication.
...
llvm-svn: 111846
2010-08-23 21:23:52 +00:00
Benjamin Kramer
8961d86d95
ELFObjectWriter: Run ComputeSymbolTable before recording relocations. This way we can use the information it has computed and don't have to recompute the same stuff over and over again.
...
llvm-svn: 111844
2010-08-23 21:19:37 +00:00
Benjamin Kramer
be1f37f512
Add the symbol offset to the relocation value when we relocate against section. By Roman Divacky.
...
llvm-svn: 111824
2010-08-23 19:05:46 +00:00
Benjamin Kramer
c67b87ec44
Use the proper relocation section + cleanup, from Roman Divacky.
...
llvm-svn: 111819
2010-08-23 18:24:20 +00:00
Michael J. Spencer
82f1603fa7
Revert part of my last commit. the mingw32 build bot doesn't seem to like it.
...
llvm-svn: 111793
2010-08-23 05:25:23 +00:00
Michael J. Spencer
c52ac23659
Workaround broken jump tables on x86-64 COFF.
...
llvm-svn: 111792
2010-08-23 04:45:37 +00:00
Michael J. Spencer
18689045ce
MC: Add partial x86-64 support to COFF.
...
llvm-svn: 111728
2010-08-21 05:58:13 +00:00
Benjamin Kramer
574b1a27b1
MCELF: Count the section orders properly. Patch by Roman Divacky.
...
llvm-svn: 111517
2010-08-19 13:44:49 +00:00
Daniel Dunbar
9ced206b3a
MC/ELF: Allow null values in virtual sections, ELF doesn't use special
...
directives for putting contents in .bss, for example.
llvm-svn: 111376
2010-08-18 18:22:37 +00:00
Benjamin Kramer
5756afebba
Remove dead code. Fixes a GCC warning.
...
llvm-svn: 111271
2010-08-17 19:45:05 +00:00
Benjamin Kramer
1e37b165c8
Sketch i386 relocations handling, from Roman Divacky.
...
Hello world builds & runs now on i386/ELF with -integrated-as.
llvm-svn: 111264
2010-08-17 18:20:28 +00:00
Benjamin Kramer
3bc7de0605
Use the correct entry size for relocation entries, from Roman Divacky.
...
llvm-svn: 111259
2010-08-17 17:56:13 +00:00
Benjamin Kramer
cc741eccfa
Differentiate between RELA and REL relocations, from Roman Divacky.
...
llvm-svn: 111252
2010-08-17 17:30:07 +00:00
Benjamin Kramer
2bf444b7d4
One baby step towards i386 ELF, from Roman Divacky.
...
llvm-svn: 111247
2010-08-17 17:02:29 +00:00
Benjamin Kramer
3acf387e2d
Try to silence a overeager GCC warning.
...
llvm-svn: 111214
2010-08-17 00:33:24 +00:00
Benjamin Kramer
41deb334b5
A round of minor cleanups for ELFObjectWriter.
...
llvm-svn: 111213
2010-08-17 00:00:46 +00:00
Benjamin Kramer
70e0faed21
Silence warnings and simplify code. Eliminate a 32/64 bit portability issue.
...
llvm-svn: 111201
2010-08-16 23:00:12 +00:00
Eli Friedman
39484fda25
Fixes for generation of ELF relocations. Patch by Roman Divacky.
...
llvm-svn: 111183
2010-08-16 21:17:09 +00:00
Eli Friedman
d2c0d2d0bb
Fix a few warnings in and detabify MCELFStreamer and ELFObjectWriter.
...
llvm-svn: 111175
2010-08-16 19:15:06 +00:00
Matt Fleming
8183e01389
Add ELF ObjectWriter and Streamer support.
...
I forgot to add these files in commit 111172.
llvm-svn: 111174
2010-08-16 18:57:57 +00:00
Matt Fleming
e381e308f2
Add ELF ObjectWriter and Streamer support.
...
llvm-svn: 111172
2010-08-16 18:35:43 +00:00
Matt Fleming
5fc461afc4
Layout helper function.
...
Introduce a helper method to add a section to the end of a layout. This
will be used by the ELF ObjectWriter code to add the metadata sections
(symbol table, etc) to the end of an object file.
llvm-svn: 111171
2010-08-16 18:35:06 +00:00
Matt Fleming
162726c305
Record a symbol's size which is needed for ELF symbol tables.
...
llvm-svn: 111170
2010-08-16 18:34:31 +00:00
Chris Lattner
e51188af11
silence a vc2010 warning: " result of 32-bit shift implicitly converted to
...
64 bits (was 64-bit shift intended?)", pointed out by 'nobled' on llvmdev
llvm-svn: 111148
2010-08-16 16:35:20 +00:00
Daniel Dunbar
f2b4982344
MC/AsmParser: Push the burdon of emitting diagnostics about unmatched
...
instructions onto the target specific parser, which can do a better job.
llvm-svn: 110889
2010-08-12 00:55:38 +00:00
Daniel Dunbar
4882ffc373
llvm-mc: Add -show-inst-operands, for dumping the parsed instruction representation before matching.
...
llvm-svn: 110791
2010-08-11 06:37:09 +00:00
Daniel Dunbar
ee80a239ed
MCAsmParser: Add dump() hook to MCParsedAsmOperand.
...
llvm-svn: 110790
2010-08-11 06:37:04 +00:00
Daniel Dunbar
f7233103ff
MC/AsmParser: Fix a bug in macro argument parsing, which was dropping
...
parentheses from argument lists.
llvm-svn: 110692
2010-08-10 17:38:52 +00:00
Michael J. Spencer
26a45fe57e
Revert "MC/MachO: Fix possible null pointer dereference."
...
This reverts commit 110575.
Target.isAbsolute() is true if SD would be null.
llvm-svn: 110683
2010-08-10 16:00:49 +00:00
Kevin Enderby
8303a64b0a
Next bit of support for the dwarf .file directive. This patch takes the
...
previously collected info from the .file directives and outputs the encoded
bytes for it. For now this is only in the Mach-O streamer but at some point
will move to a more generic place.
llvm-svn: 110617
2010-08-09 22:52:14 +00:00
Michael J. Spencer
72463de287
MC/MachO: Fix possible null pointer dereference.
...
Discovered by Microsoft Visual Studio 2010 Code Analysis.
llvm-svn: 110575
2010-08-09 15:28:05 +00:00
Michael J. Spencer
59bd7389a4
MC: Fix symbol fragment offsets in COFF.
...
Patch by Cameron Esfahani!
llvm-svn: 110104
2010-08-03 05:02:46 +00:00
Michael J. Spencer
135ecc4689
Revert "MC: Fix symbol fragment offsets in COFF."
...
This reverts commit r110100
Wrong path caps.
llvm-svn: 110103
2010-08-03 04:53:28 +00:00
Michael J. Spencer
6ff92fbc86
MC: Add time travel support to COFF.
...
llvm-svn: 110101
2010-08-03 04:43:33 +00:00
Michael J. Spencer
b9653145e4
MC: Fix symbol fragment offsets in COFF.
...
Patch by Cameron Esfahani!
llvm-svn: 110100
2010-08-03 04:43:24 +00:00
Daniel Dunbar
e0737ebae3
Silence some -Asserts uninitialized variable warnings.
...
llvm-svn: 109956
2010-07-31 21:08:54 +00:00
Michael J. Spencer
b52ff1ba41
Add relax all support to the COFF object streamer.
...
llvm-svn: 109947
2010-07-31 06:22:29 +00:00
Daniel Dunbar
19ee08da53
MC: Initialize MCFragment::Offset, noticed by Cameron Esfahani.
...
llvm-svn: 109875
2010-07-30 18:32:09 +00:00
Benjamin Kramer
d1340209a1
Plug the remaining MC leaks by giving MCObjectStreamer/MCAsmStreamer ownership of the TargetAsmBackend and the MCCodeEmitter.
...
llvm-svn: 109767
2010-07-29 17:48:06 +00:00
Benjamin Kramer
85d8649a9c
Stop leaking std::strings in GetDwarfFile.
...
llvm-svn: 109746
2010-07-29 13:53:19 +00:00
Benjamin Kramer
20e27bc59b
COFFObjectWriter: Don't leak COFFSymbols and COFFSections.
...
llvm-svn: 109745
2010-07-29 11:57:59 +00:00
Daniel Dunbar
7972ac4c88
MC: Destroy Macro instances.
...
llvm-svn: 109720
2010-07-29 01:51:55 +00:00
Kevin Enderby
3f202e65e8
Added first bit of support for the dwarf .file directive. This patch collects
...
the info from the .file directive and makes file and directory tables that
will eventually be put out as part of the dwarf info in the output file.
llvm-svn: 109651
2010-07-28 20:55:35 +00:00
Daniel Dunbar
1c35389c03
MC: Put back the MCFragment vtable, so subclasses are destroyed properly (duh).
...
llvm-svn: 109649
2010-07-28 20:28:45 +00:00
Douglas Gregor
8f3e666150
Fix format-specifier warning
...
llvm-svn: 109391
2010-07-26 03:55:44 +00:00
Michael J. Spencer
d061ee82ad
MC: Fix whitespace error from last commit.
...
A Visual C++ extension that removes trailing new lines? Seriously?
llvm-svn: 109390
2010-07-26 03:01:28 +00:00
Michael J. Spencer
9d96c92bde
MC: Add WinCOFFObjectWriter implementation.
...
Origonal Windows COFF implementation by Nathan Jedffords.
llvm-svn: 109389
2010-07-26 02:17:32 +00:00
Reid Kleckner
3a876ca187
Initial modifications to MCAssembler and TargetMachine for the MCJIT.
...
Patch by Olivier Meurant!
llvm-svn: 109080
2010-07-22 05:58:53 +00:00
Matt Fleming
d968913a7e
Add some more handlers for ELF section directives.
...
llvm-svn: 108928
2010-07-20 21:12:46 +00:00
Owen Anderson
302d0db7c2
Let's get those buildbots green: #include is needed in the header, not just the implementation.
...
llvm-svn: 108912
2010-07-20 20:16:11 +00:00
Chris Lattner
2acdd8ad4b
apparently also missing an include.
...
llvm-svn: 108908
2010-07-20 20:06:19 +00:00
Chris Lattner
a00e818ad9
this is in System
...
llvm-svn: 108895
2010-07-20 19:54:01 +00:00
Chris Lattner
d880fa4f2b
turn this into a normal header.
...
llvm-svn: 108891
2010-07-20 19:43:19 +00:00
Chris Lattner
4f8370727d
hopefully heal the linux builders
...
llvm-svn: 108890
2010-07-20 19:40:51 +00:00
Chris Lattner
32df8100f3
there is no reason to dynamically generate a static header.
...
llvm-svn: 108887
2010-07-20 18:59:58 +00:00
Chris Lattner
a004760c84
drop edinfo.inc into the objdir for src!=objdir builds.
...
llvm-svn: 108886
2010-07-20 18:53:27 +00:00
Eric Christopher
afecfd5c44
Update header.
...
llvm-svn: 108883
2010-07-20 18:46:43 +00:00
Chris Lattner
04a14f79da
hopefully teach cmake to build the .inc file.
...
llvm-svn: 108874
2010-07-20 18:33:21 +00:00
Chris Lattner
f5da80b271
cmake too
...
llvm-svn: 108872
2010-07-20 18:30:37 +00:00
Chris Lattner
51a1edf47f
forgot to add a file
...
llvm-svn: 108870
2010-07-20 18:29:50 +00:00
Chris Lattner
1ac58ea0f3
start straightening out libedis's dependencies and make it fit
...
better in the llvm world. Among other things, this changes:
1. The guts of libedis are now moved into lib/MC/MCDisassembler
2. llvm-mc now depends on lib/MC/MCDisassembler, not tools/edis,
so edis and mc don't have to be built in series.
3. lib/MC/MCDisassembler no longer depends on the C api, the C
API depends on it.
4. Various code cleanup changes.
There is still a lot to be done to make edis fit with the llvm
design, but this is an incremental step in the right direction.
llvm-svn: 108869
2010-07-20 18:25:19 +00:00
Daniel Dunbar
ee5365dc8b
MC/Mach-O: Silently ignore .file directives instead of error'ing out on
...
them. They aren't important enough to abort the entire assembly, and failing
early makes testing more annoying.
llvm-svn: 108747
2010-07-19 20:44:20 +00:00
Michael J. Spencer
7e18da0bce
_[A-Z] identifiers are reserved for the implementation.
...
llvm-svn: 108682
2010-07-19 06:26:19 +00:00
Michael J. Spencer
be36f07b08
MC: Add WinCOFFStreamer implementation and merge common code from MachO
...
into MCObjectStreamer.
Origonal Windows COFF implementation by Nathan Jedffords.
llvm-svn: 108678
2010-07-19 06:13:10 +00:00
Daniel Dunbar
f58b5d7ad0
TblGen/AsmMatcher: Add support for honoring instruction Requires<[]> attributes as part of the matcher.
...
- Currently includes a hack to limit ourselves to "In32BitMode" and "In64BitMode", because we don't have the other infrastructure to properly deal with setting SSE, etc. features on X86.
llvm-svn: 108677
2010-07-19 05:44:09 +00:00
Eli Friedman
5c629bb609
Make .align parse correctly on platforms where .align is measured in bytes.
...
llvm-svn: 108674
2010-07-19 04:17:25 +00:00
Daniel Dunbar
5b6b28e897
MC/AsmParser: Stop playing unsafe member function pointer calls, this isn't
...
portable enough.
- Downside is we now double dispatch through a stub function, but this isn't
performance critical.
llvm-svn: 108661
2010-07-18 22:22:07 +00:00
Daniel Dunbar
79350dba6e
MC/AsmParser: Fix .abort and .secure_log_unique to accept arbitrary token
...
sequences, not just strings.
llvm-svn: 108655
2010-07-18 20:15:59 +00:00
Daniel Dunbar
7d498fb3fc
MC/AsmParser: Add macro argument substitution support.
...
llvm-svn: 108654
2010-07-18 19:00:10 +00:00
Daniel Dunbar
312b5e0d2b
MC/AsmParser: Add basic support for macro instantiation.
...
llvm-svn: 108653
2010-07-18 18:54:11 +00:00
Daniel Dunbar
4ee82b993f
MC/AsmParser: Add basic parsing support for .macro definitions.
...
llvm-svn: 108652
2010-07-18 18:47:21 +00:00
Daniel Dunbar
44cddadb54
MC/AsmParser: Add .macros_{off,on} support, not that makes sense since we don't
...
support macros.
llvm-svn: 108649
2010-07-18 18:38:02 +00:00
Daniel Dunbar
cf14c09d6a
MC/AsmParser: Use Error() instead of calling PrintMessage() directly.
...
llvm-svn: 108648
2010-07-18 18:31:45 +00:00
Daniel Dunbar
2b388a1255
MC/AsmParser: Fix TokError() to accept a Twine.
...
llvm-svn: 108647
2010-07-18 18:31:42 +00:00
Daniel Dunbar
9a7d4a5dee
MC/AsmParser: Hide the AsmParser implementation.
...
llvm-svn: 108646
2010-07-18 18:31:38 +00:00
Eli Friedman
e0fd89f780
Start of .sleb128/.uleb128 parsing support.
...
llvm-svn: 108612
2010-07-17 06:27:28 +00:00
Eli Friedman
beee77c1c5
Work-in-progress parsing for ELF .section directive.
...
llvm-svn: 108609
2010-07-17 04:29:04 +00:00
Eli Friedman
e758dc641d
Add support for parsing .size directives for ELF.
...
llvm-svn: 108606
2010-07-17 03:09:18 +00:00
Daniel Dunbar
4dca88a1e9
MC/AsmParser: Lift Run() and TargetParser to base class.
...
Also, add constructor function for creating AsmParser instances.
llvm-svn: 108604
2010-07-17 02:26:10 +00:00
Chris Lattner
403b684f74
fix indentation and 80 cols
...
llvm-svn: 108460
2010-07-15 21:19:31 +00:00
Benjamin Kramer
da3e6cdb26
Don't pass StringRef by reference.
...
llvm-svn: 108366
2010-07-14 22:38:02 +00:00
Daniel Dunbar
6b7349fa24
MC/AsmParser: Move ELF specific parser to ELFAsmParser.cpp.
...
llvm-svn: 108196
2010-07-12 21:23:32 +00:00
Daniel Dunbar
cb36453016
MC/AsmParser: Move Darwin specific parse to DarwinAsmParser.cpp.
...
llvm-svn: 108193
2010-07-12 20:51:51 +00:00
Daniel Dunbar
9144ed1e2e
MC/AsmParser: Move .section parsing to Darwin specific parser.
...
llvm-svn: 108190
2010-07-12 20:42:34 +00:00
Daniel Dunbar
dea52ae42c
MC/AsmParser: Move special section directive parsing to Darwin specific parser.
...
llvm-svn: 108187
2010-07-12 20:23:36 +00:00
Daniel Dunbar
c02b92ed37
MC/AsmParser: Add a basic ELFAsmParser extension.
...
llvm-svn: 108185
2010-07-12 20:08:04 +00:00
Daniel Dunbar
f3e14374cb
MC/AsmParser: Inline AsmParser::CreateSymbol into callers.
...
llvm-svn: 108183
2010-07-12 19:52:10 +00:00
Daniel Dunbar
d1c2da9d0b
MC/AsmParser: Move .tbss and .zerofill parsing to Darwin specific parser.
...
llvm-svn: 108180
2010-07-12 19:37:35 +00:00
Daniel Dunbar
a1e5852feb
MC/AsmParser: Move .desc parsing to Darwin specific parser.
...
llvm-svn: 108179
2010-07-12 19:22:53 +00:00
Daniel Dunbar
212b42f5ec
MC/AsmParser: Move .lsym parsing to Darwin specific parser.
...
llvm-svn: 108176
2010-07-12 19:08:25 +00:00
Daniel Dunbar
50b931bbac
MC/AsmParser: Move some misc. Darwin directive handling to DarwinAsmParser.
...
llvm-svn: 108174
2010-07-12 18:49:22 +00:00
Daniel Dunbar
e3a98e546f
MC/AsmParser: Add a DarwinAsmParser extension.
...
- Currently initialization is a bit of a hack, but harmless. We need to rework
various parts of target initialization to clean this up.
llvm-svn: 108165
2010-07-12 18:12:02 +00:00
Daniel Dunbar
56e12eeae9
MC/AsmParser: Switch a bunch of directive parsing to use accessors.
...
llvm-svn: 108163
2010-07-12 18:03:11 +00:00
Daniel Dunbar
98d7990ac2
MCAsmParser: Pull some directive handling out into a helper class, and change
...
DirectiveMap to be based on MCAsmParserExtension.
llvm-svn: 108161
2010-07-12 17:54:38 +00:00
Daniel Dunbar
f93c614035
MC/AsmParser: Switch some directive parsing to use accessor methods.
...
llvm-svn: 108160
2010-07-12 17:45:27 +00:00
Daniel Dunbar
ffe3934e57
MC: Add MCAsmParserExtension, a base class for all the target/object specific
...
classes which want to extend the basic asm parser.
llvm-svn: 108158
2010-07-12 17:27:45 +00:00
Daniel Dunbar
fd54ea1239
MC: Move AsmParser::TokError to MCAsmParser().
...
llvm-svn: 108155
2010-07-12 17:18:45 +00:00
Daniel Dunbar
2be7d27677
MC: Move getLoc() to MCAsmLexer().
...
llvm-svn: 108154
2010-07-12 17:10:00 +00:00
Duncan Sands
f7b98e2b1e
Convert some tab stops into spaces.
...
llvm-svn: 108130
2010-07-12 08:16:59 +00:00
Chris Lattner
666bfc3ab5
introduce WinCOFFObjectWriter, patch by Michael Spencer!
...
llvm-svn: 108103
2010-07-11 22:07:02 +00:00
Chris Lattner
f2c1a57940
introduce WinCOFFStreamer.cpp, patch by Michael Spencer!
...
llvm-svn: 108102
2010-07-11 22:05:00 +00:00
Kevin Enderby
8a8d96b89c
Revert some unneeded parts of the change in r107886 for the
...
.weak_def_can_be_hidden directive. Chris pointed out that the MCAsmInfo.h/.cpp
chunks aren't needed for this until the compiler starts generating these. And
when that happens it will be more convenient for it to be a bool than a const
char*.
llvm-svn: 107906
2010-07-08 20:30:44 +00:00
Kevin Enderby
9bf8ee521c
Added the darwin .weak_def_can_be_hidden directive.
...
llvm-svn: 107886
2010-07-08 17:22:42 +00:00
Chris Lattner
155420f59f
finish up support for callw: PR7195
...
llvm-svn: 107826
2010-07-07 22:35:13 +00:00
Daniel Dunbar
742376cfaa
MC: Fix some stray hunks I didn't intend to commit.
...
llvm-svn: 107428
2010-07-01 20:48:51 +00:00
Daniel Dunbar
37b4089fbf
MC: Pass the target instance to the AsmParser constructor.
...
llvm-svn: 107426
2010-07-01 20:41:56 +00:00
Daniel Dunbar
769d88aa45
MC: Fix an error message.
...
llvm-svn: 107424
2010-07-01 20:20:01 +00:00
Daniel Dunbar
cc754e66c6
MC: Move COFF enumeration constants to llvm/Support/COFF.h, patch by Michael
...
Spencer!
llvm-svn: 107418
2010-07-01 20:07:24 +00:00
Bill Wendling
59ef9bcc6d
Revert r107205 and r107207.
...
llvm-svn: 107215
2010-06-29 22:34:52 +00:00
Bill Wendling
05a4c0b1f2
Introducing the "linker_weak" linkage type. This will be used for Objective-C
...
metadata types which should be marked as "weak", but which the linker will
remove upon final linkage. For example, the "objc_msgSend_fixup_alloc" symbol is
defined like this:
.globl l_objc_msgSend_fixup_alloc
.weak_definition l_objc_msgSend_fixup_alloc
.section __DATA, __objc_msgrefs, coalesced
.align 3
l_objc_msgSend_fixup_alloc:
.quad _objc_msgSend_fixup
.quad L_OBJC_METH_VAR_NAME_1
This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".
llvm-svn: 107205
2010-06-29 21:24:00 +00:00
Duncan Sands
84321cc550
The variable ValueSize is set to 1 on both code paths, and then
...
ignored! Remove it.
llvm-svn: 107138
2010-06-29 13:30:08 +00:00
Duncan Sands
5446bab8a5
The variable "Value" is carefully set to Layout.getSymbolAddress,
...
but then not actually used - maybe a bug? Remove the variable.
llvm-svn: 107137
2010-06-29 13:26:33 +00:00
Duncan Sands
78f0758143
Remove unused calls to Lexer.getLoc and the pointless variable HasFillExpr.
...
llvm-svn: 107136
2010-06-29 13:24:40 +00:00
Kevin Enderby
aaad4f57f0
Added the darwin .secure_log_unique and .secure_log_reset directives.
...
llvm-svn: 107077
2010-06-28 21:45:58 +00:00
Eric Christopher
0c4230b33c
Get the addend correct for i386 pic.
...
Thanks Daniel!
llvm-svn: 106608
2010-06-22 23:51:47 +00:00
Chris Lattner
dbea6d7acb
"This is just a cosmetic change in MCAsmStreamer.cpp/EmitSymbolAttribute: all attributes have now a \t before and after, as done for '.type'.
...
This makes the output look consistent, as well as help some third party assemblers expecting the attributes to be in the second column."
Patch by Arnaud de Grandmaison!
llvm-svn: 106469
2010-06-21 20:35:01 +00:00
Eric Christopher
b92292eb08
Update comment.
...
llvm-svn: 106191
2010-06-17 00:49:46 +00:00
Eric Christopher
9c56c0a851
In progress on 32-bit addends.
...
llvm-svn: 106154
2010-06-16 21:32:38 +00:00
Daniel Dunbar
15c2792d21
MC/Mach-O: Rewrite atom association to be a final pass we do in Finish(), instead of tracking as part of emission.
...
- This allows sharing more code with the MCObjectStreamer.
llvm-svn: 106143
2010-06-16 20:04:32 +00:00
Daniel Dunbar
2c6d6693e2
MC: Simplify MCAssembler::isSymbolLinkerVisible to only take an MCSymbol.
...
llvm-svn: 106142
2010-06-16 20:04:29 +00:00
Daniel Dunbar
7631ddfec4
MC: Lift SwitchSection() and Finish() into MCObjectStreamer.
...
llvm-svn: 106141
2010-06-16 20:04:25 +00:00
Daniel Dunbar
d52ca1c3e5
MC: Factor out an MCObjectStreamer class, which will be shared by the concrete
...
object file format writers.
llvm-svn: 106140
2010-06-16 20:04:22 +00:00
Eric Christopher
62a7f68562
Fix indentation.
...
llvm-svn: 106072
2010-06-16 00:26:36 +00:00
Eric Christopher
6c154dc98d
Some more work on mach-o TLV relocations.
...
llvm-svn: 106062
2010-06-15 22:59:05 +00:00
Dan Gohman
940f8f3947
Don't call flush() at a library level which isn't checking for errors
...
and doesn't know where the output is going.
llvm-svn: 105274
2010-06-01 16:31:34 +00:00
Eric Christopher
405e56fdfb
Rearrange conditionals so we don't get caught with the correct type as wrong.
...
llvm-svn: 104793
2010-05-27 00:52:31 +00:00
Daniel Dunbar
c53aec29c9
MC: When running with -mc-relax-all, we can eagerly relax instructions and avoid creating unnecessary MCInstFragments.
...
llvm-svn: 104736
2010-05-26 20:37:03 +00:00
Daniel Dunbar
46774d4abc
MC/Mach-O: Factor out EmitInstTo{Fragment,Data} for emitting MCInst's as MCInstFragments or appending onto an MCDataFragment.
...
llvm-svn: 104735
2010-05-26 20:37:00 +00:00
Daniel Dunbar
1b8e1aafae
MC: Change RelaxInstruction to only take the input and output instructions.
...
llvm-svn: 104713
2010-05-26 18:15:06 +00:00
Daniel Dunbar
7ab1807888
MC: Eliminate an unnecessary copy.
...
llvm-svn: 104709
2010-05-26 17:50:16 +00:00
Daniel Dunbar
77240e2337
MC: Simplify MayNeedRelaxation to not provide the fixups, so we can query it
...
before encoding.
llvm-svn: 104707
2010-05-26 17:45:29 +00:00
Daniel Dunbar
87dcbd1ee5
MC: Eliminate MCAsmFixup, replace with MCFixup.
...
llvm-svn: 104699
2010-05-26 15:18:56 +00:00
Daniel Dunbar
55c1bf55fe
MC: Use accessors for access to MCAsmFixup.
...
llvm-svn: 104697
2010-05-26 15:18:31 +00:00
Daniel Dunbar
f50c283a31
MC: Change MCInst::dump_pretty to not include a trailing newline.
...
llvm-svn: 104696
2010-05-26 15:18:13 +00:00
Daniel Dunbar
a06aa279f4
MC: Eliminate MCFragment vtable, which was unnecessary.
...
llvm-svn: 104689
2010-05-26 06:50:57 +00:00
Eric Christopher
371732bd2a
Start adding mach-o tls reloc support.
...
llvm-svn: 104651
2010-05-26 00:02:12 +00:00
Daniel Dunbar
5bef2f5031
llvm-mc: Use EmitIntValue where possible, which makes the API calls from the AsmParser and CodeGen line up better.
...
llvm-svn: 104467
2010-05-23 18:36:38 +00:00
Daniel Dunbar
e87e067d2c
llvm-mc: Use AddBlankLine in asm parser. This makes transliteration match the input much more closely, and also makes the API calls from the AsmParser and CodeGen line up better.
...
llvm-svn: 104466
2010-05-23 18:36:34 +00:00