Jim Grosbach
d6ae4ba002
Darwin assembler improved relocs when w/o subsections_via_symbols.
...
When the file isn't being built with subsections-via-symbols, symbol
differences involving non-local symbols can be resolved more aggressively.
Needed for gas compatibility.
llvm-svn: 146054
2011-12-07 19:46:59 +00:00
Bruno Cardoso Lopes
61e6d987bf
Add a few moreLocal/Global R_MIPS_GOT related fixups and
...
make the addend fixup code a bit more generic
Patch by Jack Carter.
llvm-svn: 145998
2011-12-07 00:28:57 +00:00
Bill Wendling
efdd2f8fef
Re-enable compact unwind. It seems to work now. <rdar://problem/10441838>
...
llvm-svn: 145977
2011-12-06 22:18:12 +00:00
Bruno Cardoso Lopes
87cfffe149
Explicit symbols for gnu mimicing relocations. Patch by Jack Carter
...
llvm-svn: 145911
2011-12-06 03:34:42 +00:00
Jim Grosbach
25b63fa117
Move target-specific logic out of generic MCAssembler.
...
Whether a fixup needs relaxation for the associated instruction is a
target-specific function, as the FIXME indicated. Create a hook for that
and use it.
llvm-svn: 145881
2011-12-06 00:47:03 +00:00
Jim Grosbach
46be301c4c
Tidy up. Hard tabs.
...
llvm-svn: 145878
2011-12-06 00:13:09 +00:00
Jim Grosbach
18e2fe47fa
Switch MCAssembler to method names starting w/ lower-case.
...
per http://llvm.org/docs/CodingStandards.html#ll_naming
llvm-svn: 145873
2011-12-06 00:03:48 +00:00
Anton Korobeynikov
965e0c6de2
Emit the ctors in the proper order on ARM/EABI.
...
Maybe some targets should use this as well.
Patch by Evgeniy Stepanov!
llvm-svn: 145781
2011-12-03 23:49:37 +00:00
Daniel Dunbar
539d0a8a09
build/CMake: Finish removal of add_llvm_library_dependencies.
...
llvm-svn: 145420
2011-11-29 19:25:30 +00:00
Michael J. Spencer
de3a2118db
MC/X86/COFF: Allow quotes in names when targeting MS/Windows,
...
as MC is the only assembler we support.
This splits MS/Windows and GNU/Windows ASM infos into two seperate classes.
While there is currently only one difference, full MS C++ ABI support will
require many more.
llvm-svn: 145409
2011-11-29 18:00:06 +00:00
Bill Wendling
11b9894234
MachO doesn't support the protected visibility. Don't default to 'global' here. <rdar://problem/10396775>
...
llvm-svn: 145368
2011-11-29 02:39:58 +00:00
Jim Grosbach
ae9132207f
Better fix for ARM MOVT relocation encoding of thumb bit.
...
Replaces r145318 with a more targetted fix for the relocation handling.
llvm-svn: 145346
2011-11-29 01:15:25 +00:00
Daniel Dunbar
fe2d028ab1
build: Update CMakeLists.txt.
...
llvm-svn: 145341
2011-11-29 00:33:14 +00:00
Daniel Dunbar
b074d102a3
edis: Sink EDMain.cpp into lib/MC/MCDisassembler.
...
- This fixes some layering violations and matches how we handle the llvm-c lib,
for example.
llvm-svn: 145338
2011-11-29 00:25:57 +00:00
Jim Grosbach
30168fbde5
Thumb2 only force the fixup thumb bit for data relocations.
...
rdar://10493453
llvm-svn: 145318
2011-11-28 23:39:00 +00:00
Jim Grosbach
faa8efb482
Remove obsolete FIXME.
...
llvm-svn: 145313
2011-11-28 23:23:58 +00:00
Akira Hatanaka
f5ddf13f79
This patch addresses gp relative fixups/relocations for jump tables.
...
llvm-svn: 145112
2011-11-23 22:18:04 +00:00
Evan Cheng
ecb2908bf9
Sink codegen optimization level into MCCodeGenInfo along side relocation model
...
and code model. This eliminates the need to pass OptLevel flag all over the
place and makes it possible for any codegen pass to use this information.
llvm-svn: 144788
2011-11-16 08:38:26 +00:00
Akira Hatanaka
d519d8ca83
Remove function printMipsSymbolRef.
...
llvm-svn: 144663
2011-11-15 18:38:35 +00:00
Jim Grosbach
0dde349df1
Tidy up. 80 columns.
...
llvm-svn: 144649
2011-11-15 16:46:22 +00:00
Bob Wilson
8d1c7dbdff
Disable generation of compact unwind encodings. <rdar://problem/10441578>
...
This still seems to be causing some failures. It needs more testing before
it gets enabled again.
llvm-svn: 144543
2011-11-14 18:21:07 +00:00
Daniel Dunbar
52823cc91c
build: Attempt to rectify inconsistencies between CMake and LLVMBuild versions of explicit dependencies.
...
- The hope is that we have a tool/test to verify these are accurate (and tight) soon.
llvm-svn: 144444
2011-11-12 02:10:57 +00:00
Bob Wilson
c391f7ff64
Remove FIXME comment that should have been removed with r144351.
...
llvm-svn: 144392
2011-11-11 17:34:14 +00:00
Benjamin Kramer
f554228d82
Clients are responsible for initializing the targets, remove it from the disassembler API.
...
This will break users of the LLVMCreateDisasm API (not that I know of any). They have to call the
LLVMInitializeAll* functions from llvm-c/Target.h themselves now. edis' C API in all its horribleness
should be unaffected.
llvm-svn: 144385
2011-11-11 13:20:40 +00:00
Bill Wendling
70976ad9c2
Reenable compact unwinding now that <rdar://problem/10430076> is fixed.
...
llvm-svn: 144351
2011-11-11 01:03:50 +00:00
Bill Wendling
f311655e3f
Disable compact unwind generation until I can solve the codegen problems.
...
llvm-svn: 144346
2011-11-11 00:28:42 +00:00
Daniel Dunbar
b27317f7dd
build/MCDisassembler: Fix required libraries list of MCDisassembler to use
...
all-targets instead of an explicit list.
llvm-svn: 144320
2011-11-10 22:00:34 +00:00
Benjamin Kramer
6312682b46
Simplify code. No functionality change.
...
llvm-svn: 144186
2011-11-09 13:19:15 +00:00
Eric Christopher
5223a57533
Remove the pubnames section, no one consumes it.
...
llvm-svn: 144169
2011-11-09 05:24:07 +00:00
Bill Wendling
39674fc008
Emit the compact unwind *if* we have a compact unwind encoding.
...
*headdesk*
llvm-svn: 144138
2011-11-08 22:23:43 +00:00
Michael J. Spencer
5ca95bc56f
MC/COFF: Correctly emit the size of an empty string table.
...
llvm-svn: 144111
2011-11-08 19:52:32 +00:00
Benjamin Kramer
69d57cf9c4
Simplify some uses of utohexstr.
...
As a side effect hex is printed lowercase instead of uppercase now.
llvm-svn: 144013
2011-11-07 21:00:59 +00:00
Eric Christopher
4996c70034
Add the support code to enable the dwarf accelerator tables. Upcoming patches
...
to fix the types section (all types, not just global types), and testcases.
The code to do the final emission is disabled by default.
llvm-svn: 143923
2011-11-07 09:24:32 +00:00
Benjamin Kramer
20baffb257
Replace (Lower|Upper)caseString in favor of StringRef's newest methods.
...
llvm-svn: 143891
2011-11-06 20:37:06 +00:00
Benjamin Kramer
adc5b46782
Twinify.
...
llvm-svn: 143811
2011-11-05 13:11:25 +00:00
Benjamin Kramer
c74798d5cf
Add an option to pad an uleb128 to MCObjectWriter and remove the uleb128 encoding from the DWARF asm printer.
...
As a side effect we now print dwarf ulebs with .ascii directives.
llvm-svn: 143809
2011-11-05 11:52:44 +00:00
Bruno Cardoso Lopes
c9473e9809
Add mips ELF relocation types. Patch by Jack Carter!
...
llvm-svn: 143738
2011-11-04 22:24:36 +00:00
Daniel Dunbar
bf9bba47a1
build: Add initial cut at LLVMBuild.txt files.
...
llvm-svn: 143634
2011-11-03 18:53:17 +00:00
Kevin Enderby
60d8516857
Replace tabs I added in this new line of code with spaces.
...
Thanks to Nick for spotting this!
llvm-svn: 143556
2011-11-02 17:56:38 +00:00
Kevin Enderby
82ed3be1fb
Fixed a bug in the code to create a dwarf file and directory table entires when
...
it is separating the directory part from the basename of the FileName. Noticed
that this:
.file 1 "dir/foo"
when assembled got the two parts switched. Using the Mac OS X dwarfdump tool
it can be seen easily:
% dwarfdump -a a.out
include_directories[ 1] = 'foo'
Dir Mod Time File Len File Name
---- ---------- ---------- ---------------------------
file_names[ 1] 1 0x00000000 0x00000000 dir
...
Which should be:
...
include_directories[ 1] = 'dir'
Dir Mod Time File Len File Name
---- ---------- ---------- ---------------------------
file_names[ 1] 1 0x00000000 0x00000000 foo
llvm-svn: 143521
2011-11-01 23:39:05 +00:00
Kevin Enderby
6469fc275a
First part of support for generating dwarf for assembly source files with the
...
-g flag. In this part we generate the .file for the source being assembled and
the .loc's for the assembled instructions.
The next part will be to generate the dwarf Compile Unit DIE and a dwarf
subprogram DIE for each non-temporary label.
Once the next part is done test cases will be added. rdar://9275556
llvm-svn: 143509
2011-11-01 22:27:22 +00:00
Nick Lewycky
d59c0cac6c
Teach our Dwarf emission to use the string pool.
...
llvm-svn: 143097
2011-10-27 06:44:11 +00:00
Jim Grosbach
6485a7991d
Trailing whitespace.
...
llvm-svn: 143071
2011-10-26 22:44:41 +00:00
Nick Lewycky
1a62d78325
On an ELF system, ".debug_str" is mergeable and contains null terminated strings
...
composed of one byte characters.
llvm-svn: 143044
2011-10-26 18:44:32 +00:00
Bruno Cardoso Lopes
82b077ec22
This is the first of several patches for Mips direct object generation.
...
This first patch is for expression variable kinds.
Patch by Jack Carter!
llvm-svn: 142934
2011-10-25 18:13:20 +00:00
Rafael Espindola
e0d0908356
Fix parsing of a line with only a # in it.
...
llvm-svn: 142537
2011-10-19 18:48:52 +00:00
Nick Lewycky
40f8f2ff24
Add support for a new extension to the .file directive:
...
.file filenumber "directory" "filename"
This removes one join+split of the directory+filename in MC internals. Because
bitcode files have independent fields for directory and filenames in debug info,
this patch may change the .o files written by existing .bc files.
llvm-svn: 142300
2011-10-17 23:05:28 +00:00
Benjamin Kramer
cc863b2bb6
Let printf do the formatting instead aligning strings ourselves.
...
While at it, merge some format strings.
llvm-svn: 142140
2011-10-16 16:30:34 +00:00
Benjamin Kramer
1930b003fe
Add AsmToken::getEndLoc and use it to add ranges to x86 asm register parsing.
...
<stdin>:1:12: error: register %rax is only available in 64-bit mode
incl %rax
^~~~
llvm-svn: 142137
2011-10-16 12:10:27 +00:00
Benjamin Kramer
47f5e30e78
PR11143: Save the old diagnostic handler and call it when munging diagnostics for #line directives.
...
This reenables proper inline asm diagnostics in clang
llvm-svn: 142132
2011-10-16 10:48:29 +00:00
Chris Lattner
7284526aff
remove the dead 'ShowLine' argument from SMDiagnostic.
...
llvm-svn: 142108
2011-10-16 05:47:55 +00:00
Chris Lattner
03b80a4027
Make SMDiagnostic a little more sane. Instead of passing around note/warning/error as a
...
string, pass it around as an enum.
llvm-svn: 142107
2011-10-16 05:43:57 +00:00
Chris Lattner
a3a0681083
Enhance llvm::SourceMgr to support diagnostic ranges, the same way clang does. Enhance
...
the X86 asmparser to produce ranges in the one case that was annoying me, for example:
test.s:10:15: error: invalid operand for instruction
movl 0(%rax), 0(%edx)
^~~~~~~
It should be straight-forward to enhance filecheck, tblgen, and/or the .ll parser to use
ranges where appropriate if someone is interested.
llvm-svn: 142106
2011-10-16 04:47:35 +00:00
Owen Anderson
4a49dee221
Disable code/data region symbols on ELF targets, where different mapping symbols are used for ARM/Thumb mode code. This should only be re-enabled once we have a solution to properly distinguish these.
...
llvm-svn: 141984
2011-10-14 20:28:57 +00:00
Kevin Enderby
e7c0c499b8
Finish supporting cpp #file/line comments in assembler for error messages. So
...
for cpp pre-processed assembly we give correct filename and line numbers when
reporting errors in assembly files when using clang and -integrated-as on .s
files. rdar://8998895
llvm-svn: 141814
2011-10-12 21:38:39 +00:00
Nick Lewycky
f895efaa45
Hoist vector.size() computation out of the loop. No functionality change.
...
llvm-svn: 141807
2011-10-12 20:20:48 +00:00
Nick Lewycky
29e7b315ac
Also create a shndx even if there are no symbols. This lets us test
...
.symtab_shndx reading and writing together, and finally we have a testcase for
r141440.
llvm-svn: 141641
2011-10-11 03:54:50 +00:00
Owen Anderson
bed5504f5f
MCAtom extending methods need to extend the range of the atom as well.
...
llvm-svn: 141557
2011-10-10 18:09:38 +00:00
Nick Lewycky
133a16871f
Don't emit the symbol table entry for the .symtab_shndx section either.
...
llvm-svn: 141440
2011-10-07 23:29:53 +00:00
Nick Lewycky
c6ac5f7388
Remove extraneous curlies. No functionality change.
...
llvm-svn: 141439
2011-10-07 23:28:32 +00:00
Nick Lewycky
8b02d36a23
Don't emit a shstrtabindex in the reserved range. Spotted by inspection and
...
patch by Cary Coutant!
llvm-svn: 141413
2011-10-07 20:58:24 +00:00
Nick Lewycky
4eb1143038
Clarify/fix typo. No functionality change.
...
llvm-svn: 141412
2011-10-07 20:56:23 +00:00
Owen Anderson
0ca562ec4c
Teach the MC to output code/data region marker labels in MachO and ELF modes. These are used by disassemblers to provide better disassembly, particularly on targets like ARM Thumb that like to intermingle data in the TEXT segment.
...
llvm-svn: 141135
2011-10-04 23:26:17 +00:00
Kevin Enderby
5dcda64338
Adding back support for printing operands symbolically to ARM's new disassembler
...
using llvm's public 'C' disassembler API now including annotations.
Hooked this up to Darwin's otool(1) so it can again print things like branch
targets for example this:
blx _puts
instead of this:
blx #-36
and includes support for annotations for branches to symbol stubs like:
bl 0x40 @ symbol stub for: _puts
and annotations for pc relative loads like this:
ldr r3, #8 @ literal pool for: Hello, world!
Also again can print the expression encoded in the Mach-O relocation entries for
things like this:
movt r0, :upper16:((_foo-_bar)+1234)
llvm-svn: 141129
2011-10-04 22:44:48 +00:00
Akira Hatanaka
e67a10d54d
Add definition of MipsELFObjectWriter.
...
Patch by Reed Kotler at Mips Technologies.
llvm-svn: 140891
2011-09-30 21:55:40 +00:00
Benjamin Kramer
f550fa9173
Sort CMakeLists.txt.
...
llvm-svn: 140465
2011-09-24 22:06:35 +00:00
Eli Friedman
64a4bf1788
PR10989: Don't print .hidden on Windows.
...
llvm-svn: 140356
2011-09-23 00:13:02 +00:00
Owen Anderson
adea3f0c01
Add new files to CMake.
...
llvm-svn: 140352
2011-09-22 23:20:48 +00:00
Benjamin Kramer
fbf0fba9f4
Update CMake build.
...
llvm-svn: 140347
2011-09-22 22:38:34 +00:00
Owen Anderson
6cca67fc4a
Start stubbing out MCModule and MCAtom, which provide an API for accessing the rich disassembly of a complete object or executable.
...
These are very much a work in progress, and not really useful yet.
llvm-svn: 140345
2011-09-22 22:32:22 +00:00
Owen Anderson
69fa8ffeef
In the disassembler C API, be careful not to confuse the comment streamer that the disassembler outputs annotations on with the streamer that the InstPrinter will print them on.
...
llvm-svn: 140217
2011-09-21 00:25:23 +00:00
Benjamin Kramer
1223416411
MCInstrAnalysis: Don't crash on instructions with no operands.
...
llvm-svn: 140027
2011-09-19 17:56:00 +00:00
Owen Anderson
a0c3b97221
Don't attach annotations to MCInst's. Instead, have the disassembler return, and the printer accept, an annotation string which can be passed through if the client cares about annotations.
...
llvm-svn: 139876
2011-09-15 23:38:46 +00:00
Owen Anderson
233f130101
The the MC disassembler C API to print in verbose mode. Perhaps there should be a parameter to request verbose mode?
...
llvm-svn: 139821
2011-09-15 18:37:20 +00:00
Owen Anderson
d1814791ad
Add support for stored annotations to MCInst, and provide facilities for MC-based InstPrinters to print them out. Enhance the ARM and X86 InstPrinter's to do so in verbose mode.
...
llvm-svn: 139820
2011-09-15 18:36:29 +00:00
Jim Grosbach
ebdf32f907
Assmebler symbol attribute directives don't work on temporary symbols.
...
Assembler private local symbols aren't legal targets of symbol attributes,
so issue a diagnostic for them.
Based on patch by Stepan Dyatkovskiy.
llvm-svn: 139807
2011-09-15 17:56:49 +00:00
Jim Grosbach
a9aa3c18e3
Handle missing newline at EOF more gracefully in MC AsmLexer.
...
If we see an EOF w/o a preceding end-of-line, return an EndOfStatement
token before returning the Eof token.
Based on patch by Stepan Dyatkovskiy.
llvm-svn: 139798
2011-09-15 16:52:06 +00:00
Jim Grosbach
1daf07338c
Move state var to private class member.
...
llvm-svn: 139697
2011-09-14 16:37:04 +00:00
Kevin Enderby
7255361320
First step in supporting #line directives in assembler. This step parses the
...
#line directives with the needed support in the lexer. Next will be to build
a simple file/line# table mapping source SMLoc's for later use by diagnostics.
And the last step will be to get the diagnostics to use the mapping for file
and line numbers.
llvm-svn: 139669
2011-09-13 23:45:18 +00:00
Eric Christopher
460be996ce
Formatting and typo.
...
llvm-svn: 139325
2011-09-08 22:17:40 +00:00
Kevin Enderby
7b46bb8e32
Fix a Darwin x86_64 special case of a jmp to a temporary symbol from an atom
...
without a base symbol that must not have a relocation entry.
llvm-svn: 139316
2011-09-08 20:53:44 +00:00
James Molloy
4c493e8050
Refactor instprinter and mcdisassembler to take a SubtargetInfo. Add -mattr= handling to llvm-mc. Reviewed by Owen Anderson.
...
llvm-svn: 139237
2011-09-07 17:24:38 +00:00
Bill Wendling
9803abb788
As a first step, emit both the compact unwind and CIE/FDEs for a function.
...
llvm-svn: 139152
2011-09-06 18:37:11 +00:00
Duncan Sands
5c04c62765
Darwin wants ctors/dtors to be ordered the other way round to linux.
...
llvm-svn: 139015
2011-09-02 18:07:19 +00:00
Benjamin Kramer
6397051ece
Don't drop alignment info on local common symbols.
...
- On COFF the .lcomm directive has an alignment argument.
- On ELF we fall back to .local + .comm
Based on a patch by NAKAMURA Takumi.
Fixes PR9337, PR9483 and PR10128.
llvm-svn: 138976
2011-09-01 23:04:27 +00:00
James Molloy
5ada2a7e27
Fix apparent build error caused by r138948 on certain versions of GCC with -Werror. Sorry for the inconvenience.
...
llvm-svn: 138973
2011-09-01 22:01:14 +00:00
Nick Lewycky
2e2d75fb97
Fix the build for us -Werror users.
...
Remove broken emacs mode major notation marking a C++ file as C.
No functionality change.
llvm-svn: 138963
2011-09-01 21:09:04 +00:00
James Molloy
db4ce60328
Fix up r137380 based on post-commit review by Jim Grosbach.
...
llvm-svn: 138948
2011-09-01 18:02:14 +00:00
Jeffrey Yasskin
065c35726f
Fix C++0x narrowing errors when char is unsigned.
...
In the case of EDInstInfo, this would actually cause a bug when -1 became 255
and was then compared >=0 in llvm-mc/Disassembler.cpp.
llvm-svn: 138825
2011-08-30 20:53:29 +00:00
Bill Wendling
7113f221e2
Fix grammar, noticed by Duncan.
...
llvm-svn: 138764
2011-08-29 21:03:12 +00:00
Bill Wendling
ebab735788
Initialize CompactUnwindSection so that other targets won't use an uninitialized value.
...
llvm-svn: 138752
2011-08-29 18:25:59 +00:00
Benjamin Kramer
88e6d5945f
Initialize member variable.
...
llvm-svn: 138548
2011-08-25 04:04:18 +00:00
Evan Cheng
eee864520c
Some autoconf tests use module level inline asm to test compiler's handling of
...
.cfi_startproc. e.g. libffi:
$ cat confopt.c
asm (".cfi_startproc\n\t.cfi_endproc");
int main () { return 0; }
Teach MC / dwarf emission to handle these cfi directives which essentially
create an empty frame.
rdar://10017184
llvm-svn: 138504
2011-08-24 22:31:37 +00:00
Evan Cheng
2bb4035707
Move TargetRegistry and TargetSelect from Target to Support where they belong.
...
These are strictly utilities for registering targets and components.
llvm-svn: 138450
2011-08-24 18:08:43 +00:00
Jim Grosbach
bd16424f91
Fix AsmParser binary precedence for shift operators.
...
rdar://9976729
llvm-svn: 138208
2011-08-20 16:24:13 +00:00
Sean Callanan
7b3379be20
Fixed a memory bug in the MCDisassembler where
...
MCParsedAsmOperand objects were being leaked.
llvm-svn: 138053
2011-08-19 18:23:06 +00:00
Jim Grosbach
345768c9ff
Remove unused Target argument from AsmParser construction methods.
...
The argument is unused, and is a layering violation in any case.
llvm-svn: 137735
2011-08-16 18:33:49 +00:00
Benjamin Kramer
91ea511436
MachOWriter: Don't crash on fixups with arithmetic, emit a relocation instead. This matches what as does.
...
llvm-svn: 137414
2011-08-12 01:51:29 +00:00
Jim Grosbach
a317160348
Don't truncate MachO addresses.
...
Assigned symbol addresses get truncated to 32-bits, even on 64-bit platforms.
That's obviously bogus.
For example,
.globl _foo
.equ _foo, 0x987654321ULL
rdar://9922863
llvm-svn: 137158
2011-08-09 22:12:37 +00:00
Benjamin Kramer
1afd89ae36
Pacify virtual dtor warnings and cmake buildbots.
...
llvm-svn: 137060
2011-08-08 19:09:02 +00:00