Daniel Dunbar
b200f93125
MC/Mach-O: Update getSymbolAddress() to support evaluation of variables.
...
llvm-svn: 130522
2011-04-29 18:13:42 +00:00
Daniel Dunbar
29ba55cfe4
MC/Mach-O: Allow emission of relocations for variables in some more cases.
...
llvm-svn: 130520
2011-04-29 18:10:47 +00:00
Daniel Dunbar
b9c2b6c50d
MC/Mach-O: Find section ordinal's by looking at the symbol, instead of assuming they are present in a fragment.
...
llvm-svn: 130519
2011-04-29 18:07:43 +00:00
Devang Patel
124ae13421
Hoist MCLineEntry construction AsmPrinter so that anyone who derives from AsmPrinter can have line number entries.
...
PR 9810
llvm-svn: 130518
2011-04-29 18:00:54 +00:00
Daniel Dunbar
dc3e4cc5ed
MCExpr: Add FindAssociatedSection, which attempts to mirror the 'as' semantics
...
that associate sections with expressions.
llvm-svn: 130517
2011-04-29 18:00:03 +00:00
Daniel Dunbar
1bf128eaeb
MC/AsmParser: Generalize a check.
...
llvm-svn: 130515
2011-04-29 17:53:11 +00:00
Rafael Espindola
68067664c3
Last bit by bit compatibility patch to MCDwarf.cpp: If a FDE with no LSDA is
...
assigned to a CIE that requires one, just output a 0.
llvm-svn: 130472
2011-04-29 03:06:29 +00:00
Rafael Espindola
7c7151512c
Add an alternative implementation of CIE and FDE emission that outputs them
...
in the same order as the one in CodeGen.
llvm-svn: 130471
2011-04-29 02:42:28 +00:00
Rafael Espindola
6bd6a70837
Add the getExprForFDESymbol method that responsible for computing the
...
expressions used in the FDE to refer to symbols.
llvm-svn: 130437
2011-04-28 21:04:39 +00:00
Rafael Espindola
c5dac4df2e
Add a getExprForPersonalitySymbol method to MCAsmInfo. Use it when
...
converting the symbol passed to .cfi_personality into bytes is the file.
llvm-svn: 130400
2011-04-28 16:09:09 +00:00
Rafael Espindola
349c3298da
Mark the EH symbol global or weak if the corresponding function is.
...
llvm-svn: 130397
2011-04-28 12:50:37 +00:00
Rafael Espindola
2eeee8cfef
Add a small temporary hack for producing identical eh_frame sections on OS X.
...
This removes one of the main advantages of moving eh_frame to MC, but
makes the transition a lot easier to debug (run md5).
llvm-svn: 130379
2011-04-28 04:04:14 +00:00
Rafael Espindola
bf60fb0a37
Produce the EH_frame# symbols if needed.
...
llvm-svn: 130378
2011-04-28 03:26:11 +00:00
Rafael Espindola
96b07932a3
Forward isFunctionEHFrameSymbolPrivate. If it is false, produce the foo.eh
...
symbols.
llvm-svn: 130375
2011-04-28 02:46:42 +00:00
Rafael Espindola
27c0c9bb87
Factor a bit of code to MCStreamer::EmitLabel. Keep track of the last
...
non private symbol. This will be use for handling
foo:
.cfi_startproc
...
On OS X where we have to create a foo.eh symbol.
llvm-svn: 130305
2011-04-27 15:21:19 +00:00
Rafael Espindola
ae124da625
Force some values to be absolute and align based on the FDE pointers size. A small
...
step towards using .cfi_* on OS X.
llvm-svn: 130273
2011-04-27 01:43:49 +00:00
Rafael Espindola
3584ab6cc6
No relocation produces a SLEB or ULEB, make sure they are handled in MC.
...
llvm-svn: 130181
2011-04-26 02:17:58 +00:00
Sebastian Redl
1b86ea80bb
Give MC/MCDisassembler/Disassembler.h a header guard.
...
llvm-svn: 130096
2011-04-24 15:46:56 +00:00
Jay Foad
1a180156b6
Remove unused STL header includes.
...
llvm-svn: 130068
2011-04-23 19:53:52 +00:00
Chandler Carruth
bab81b9797
Delete the other unused variable in this function. Sorry I missed this
...
the first time through.
llvm-svn: 129969
2011-04-22 01:29:18 +00:00
Chandler Carruth
ea41470726
Remove an unused variable from a function. This is a likely cut-paste-o.
...
Silences GCC warning.
I wonder why Clang doesn't warn on this...
llvm-svn: 129968
2011-04-22 01:21:06 +00:00
Rafael Espindola
5395f44fe8
Compute the size of the FDE encoding instead of hard coding it. Update
...
X8664_ELFTargetObjectFile::getFDEEncoding to match reality.
llvm-svn: 129959
2011-04-22 00:08:43 +00:00
Rafael Espindola
6aea59268a
Remove unused argument.
...
llvm-svn: 129955
2011-04-21 23:39:26 +00:00
Rafael Espindola
ea61f22dd3
Don't pass address spaces to EmitULEB128IntValue.
...
llvm-svn: 129953
2011-04-21 23:26:40 +00:00
Rafael Espindola
c3dc486752
Fix relative relocations. This is sufficient for running the rust testsuite with
...
MC :-)
llvm-svn: 129923
2011-04-21 18:36:50 +00:00
Rafael Espindola
ed16477cb9
Behave like gnu as when a relocation crosses sections.
...
llvm-svn: 129850
2011-04-20 14:01:45 +00:00
Sean Callanan
d897f39797
Made the MC disassembler check before accessing
...
MCInst operands for ARM. This allows it to be
more tolerant of malformed MCInsts or incorrect
instruction metadata.
llvm-svn: 129840
2011-04-20 00:43:34 +00:00
Eli Friedman
b2545fbc2a
malloc elimination: it's a bad idea to use raw_svector_ostream on a
...
small heap-allocated SmallString because it unconditionally forces a malloc.
(Revised version of r129688, with the necessary flush() call.)
llvm-svn: 129716
2011-04-18 20:54:46 +00:00
Devang Patel
17740e70d5
Reduce clutter in asm output. Do not emit source location as comment for each instruction.
...
llvm-svn: 129715
2011-04-18 20:26:49 +00:00
Eli Friedman
3f8ecf5cc5
Revert r129688; it's breaking buildbots.
...
llvm-svn: 129689
2011-04-18 05:54:54 +00:00
Eli Friedman
2dc287a147
More malloc elimination: it's a bad idea to use raw_svector_ostream on a
...
small heap-allocated SmallString because it unconditionally forces a malloc.
llvm-svn: 129688
2011-04-18 05:38:58 +00:00
Eli Friedman
0e40208d7b
Make the StringMaps attached to MCContext use the MCContext's allocator;
...
reduces the number of calls to malloc().
llvm-svn: 129687
2011-04-18 05:02:31 +00:00
Chris Lattner
0ab5e2cded
Fix a ton of comment typos found by codespell. Patch by
...
Luis Felipe Strano Moraes!
llvm-svn: 129558
2011-04-15 05:18:47 +00:00
Rafael Espindola
539d96f01d
Be consistent about being virtual and returning void in the cfi methods.
...
Implement the ones that were missing in the asm streamer.
llvm-svn: 129413
2011-04-12 23:59:07 +00:00
Rafael Espindola
fd794affe5
Remove LastOffset from the asm parser.
...
llvm-svn: 129378
2011-04-12 18:53:30 +00:00
Rafael Espindola
1ec0f46169
Fix the case of a .cfi_rel_offset before any .cfi_def_cfa_offset.
...
llvm-svn: 129362
2011-04-12 16:12:03 +00:00
Rafael Espindola
2e1c9d2188
Implement .cfi_same_value.
...
llvm-svn: 129361
2011-04-12 15:31:05 +00:00
Eric Christopher
ffc0e1f6e6
Match case for invalid constant error messages and add a new
...
test for invalid hexadecimals.
llvm-svn: 129326
2011-04-12 00:18:03 +00:00
Eric Christopher
104af0619e
To avoid printing out multiple error messages for cases like:
...
.long 80+08
go ahead and assume that if we've got an Error token that we handled it
already. Otherwise if it's a token we can't handle then go ahead and
return the default error.
llvm-svn: 129322
2011-04-12 00:03:13 +00:00
Eric Christopher
64749f2a89
Lex, and then fail on invalid constants.
...
Testcase forthcoming.
rdar://8490596
llvm-svn: 129309
2011-04-11 22:24:56 +00:00
Rafael Espindola
82065cb6cf
Implement cfi_rel_offset
...
llvm-svn: 129306
2011-04-11 21:49:50 +00:00
Rafael Espindola
ffd2e5163b
implement .cfi_adjust_cfa_offset.
...
llvm-svn: 129296
2011-04-11 20:29:16 +00:00
Kevin Enderby
9377a52c12
Adding support for printing operands symbolically to llvm's public 'C'
...
disassembler API. Hooked this up to the ARM target so such tools as Darwin's
otool(1) can now print things like branch targets for example this:
blx _puts
instead of this:
blx #-36
And even print the expression encoded in the Mach-O relocation entried for
things like this:
movt r0, :upper16:((_foo-_bar)+1234)
llvm-svn: 129284
2011-04-11 18:08:50 +00:00
Benjamin Kramer
26e7768f38
Fix potential buffer overflow on win32.
...
llvm-svn: 129214
2011-04-09 14:06:12 +00:00
Benjamin Kramer
2b6c96b43d
Don't store Twine temporaries, it's not safe.
...
And don't append the name over and over again in the loop.
llvm-svn: 129210
2011-04-09 11:26:27 +00:00
Sean Callanan
1426351c83
Redirected errors from the AsmParser to the proper
...
error stream, in cases where the AsmParser is
being invoked by EDDisassembler. Before, they
were being sent to errs() because no error handler
was installed in the SourceMgr.
llvm-svn: 129177
2011-04-09 00:37:25 +00:00
Rafael Espindola
b80875edee
Micro optimization and improved similarity with gas' output:
...
When two section names share a suffix, reuse the entry in shstrtab.
llvm-svn: 129115
2011-04-07 23:21:52 +00:00
Rafael Espindola
88bc341061
Add support for .skip.
...
Patch by Roman Divacky.
Fixes PR9361.
llvm-svn: 129106
2011-04-07 20:26:23 +00:00
Sean Callanan
6c6be946fc
Fixed a bug where missing EDInstInfo would cause
...
tokenization to crash and burn.
llvm-svn: 129051
2011-04-07 01:56:01 +00:00
Shantonu Sen
e59f8ca49e
An MCDisassembler has the option to not implement
...
getEDInfo(), in which case this code would dereference
NULL. EDInst can already handle NULL info, so avoid
the dereference and pass NULL through.
Reviewed by Sean Callanan
llvm-svn: 128904
2011-04-05 18:40:45 +00:00
Kevin Enderby
5bbe957155
Added support symbolic floating point constants in the MC assembler for Infinity
...
and Nans with the same strings as GAS supports. rdar://8673024
llvm-svn: 128488
2011-03-29 21:11:52 +00:00
Francois Pichet
3cf622a832
Fix the MSVC build.
...
llvm-svn: 128441
2011-03-29 00:30:01 +00:00
Daniel Dunbar
4ee0d03274
MC: Add support for disabling "temporary label" behavior. Useful for debugging
...
on Darwin.
llvm-svn: 128430
2011-03-28 22:49:15 +00:00
Ted Kremenek
2d45693446
Unbreak CMake build.
...
llvm-svn: 128426
2011-03-28 20:43:53 +00:00
Kevin Enderby
f3070dc40d
Again adding a C API to the disassembler for use by such tools as Darwin's
...
otool(1), this time with the needed fix for case sensitive file systems :) .
This is a work in progress as the interface for producing symbolic operands is
not done. But a hacked prototype using information from the object file's
relocation entiries and replacing immediate operands with MCExpr's has been
shown to work with no changes to the instrucion printer. These APIs will be
moved into a dynamic library at some point.
llvm-svn: 128415
2011-03-28 18:25:07 +00:00
NAKAMURA Takumi
af66980d8a
Fix whitespace.
...
llvm-svn: 128370
2011-03-27 01:44:40 +00:00
Kevin Enderby
d077a857cc
Remove the files for r128308 as it is causing a buildbot failure.
...
llvm-svn: 128309
2011-03-26 00:23:05 +00:00
Kevin Enderby
c8b4078654
Adding a C API to the disassembler for use by such tools as Darwin's otool(1).
...
This is a work in progress as the interface for producing symbolic operands is
not done. But a hacked prototype using information from the object file's
relocation entiries and replacing immediate operands with MCExpr's has been
shown to work with no changes to the instrucion printer. These APIs will be
moved into a dynamic library at some point.
llvm-svn: 128308
2011-03-26 00:06:33 +00:00
Daniel Dunbar
6f4c9425eb
MC: Improve some diagnostics on uses of '.' pseudo-symbol.
...
llvm-svn: 128289
2011-03-25 17:47:17 +00:00
Daniel Dunbar
3f56104be1
Tidyness.
...
llvm-svn: 128288
2011-03-25 17:47:14 +00:00
Bruno Cardoso Lopes
f170f8bff6
Add asm parsing support w/ testcases for strex/ldrex family of instructions
...
llvm-svn: 128236
2011-03-24 21:04:58 +00:00
Jim Grosbach
a3df87fb01
Clean up assembly statement separator support.
...
The MC asm lexer wasn't honoring a non-default (anything but ';') statement
separator. Fix that, and generalize a bit to support multi-character
statement separators.
llvm-svn: 128227
2011-03-24 18:46:34 +00:00
Owen Anderson
ab234158b8
Fix a bug introduced by my patch yesterday: BL is a 4-byte instructions like BLX, rather than a 2-byte instruction like B.
...
llvm-svn: 128169
2011-03-23 21:19:56 +00:00
Owen Anderson
6149a34102
RIT_ARM_ThumbBranch32Bit relocations are not used and should never be generated.
...
This fixes kimwitu++, bullet, and tramp3dv4 with the ARM integrated assembler.
Fixes <rdar://problem/9165738>.
llvm-svn: 128117
2011-03-22 22:52:54 +00:00
Owen Anderson
9746286bec
Add support for Thumb interworking addresses for symbol offsets that get constant folded very early.
...
This fixes SPASS with -integrated-as. <rdar://problem/9165399>
llvm-svn: 128037
2011-03-21 23:13:43 +00:00
Bill Wendling
00f0cddfd4
We need to pass the TargetMachine object to the InstPrinter if we are printing
...
the alias of an InstAlias instead of the thing being aliased. Because we need to
know the features that are valid for an InstAlias.
This is part of a work-in-progress.
llvm-svn: 127986
2011-03-21 04:13:46 +00:00
Rafael Espindola
1557fd6d39
Write the section table and the section data in the same order that
...
gun as does. This makes it a lot easier to compare the output of both
as the addresses are now a lot closer.
llvm-svn: 127972
2011-03-20 18:44:20 +00:00
Stuart Hastings
12d5312622
Reapply 127939 since Daniel fixed the breakage. <rdar://problem/9012638>
...
llvm-svn: 127944
2011-03-19 02:42:31 +00:00
Stuart Hastings
08b4daa191
Revert 127939. <rdar://problem/9012638>
...
llvm-svn: 127943
2011-03-19 02:33:56 +00:00
Stuart Hastings
83d4a28d1f
Revise r126127 to address Daniel's comments. <rdar://problem/9012638>
...
llvm-svn: 127939
2011-03-19 01:32:01 +00:00
Daniel Dunbar
f1d62cfc8f
MC/Mach-O: Fix regression introduced in r126127, this assignment shouldn't have
...
been removed.
llvm-svn: 127812
2011-03-17 16:25:24 +00:00
Joerg Sonnenberger
07de07eeea
Fix handling of @IDNTPOFF relocations, they need to get STT_TLS.
...
While here, add VK_ARM_TPOFF and VK_ARM_GOTTPOFF, too.
llvm-svn: 127780
2011-03-17 00:35:10 +00:00
Duncan Sands
c2631d26c0
Silence compiler warning about case values not being in the enumerated type
...
MCFixupKind. This is the same technique that is used elsewhere in MC.
llvm-svn: 127676
2011-03-15 08:54:51 +00:00
Sean Callanan
47f660aeaf
Fixed the comparison operator for the enhanced
...
disassembler's disassembler map.
llvm-svn: 127527
2011-03-12 03:27:54 +00:00
Jan Sjödin
745fc89f62
Add constructors to MCElfStreamer and MCObjectStreamer to take an extra MCAssembler * argument.
...
llvm-svn: 127343
2011-03-09 17:33:05 +00:00
Jim Grosbach
14be61aeee
Darwin 'as' silently ignores the '.ident' directive.
...
llvm-svn: 127258
2011-03-08 19:17:19 +00:00
Anton Korobeynikov
e7410dd0d5
Preliminary support for ARM frame save directives emission via MI flags.
...
This is just very first approximation how the stuff should be done
(e.g. ARM-only for now). More to follow.
llvm-svn: 127101
2011-03-05 18:43:32 +00:00
Anton Korobeynikov
a7ec2dcefd
Some first rudimentary support for ARM EHABI: print exception table in "text mode".
...
llvm-svn: 127099
2011-03-05 18:43:15 +00:00
Joerg Sonnenberger
62f759791a
Be nice to Xcore and the XMOS assembler and avoid quoting section names
...
that contain only letters, digits and the characters "_" and ".".
llvm-svn: 127028
2011-03-04 20:03:14 +00:00
Joerg Sonnenberger
852ab890b5
Bug#9033: For the ELF assembler output, always quote the section name.
...
llvm-svn: 126963
2011-03-03 22:31:08 +00:00
Jan Sjödin
771911e28b
Split MCEELFStreamer and ELFObjectWriter into .h and .cpp files, so that other components can use them.
...
llvm-svn: 126942
2011-03-03 14:52:12 +00:00
Eli Friedman
d92d17bf67
PR9352: Always emit a relocation for weak symbols. Not emitting relocations
...
for calls to weak symbols with a definition has the appearance of working
with LLVM-generated code because weak symbol definitions are put in their
own sections.
llvm-svn: 126933
2011-03-03 07:24:36 +00:00
Oscar Fuentes
98a3c80a3e
Fixes warnings emitted by Visual Studio 2010 compiler.
...
Patch by Erik Olofsson!
llvm-svn: 126796
2011-03-01 23:11:57 +00:00
Jan Sjödin
30a52dec93
Make all static functions become static class methods. Move shared (duplicated) functions to new MCELF class.
...
llvm-svn: 126686
2011-02-28 21:45:04 +00:00
Cameron Zwarich
fcf51fd298
Roll out r126425 and r126450 to see if it fixes the failures on the buildbots.
...
llvm-svn: 126488
2011-02-25 16:30:32 +00:00
Joerg Sonnenberger
afb36fad99
Restore r125595 (reverted in r126336) with modifications:
...
Introduce a variable in the AsmParserExtension whether [] is valid in an
expression. If it is true, parse them like (). Enable this for ELF only.
llvm-svn: 126443
2011-02-24 21:59:22 +00:00
Devang Patel
b037383a35
Enable DebugInfo support for COFF object files.
...
Patch by Nathan Jeffords!
llvm-svn: 126425
2011-02-24 21:04:00 +00:00
Benjamin Kramer
c053644217
Plug some leaks in edis.
...
- Don't leak parsed operands during tokenization.
- Don't leak printed insts in llvm-mc.
llvm-svn: 126381
2011-02-24 11:03:19 +00:00
Jim Grosbach
0c03a3a146
Revert r125595, which is an X86-only undocumented assembly syntax extension
...
enabled for all targets. Non-X86 targets should not have this behavior
enabled by default.
Joerg, if you would like to resubmit with the behavior conditionalized to be
X86-ELF only, that's fine.
llvm-svn: 126336
2011-02-23 21:26:51 +00:00
Rafael Espindola
9e18e96264
Put in the symbol table symbols only used in a .globl statement.
...
Fixes PR9292.
llvm-svn: 126330
2011-02-23 20:22:07 +00:00
Sean Callanan
34770edf43
Fixed a bug in the enhanced disassembler that caused
...
it to ignore valid uses of FS and GS as additional
base registers in address computations. Added a test
case for this.
llvm-svn: 126302
2011-02-23 03:31:28 +00:00
Stuart Hastings
bf83659d11
Omit private_extern declarations of extern symbols; followup to
...
r124468. Patch by Rafael Avila de Espindola!
llvm-svn: 126297
2011-02-23 02:27:05 +00:00
Joerg Sonnenberger
4f864d3111
Bug#9172: Don't use static in file scope, use an attribute on the
...
parser.
llvm-svn: 126225
2011-02-22 16:53:11 +00:00
Joerg Sonnenberger
37d5484d18
Handle FK_PCRel_1 and add a test case for this and FK_PCRel_4.
...
llvm-svn: 126157
2011-02-21 23:25:41 +00:00
Stuart Hastings
d7927e0fcd
End the line if we return early. Radar 9012638.
...
llvm-svn: 126141
2011-02-21 21:07:07 +00:00
Stuart Hastings
b4863a41e9
Fix to correctly support attribute((section("__DATA, __common"))).
...
Radar 9012638.
llvm-svn: 126127
2011-02-21 17:27:17 +00:00
Joerg Sonnenberger
eef2f9009d
Use a vector of pairs to implement the section stack, not two
...
independent vectors.
llvm-svn: 126099
2011-02-21 01:07:42 +00:00
Rafael Espindola
f849bf81bd
Add some limited support for labels in org directives. Hopefully enough to fix
...
PR9245.
llvm-svn: 126091
2011-02-20 20:20:07 +00:00
Oscar Fuentes
5ed962656c
Move library stuff out of the toplevel CMakeLists.txt file.
...
llvm-svn: 125968
2011-02-18 22:06:14 +00:00
Rafael Espindola
490d02a334
Gas is very inconsistent about when a relaxation/relocation is needed. Do
...
the right thing and stop trying to copy it. Fixes PR8944.
llvm-svn: 125648
2011-02-16 03:25:55 +00:00