Sean Callanan
cddf628d31
Modified MCAsmLexer to return error information upward
...
rather than printing it locally, reducing its dependence
on SourceMgr.
llvm-svn: 94041
2010-01-20 22:18:24 +00:00
Chris Lattner
6ea74a85bb
give createAsmStreamer an 'isLittleEndian' argument.
...
llvm-svn: 93986
2010-01-20 06:39:07 +00:00
Sean Callanan
4bb95fd7d6
Promoted the getTok() method to MCAsmParser so that
...
the two token accessor functions are declared consistently.
Modified the clients of MCAsmParser to reflect this change.
llvm-svn: 93916
2010-01-19 21:44:56 +00:00
Sean Callanan
985ff03e7d
Added a Lex function to the AsmParser, to allow handling
...
of include directives to occur within the parser itself.
This will break the lexer's dependency on a SourceMgr as
input.
llvm-svn: 93899
2010-01-19 20:22:31 +00:00
Chris Lattner
336c2b0d47
Generalize mcasmstreamer data emission APIs to take an address space
...
identifier. There is no way to work around it.
llvm-svn: 93896
2010-01-19 19:46:13 +00:00
Chris Lattner
f26d29e436
add a "MCStreamer::EmitFill" method, and move the default implementation
...
(which just iteratively emits bytes) to MCStreamer.
llvm-svn: 93888
2010-01-19 18:45:47 +00:00
Chris Lattner
dcd325e360
fix parsing .comm directives on systems which do not represent alignments
...
as a power of 2. This fixes MC/AsmParser/directive_comm.s
llvm-svn: 93867
2010-01-19 06:22:22 +00:00
Eli Friedman
45d605c120
Make opt -O3 act more like clang -O3 etc., by making the inlining thresholds
...
match.
llvm-svn: 93798
2010-01-18 22:38:31 +00:00
Chris Lattner
39532b939f
make llvm-config more portable to windows versions of perl,
...
patch by Michael Beck!
llvm-svn: 93793
2010-01-18 22:27:43 +00:00
Chris Lattner
57ac0be2b5
now that mangler is in libtarget, it can use MCAsmInfo instead of clients
...
having to pass various fields from it in. Simplify.
llvm-svn: 93686
2010-01-17 18:22:35 +00:00
Dan Gohman
5e3b993a86
Don't create a (empty) output file, and don't warn about bitcode output
...
to a console, when --analyze is used.
Similarly, avoid creating an empty output file when --disable-output is used.
Print a warning when the -o option appears with either --analyze or
--disable-output, to indicate that the option is being ignored.
llvm-svn: 93685
2010-01-17 17:47:24 +00:00
Chris Lattner
51e8abe640
move the mangler into libtarget from vmcore.
...
llvm-svn: 93664
2010-01-16 21:57:06 +00:00
Chris Lattner
6a28d54192
remove obsolete comment.
...
llvm-svn: 93661
2010-01-16 21:34:51 +00:00
Chris Lattner
98a02fecdc
bugpoint doesn't need the mangler at all. DisambiguateGlobalSymbols
...
dates to a time when two different LLVM values could have the same
name but different types. Simplify it to just assign names to unnamed
things and let the core symtab resolve duplicates.
llvm-svn: 93660
2010-01-16 21:34:01 +00:00
Chris Lattner
a6efa796b6
remove calls to dead methods.
...
llvm-svn: 93657
2010-01-16 21:20:34 +00:00
Chris Lattner
3202fba0ca
remove use of getMangledName.
...
llvm-svn: 93655
2010-01-16 20:56:05 +00:00
Chris Lattner
b8765fdca1
switch liblto to use the new getNameWithPrefix() method instead of getMangledName.
...
llvm-svn: 93643
2010-01-16 18:12:14 +00:00
Chris Lattner
d6b351119b
fix a bug in range information for $42, eliminate an
...
unneeded argument from ParseExpression.
llvm-svn: 93536
2010-01-15 19:39:23 +00:00
Chris Lattner
836cf5d129
extend MCAsmParser::ParseExpression and ParseParenExpression
...
to return range information for subexpressions. Use this to
provide range info for several new X86Operands.
llvm-svn: 93534
2010-01-15 19:28:38 +00:00
Nate Begeman
b6c8d75f62
Hook up llc's -filetype=obj to use MCStreamer if an MCCodeEmitter is available.
...
Remove most of old Mach-O Writer support, it has been replaced by MCMachOStreamer
Further refactoring to completely remove MachOWriter and drive the object file
writer with the AsmPrinter MCInst/MCSection logic is forthcoming.
llvm-svn: 93527
2010-01-15 18:51:18 +00:00
Chris Lattner
eceb54e9c2
add virtual methods to get the start/end of a MCParsedAsmOperand,
...
the default implementation returns "unknown".
llvm-svn: 93470
2010-01-14 22:29:57 +00:00
Chris Lattner
882cb240a6
Split the TargetAsmParser "ParseInstruction" interface in half:
...
the new ParseInstruction method just parses and returns a list of
target operands. A new MatchInstruction interface is used to
turn the operand list into an MCInst.
This requires new/deleting all the operands, but it also gives
targets the ability to use polymorphic operands if they want to.
llvm-svn: 93469
2010-01-14 22:21:20 +00:00
Chris Lattner
ceabb11a5e
prune #includes in TargetAsmParser.h
...
Pass in SMLoc of instr opcode into ParseInstruction.
Make AsmToken be a class, not a struct.
llvm-svn: 93457
2010-01-14 21:32:45 +00:00
Benjamin Kramer
cdbc36f961
Reimplement getToken and SplitString as "StringRef helper functions"
...
- getToken is modeled after StringRef::split but it can split on multiple
separator chars and skips leading seperators.
- SplitString is a StringRef::split variant for more than 2 elements with the
same behaviour as getToken.
llvm-svn: 93161
2010-01-11 18:03:24 +00:00
David Greene
4c591a29fd
Enable debug buffering.
...
llvm-svn: 92667
2010-01-05 01:30:32 +00:00
David Greene
a9aa7f2e15
Enable debug buffering.
...
llvm-svn: 92666
2010-01-05 01:30:21 +00:00
Mikhail Glushenkov
ebbb5dabd1
Forward -O0 to llvm-gcc.
...
llvm-svn: 92414
2010-01-02 08:27:23 +00:00
Mikhail Glushenkov
1768e877ec
Apparently, it is OK for -MT to be specified several times.
...
llvm-svn: 92413
2010-01-02 08:27:10 +00:00
Mikhail Glushenkov
82242fb2a8
Minor simplifactions.
...
llvm-svn: 92393
2010-01-01 04:41:10 +00:00
Mikhail Glushenkov
f697106fb7
Minor simplifications.
...
llvm-svn: 92390
2010-01-01 03:50:51 +00:00
Bill Wendling
5dcf84ad18
Mark some debug variables as 'unused' to quiet compiler and analyzer.
...
llvm-svn: 92183
2009-12-28 01:34:57 +00:00
Douglas Gregor
4d982f10b1
Fix another -Wmismatched-tags warning
...
llvm-svn: 92017
2009-12-23 18:27:13 +00:00
Douglas Gregor
c325f34d98
Fix struct/class mismatch for LTOModule and LTOCodeGenerator, detected by Clang
...
llvm-svn: 92004
2009-12-23 17:05:07 +00:00
Mikhail Glushenkov
ab0ecbe5b2
Make it easier to regenerate docs when srcdir != objdir.
...
llvm-svn: 92000
2009-12-23 12:50:03 +00:00
Mikhail Glushenkov
7db8203dd2
Allow (set_option SwitchOption, true).
...
llvm-svn: 91997
2009-12-23 12:49:30 +00:00
Chris Lattner
57141e5548
rename HexDisassembler -> Disassembler, it works on any input
...
integer encoding (0123, 0b10101, 42, etc).
llvm-svn: 91934
2009-12-22 22:50:29 +00:00
Chris Lattner
61d0911b3c
just discard the debug output from the disassembler.
...
llvm-svn: 91933
2009-12-22 22:47:43 +00:00
Chris Lattner
246541d5d8
specify what is invalid about it
...
llvm-svn: 91901
2009-12-22 07:03:21 +00:00
Chris Lattner
e9288e57d9
reject invalid input with a caret, e.g.:
...
simple-tests.txt:16:1: error: invalid instruction
0xff 0xff
^
llvm-svn: 91898
2009-12-22 06:58:29 +00:00
Chris Lattner
226e849772
various cleanups, make the disassemble reject lines with too much
...
data on them, for example:
addb %al, (%rax)
simple-tests.txt:11:5: error: excess data detected in input
0 0 0 0 0
^
llvm-svn: 91896
2009-12-22 06:56:51 +00:00
Chris Lattner
4d6e3ef4c0
If you thought that it didn't make sense for the disassembler
...
to not produce caret diagnostics, you were right!
llvm-svn: 91895
2009-12-22 06:45:48 +00:00
Chris Lattner
3b333ebfb8
rewrite the file parser for the disassembler, implementing support for
...
comments. Also, check in a simple testcase for the disassembler,
including a test for r91864
llvm-svn: 91894
2009-12-22 06:37:58 +00:00
Chris Lattner
1bc57b3a5f
don't crash on blank lines, rename some variables.
...
llvm-svn: 91892
2009-12-22 06:24:00 +00:00
Sanjiv Gupta
44441a9739
Adding a bunch of options to the mcc16 driver.
...
llvm-svn: 91776
2009-12-19 13:13:29 +00:00
Mikhail Glushenkov
40eeddfb23
Add a 'set_option' action for use in OptionPreprocessor.
...
llvm-svn: 91594
2009-12-17 07:49:16 +00:00
Chandler Carruth
e8571122ee
Update CMake build to include HexDisassembler.cpp.
...
llvm-svn: 91589
2009-12-17 06:35:17 +00:00
Sean Callanan
023fdbe1b6
Test harness for the LLVM disassembler. When invoked
...
with -disassemble, llvm-mc now accepts lines of the
form
0x00 0x00
and passes the resulting bytes to the disassembler for
the chosen (or default) target, printing the result.
llvm-svn: 91579
2009-12-17 01:49:59 +00:00
Mikhail Glushenkov
93c8d86be9
Validate the generated C++ code in llvmc tests.
...
Checks that the code generated by 'tblgen --emit-llvmc' can be actually
compiled. Also fixes two bugs found in this way:
- forward_transformed_value didn't work with non-list arguments
- cl::ZeroOrOne is now called cl::Optional
llvm-svn: 91404
2009-12-15 03:04:52 +00:00
Mikhail Glushenkov
febfe06f08
Small documentation update.
...
llvm-svn: 91401
2009-12-15 03:03:37 +00:00
Chris Lattner
26c6e3ba7d
when opt crashes, print its command line arguments as a pretty stack trace.
...
Somehow opt was missed when this was added.
llvm-svn: 90912
2009-12-09 00:41:28 +00:00
Mikhail Glushenkov
06a96a3bde
Documentation update.
...
llvm-svn: 90775
2009-12-07 18:26:11 +00:00
Mikhail Glushenkov
c05e105f51
Deprecate 'unpack_values'.
...
Use 'forward_values' + 'comma_separated' instead.
llvm-svn: 90774
2009-12-07 18:25:54 +00:00
Mikhail Glushenkov
a16a73e6c1
Pass '-msse' and friends to llc as '-mattr=+/-'.
...
llvm-svn: 90771
2009-12-07 17:03:21 +00:00
Mikhail Glushenkov
9e539d17d4
Forward -m32/-m64 to the linker.
...
llvm-svn: 90548
2009-12-04 06:38:45 +00:00
Mikhail Glushenkov
0d0b1af76f
Support -march/-mtune/-mcpu.
...
llvm-svn: 90547
2009-12-04 06:38:28 +00:00
Mikhail Glushenkov
bfde3ae3d4
Add relocation model options.
...
llvm-svn: 90222
2009-12-01 09:47:11 +00:00
Mikhail Glushenkov
3fd32f1269
Typo.
...
llvm-svn: 90221
2009-12-01 09:19:09 +00:00
Mikhail Glushenkov
00a1410d6d
Forward -save-temps to llvm-gcc.
...
llvm-svn: 90214
2009-12-01 06:51:30 +00:00
Mikhail Glushenkov
f30281e08a
Support -[weak_]framework and -F in llvmc.
...
llvm-svn: 90210
2009-12-01 05:59:55 +00:00
Tobias Grosser
74c7605daf
Remove ShortNames from getNodeLabel in DOTGraphTraits
...
llvm-svn: 90134
2009-11-30 12:38:47 +00:00
Tobias Grosser
48d8ba7043
Instantiate DefaultDOTGraphTraits
...
llvm-svn: 90133
2009-11-30 12:38:13 +00:00
Viktor Kutuzov
c0799914a1
Rollback changes r89516: Added two SubtargetFeatures::AddFeatures methods, which accept a comma-separated string or already parsed command line parameters as input, and some code re-factoring to use these new methods.
...
llvm-svn: 89893
2009-11-25 22:44:18 +00:00
Daniel Dunbar
7f52922e77
Add the rest of the build system logic for optional target disassemblers
...
llvm-svn: 89841
2009-11-25 04:46:58 +00:00
Viktor Kutuzov
ac8f027245
Added two SubtargetFeatures::AddFeatures methods, which accept a comma-separated string or already parsed command line parameters as input, and some code re-factoring to use these new methods.
...
llvm-svn: 89516
2009-11-21 00:00:02 +00:00
Mikhail Glushenkov
ce128851a3
Make example/Hello compile again.
...
llvm-svn: 89363
2009-11-19 17:29:25 +00:00
Viktor Kutuzov
036656936e
Added getDefaultSubtargetFeatures method to SubtargetFeatures class which returns a correct feature string for given triple.
...
llvm-svn: 89236
2009-11-18 20:20:05 +00:00
Viktor Kutuzov
1452b67541
Added getArchNameForAssembler method to the Triple class for which returns OS and Vendor independent target assembler arch.
...
llvm-svn: 89122
2009-11-17 18:48:27 +00:00
Duncan Sands
bfb85b9a67
Make bugpoint pass -load arguments to LLI. This lets one use bugpoint with
...
programs that depend on native shared libraries. Patch by Timo Lindfors.
llvm-svn: 89087
2009-11-17 10:20:22 +00:00
Benjamin Kramer
da70783da7
Add compare_lower and equals_lower methods to StringRef. Switch all users of
...
StringsEqualNoCase (from StringExtras.h) to it.
llvm-svn: 87020
2009-11-12 20:36:59 +00:00
Daniel Dunbar
656c9bf461
Stop running get_target_triple more than we need to.
...
llvm-svn: 86418
2009-11-07 23:52:20 +00:00
Kenneth Uildriks
e711736014
Make opt default to not adding a target data string and update tests that depend on target data to supply it within the test
...
llvm-svn: 85900
2009-11-03 15:29:06 +00:00
Nick Lewycky
6623dcf203
Line this up as well.
...
llvm-svn: 85748
2009-11-01 22:08:51 +00:00
Nick Lewycky
2f3164a81c
Fix whitespace.
...
llvm-svn: 85747
2009-11-01 22:07:54 +00:00
Douglas Gregor
16c6819959
Reverting 85714, 85715, 85716, which are breaking the build
...
llvm-svn: 85717
2009-11-01 16:42:53 +00:00
Dan Gohman
1d0b06c139
Remove the #include of Pass.h from PassManager.h. This breaks a significant
...
#include dependency, as frontends commonly pull in PassManager.h.
llvm-svn: 85714
2009-11-01 15:20:19 +00:00
Viktor Kutuzov
4da1a5215a
Fix to pass options from Gold plugin to LTO codegen
...
llvm-svn: 85419
2009-10-28 18:55:55 +00:00
Jeffrey Yasskin
5e379247c1
Revert the API changes from r85295 to make it easier for people to build
...
against both 2.6 and HEAD. The default is still changed to eager jitting.
llvm-svn: 85330
2009-10-27 22:39:42 +00:00
Jeffrey Yasskin
2d123f7740
Change the JIT to compile eagerly by default as agreed in
...
http://llvm.org/PR5184 , and beef up the comments to describe what both options
do and the risks of lazy compilation in the presence of threads.
llvm-svn: 85295
2009-10-27 20:30:28 +00:00
Chandler Carruth
766362c707
Move DataTypes.h to include/llvm/System, update all users. This breaks the last
...
direct inclusion edge from System to Support.
llvm-svn: 85086
2009-10-26 01:35:46 +00:00
Mikhail Glushenkov
5f133de5c2
Document OptionPreprocessor.
...
llvm-svn: 85030
2009-10-25 01:44:11 +00:00
Duncan Sands
728eebe8e2
Include config.h in order to have HAVE_STDINT_H be defined.
...
In the latest binutils the plugin-api.h needs this - without
it the LLVM gold plugin fails to compile.
llvm-svn: 84861
2009-10-22 16:03:32 +00:00
Chris Lattner
e38519a01a
llvm-ld doesn't throw.
...
llvm-svn: 84819
2009-10-22 00:52:28 +00:00
Chris Lattner
55ecceb5bf
this doesn't use EH either.
...
llvm-svn: 84818
2009-10-22 00:50:24 +00:00
Chris Lattner
824a67ab25
nothing opt uses can throw, remove the try block and -fexceptions when
...
building opt.
llvm-svn: 84816
2009-10-22 00:46:41 +00:00
Chris Lattner
381a6ff95c
Add some command line options for twiddling the default data layout
...
used by opt when a module doesn't specify one. Patch from Kenneth Uildriks!
llvm-svn: 84814
2009-10-22 00:44:10 +00:00
Sanjiv Gupta
021ed336bd
Added more options to mcc16 driver.
...
llvm-svn: 84752
2009-10-21 10:38:59 +00:00
Mikhail Glushenkov
f7fe2d2ea9
Clarify documentation on multi_val options.
...
llvm-svn: 84729
2009-10-21 02:13:52 +00:00
Jeffrey Yasskin
4ea1de7bcf
Delete the MacOSJITEventListener per echristo's request. It was disabled by
...
default and didn't work anyway.
llvm-svn: 84720
2009-10-21 00:43:48 +00:00
Mikhail Glushenkov
e29aaa858c
First draft of the OptionPreprocessor.
...
More to follow...
llvm-svn: 84352
2009-10-17 20:09:29 +00:00
Mikhail Glushenkov
887e9cde48
-O[0-3] options should be also forwarded to opt and llc.
...
This will require implementing OptionPreprocessor to forbid invalid invocations
such as 'llvmc -O1 -O2'.
llvm-svn: 84349
2009-10-17 20:07:49 +00:00
Daniel Dunbar
64f0182a28
llvm-as: Simplify, and don't create empty output files with -disable-output.
...
llvm-svn: 84304
2009-10-17 03:28:28 +00:00
Evan Cheng
96e3c797d1
Add a CodeGenOpt::Less level to match -O1. It'll be used by clients which do not want post-regalloc scheduling.
...
llvm-svn: 84272
2009-10-16 21:02:20 +00:00
Daniel Dunbar
022b59a0b5
MC: Remove unneeded context argument to MCExpr::Evaluate*.
...
llvm-svn: 84233
2009-10-16 01:57:52 +00:00
Daniel Dunbar
af3162e523
MC: Tweak variable assignment diagnostics, and make reassignment of non-absolute
...
variables and symbols invalid.
llvm-svn: 84232
2009-10-16 01:57:39 +00:00
Daniel Dunbar
a4df6e46a4
MC: When parsing a variable reference, substitute absolute variables immediately
...
since they are allowed to be redefined.
llvm-svn: 84230
2009-10-16 01:34:54 +00:00
Duncan Sands
08d519c2b7
There seems to be no reason for opt's -S option to be hidden.
...
Make it visible.
llvm-svn: 84127
2009-10-14 20:01:39 +00:00
Nick Lewycky
4c87d257a4
Fix Makefile to build correctly on Darwin. Patch by Sandeep Patel!
...
llvm-svn: 83813
2009-10-11 23:10:09 +00:00
Mikhail Glushenkov
a3577841cf
Slight rewording.
...
llvm-svn: 83620
2009-10-09 05:45:38 +00:00
Mikhail Glushenkov
1b7df9c598
Use llvm-as only for compiling .ll -> .bc.
...
llc can compile .ll files directly these days.
llvm-svn: 83618
2009-10-09 05:45:01 +00:00
Mikhail Glushenkov
289914c8d4
Unbreak the build.
...
Forgot about the need to reconfigure after modifying Base.td.in....
llvm-svn: 83529
2009-10-08 06:03:38 +00:00
Mikhail Glushenkov
337e15f9a7
Make the Base plugin understand -MF and -MT.
...
llvm-svn: 83525
2009-10-08 04:40:28 +00:00
Duncan Sands
2400ad7236
Introduce and use convenience methods for getting pointer types
...
where the element is of a basic builtin type. For example, to get
an i8* use getInt8PtrTy.
llvm-svn: 83379
2009-10-06 15:40:36 +00:00
Chris Lattner
1aa661ce46
remove llvm-db: it is completely broken and if anyone wants to do a debugger,
...
they should not base it on llvm-db (which not following almost any "best practices").
llvm-svn: 83288
2009-10-05 02:29:51 +00:00
Oscar Fuentes
eeafcc6fab
CMake: remove .so file extension from library names when building
...
dependency info.
Patch by Peter Collingbourne!
llvm-svn: 83275
2009-10-04 06:24:57 +00:00
Mikhail Glushenkov
b676fc15a0
Add a way to query the number of input files.
...
llvm-svn: 82957
2009-09-28 01:16:42 +00:00
Mikhail Glushenkov
251988b823
Document the 'not' combinator.
...
llvm-svn: 82956
2009-09-28 01:16:07 +00:00
Chris Lattner
4ab9414b7c
add a new DirectiveMap stringmap, which allows more efficient dispatching
...
to directive handlers and allows for easier extensibility.
I only switched a few over for now.
llvm-svn: 82926
2009-09-27 21:16:52 +00:00
Chris Lattner
80349d5875
avoid copying MCAsmInfo by value, add an (extremely low prio) fixme.
...
llvm-svn: 82911
2009-09-27 19:38:39 +00:00
Daniel Dunbar
827ef5a368
Make llvm-bcanalyzer percentages more readable.
...
llvm-svn: 82772
2009-09-25 16:04:21 +00:00
Daniel Dunbar
e963728182
Strip trailing whitespace.
...
llvm-svn: 82771
2009-09-25 16:03:57 +00:00
Duncan Sands
79ffac01fb
Print INST_INBOUNDS_GEP rather than UnknownCode30.
...
Likewise for constant inbounds GEP.
llvm-svn: 82763
2009-09-25 12:28:37 +00:00
Gabor Greif
ea0ff5468d
pretty mechanical changes to match coding guidelines (blessed by sabre on IRC)
...
llvm-svn: 82603
2009-09-23 02:46:12 +00:00
Daniel Dunbar
0ba272283d
Fix llvm-config --src-root and --obj-root for CMake builds.
...
llvm-svn: 82529
2009-09-22 06:09:31 +00:00
Daniel Dunbar
25f8e30355
llvm-config: Remove unused variables.
...
llvm-svn: 82528
2009-09-22 06:09:22 +00:00
Chris Lattner
f411f53f9c
Add an intel syntax MCInstPrinter implementation. You can now
...
transcode from AT&T to intel syntax with "llvm-mc foo.s -output-asm-variant=1"
llvm-svn: 82385
2009-09-20 07:17:49 +00:00
Nick Lewycky
3b7df4bbd5
Remove the default value for ConstantStruct::get's isPacked parameter and
...
update the code which was broken by this.
llvm-svn: 82327
2009-09-19 20:30:26 +00:00
Devang Patel
c195f74dee
Write and read metadata attachments.
...
llvm-svn: 82259
2009-09-18 19:26:43 +00:00
Dan Gohman
f289d3a1c9
Now that llc can read .ll files directly, teach it to recognize .ll as
...
an extension, so that the default output filename for foo.ll is foo.s,
not foo.ll.s
llvm-svn: 82071
2009-09-16 19:18:41 +00:00
Kevin Enderby
41b1d4288a
Fixed some problems with the logic of parsing line comments by adding
...
isAtStartOfComment and using that instead in two places where a loop
to check if the char was in MAI.getCommentString().
llvm-svn: 82059
2009-09-16 18:08:00 +00:00
Xerxes Ranby
d7ea8f55c2
Make cmake generated llvm-config output correct JIT backend for non X86 targets.
...
llvm-svn: 82049
2009-09-16 14:36:35 +00:00
Chris Lattner
fab7b49bb0
use an accessor to simplify code.
...
llvm-svn: 81997
2009-09-16 04:12:47 +00:00
Dan Gohman
98752b1ba2
Give llvm-link a -S option.
...
llvm-svn: 81859
2009-09-15 15:35:07 +00:00
Dan Gohman
5a8cf339b0
Don't bother using a PassManager just to print a Module.
...
llvm-svn: 81858
2009-09-15 15:33:42 +00:00
Chris Lattner
4a33f01892
Change MCAsmStreamer to take an MCInstPrinter instead of a
...
full AsmPrinter, and change TargetRegistry to keep track
of registered MCInstPrinters.
llvm-mc is still linking in the entire
target foo to get the code emitter stuff, but this is an
important step in the right direction.
llvm-svn: 81754
2009-09-14 03:02:37 +00:00
Dan Gohman
358e5c9bad
Convert llvm-link to IRReader.
...
llvm-svn: 81632
2009-09-12 21:55:12 +00:00
Douglas Gregor
adef81e26c
De-bork CMake build. llvm-extract depends on asmparser
...
llvm-svn: 81574
2009-09-11 21:26:24 +00:00
Dan Gohman
149ac38d37
Fix llvm-extract's "writing bitcode to a terminal" warning, which wasn't
...
working. To support this, add an is_displayed() function to raw_ostream,
and generalize Process::StandardOutIsDisplayed and friends in order to
support it.
Also, call RemoveFileOnSignal before creating a file instead of after, so
that the file isn't left behind if the program is interrupted between when
the file is created and RemoveFileOnSignal is called.
While here, add a -S to llvm-extract and port it to IRReader so that it
supports assembly input.
llvm-svn: 81568
2009-09-11 20:46:33 +00:00
Kevin Enderby
9f0fb453d8
Added the ParseInstruction() hook for target specific assembler directives so
...
that things like .word can be parsed as target specific. Moved parsing .word
out of AsmParser.cpp into X86AsmParser.cpp as it is 2 bytes on X86 and 4 bytes
for other targets that support the .word directive.
llvm-svn: 81461
2009-09-10 20:51:44 +00:00
Mikhail Glushenkov
77f3e5deee
Allow llvmc to take .bc files as input.
...
llvm-svn: 81452
2009-09-10 17:04:32 +00:00
Nuno Lopes
a79196d2a9
fix leakage of Module
...
llvm-svn: 81445
2009-09-10 14:56:31 +00:00
Daniel Dunbar
bae4e52bd0
MC: Give target specific parsers access to the MCStreamer.
...
llvm-svn: 81416
2009-09-10 00:59:15 +00:00
Daniel Dunbar
072b03693f
Add -output-prefix option to bugpoint (to change the default output name).
...
llvm-svn: 81154
2009-09-07 19:26:11 +00:00
Benjamin Kramer
38666b8c1c
Fix an integer truncation noticed by MSVC.
...
llvm-svn: 81109
2009-09-06 09:35:10 +00:00
Daniel Dunbar
9690cc9913
opt: Add -S option to print output as LLVM assembly.
...
llvm-svn: 81082
2009-09-05 11:34:53 +00:00
Kevin Enderby
8aeb8c1f8c
Added AsmToken enum constants to MCAsmLexer.h for '[', ']', '{', and '}' in
...
preparation of supporting other targets. Then changed the lexer to parse these
as tokens.
llvm-svn: 81050
2009-09-04 22:40:31 +00:00
Kevin Enderby
f697ad5e30
Added the AsmToken::Hash enum constant to MCAsmLexer.h in preparation of
...
supporting other targets. Changed the code to pass MCAsmInfo to the parser
and the lexer. Then changed the lexer to use CommentString from MCAsmInfo
instead of a literal '#' character.
llvm-svn: 81046
2009-09-04 21:45:34 +00:00
Kevin Enderby
5f29771ea2
Removed the non-target independent AsmToken::Register enum constant
...
from MCAsmLexer.h in preparation of supporting other targets. Changed the
X86AsmParser code to reflect this by removing AsmLexer::LexPercent and looking
for AsmToken::Percent when parsing in places that used AsmToken::Register.
Then changed X86ATTAsmParser::ParseRegister to parse out registers as an
AsmToken::Percent followed by an AsmToken::Identifier.
llvm-svn: 80929
2009-09-03 17:15:07 +00:00
Dan Gohman
3727dda74f
Make bugpoint use ParseIRFile instead of doing the same thing manually.
...
llvm-svn: 80927
2009-09-03 16:32:58 +00:00
Dan Gohman
7a60ef0f45
Use IRReader.h in opt, to support reading of LLVM Assembly files directly.
...
llvm-svn: 80922
2009-09-03 16:00:08 +00:00
Chris Lattner
344ada1f5e
TAI -> MAI
...
llvm-svn: 80899
2009-09-03 06:13:54 +00:00
Daniel Dunbar
92d6efefb4
Tweak comment.
...
llvm-svn: 80891
2009-09-03 05:47:22 +00:00
Douglas Gregor
d7f58a6cb0
Unbreak my CMake build. Say you'll link again.
...
llvm-svn: 80842
2009-09-02 22:45:31 +00:00
Dan Gohman
6ebdbf7f07
Switch llc from ParseBitcodeFile to ParseIRFile. This lets llc
...
transparently read either LLVM Assembly or LLVM Bitcode files.
llvm-svn: 80829
2009-09-02 19:35:19 +00:00
Daniel Dunbar
3a44b6da61
llvm-mc: Pass values to MCStreamer as MCExprs, not MCValues.
...
llvm-svn: 80578
2009-08-31 08:09:28 +00:00
Daniel Dunbar
b897e807c4
llvm-mc: Simplify EmitAssignment ('.set' is identical to '=').
...
llvm-svn: 80577
2009-08-31 08:09:09 +00:00
Daniel Dunbar
11035eeb11
llvm-mc: Remove MCAsmParser::Parse[Paren]RelocatableExpression.
...
llvm-svn: 80576
2009-08-31 08:08:50 +00:00
Daniel Dunbar
5fbaad8079
llvm-mc: Add MCAsmParser::Parse[Paren]Expression forms which return an MCExpr.
...
llvm-svn: 80574
2009-08-31 08:08:17 +00:00
Daniel Dunbar
22505125c8
llvm-mc: Add MCAsmParser::getContext.
...
llvm-svn: 80571
2009-08-31 08:07:44 +00:00
Daniel Dunbar
053a5f22a0
llvm-mc: Switch MCExpr construction to using static member functions, and taking the MCContext (which now owns all MCExprs).
...
llvm-svn: 80569
2009-08-31 08:07:22 +00:00
Daniel Dunbar
b882c70ff2
llvm-mc: Move AsmExpr into MC lib (as MCExpr).
...
llvm-svn: 80567
2009-08-31 08:06:59 +00:00
Chris Lattner
2081eaa21d
only print the override triple if it exists!
...
llvm-svn: 80534
2009-08-31 03:22:35 +00:00
Chris Lattner
085c521fe2
Fix some nasty callgraph dangling pointer problems in
...
argpromotion and structretpromote. Basically, when replacing
a function, they used the 'changeFunction' api which changes
the entry in the function map (and steals/reuses the callgraph
node).
This has some interesting effects: first, the problem is that it doesn't
update the "callee" edges in any callees of the function in the call graph.
Second, this covers for a major problem in all the CGSCC pass stuff, which
is that it is completely broken when functions are deleted if they *don't*
reuse a CGN. (there is a cute little fixme about this though :).
This patch changes the protocol that CGSCC passes must obey: now the CGSCC
pass manager copies the SCC and preincrements its iterator to avoid passes
invalidating it. This allows CGSCC passes to mutate the current SCC. However
multiple passes may be run on that SCC, so if passes do this, they are now
required to *update* the SCC to be current when they return.
Other less interesting parts of this patch are that it makes passes update
the CG more directly, eliminates changeFunction, and requires clients of
replaceCallSite to specify the new callee CGN if they are changing it.
llvm-svn: 80527
2009-08-31 00:19:58 +00:00
Daniel Dunbar
bc61205626
llvm-mc: MCStreamer cleanups. - Remove EmitLocalSymbol, this is unsupported for now.
...
- Switch Emit{CommonSymbol,Zerofill} to take alignment in bytes (for consistency).
llvm-svn: 80484
2009-08-30 06:17:16 +00:00
Andreas Neustifter
44bd609b7b
Since all std::cout is gone, also remove iostream include.
...
(See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090824/085620.html )
llvm-svn: 80349
2009-08-28 06:48:25 +00:00
Daniel Dunbar
09ed9fabde
llvm-mc: Emit .lcomm as .zerofill.
...
llvm-svn: 80343
2009-08-28 05:48:46 +00:00
Daniel Dunbar
42ad4294d0
llvm-mc: Unique zero fill sections.
...
llvm-svn: 80342
2009-08-28 05:48:29 +00:00
Daniel Dunbar
f0714ea058
Revert r80305, I forgot a dependent change.
...
--- Reverse-merging r80305 into '.':
U tools/llvm-mc/AsmParser.cpp
llvm-svn: 80309
2009-08-27 23:58:10 +00:00
Daniel Dunbar
2c48439750
llvm-mc: Unique sections in .zerofill.
...
llvm-svn: 80305
2009-08-27 23:45:06 +00:00
Benjamin Kramer
ad022f0b66
Inverse logic to increase portability.
...
llvm-svn: 80240
2009-08-27 12:02:34 +00:00
Sanjiv Gupta
4e396dbbb9
To make mcc16 run correctly on mac.
...
llvm-svn: 80239
2009-08-27 11:54:38 +00:00
Daniel Dunbar
e30a44267c
llvm-mc/Mach-O: Add MCCodeEmitter support, for encoding instructions.
...
- No relocations yet, of course.
llvm-svn: 80235
2009-08-27 08:17:51 +00:00
Daniel Dunbar
7e83346fd9
llvm-mc: Only show instruction encodings with --show-encoding.
...
llvm-svn: 80230
2009-08-27 07:56:39 +00:00
Daniel Dunbar
4316774ac1
llvm-mc: Tweak MCCodeEmitter skeleton.
...
llvm-svn: 80193
2009-08-27 01:34:22 +00:00
Daniel Dunbar
fd042a5019
Sketch TargetRegistry support for MCCodeEmitter abstract interface.
...
- Of course, nothing actually can provide this interface yet.
llvm-svn: 80188
2009-08-27 00:51:57 +00:00
Daniel Dunbar
f2e919b79e
llvm-mc/Mach-O: Unique sections properly, so we don't get duplicate text
...
sections, etc.
- The quick and dirty way, just clone the TargetLoweringObjectFile
code. Eventually this should be shared... somehow.
llvm-svn: 80168
2009-08-26 22:49:51 +00:00
Daniel Dunbar
1f70368155
llvm-mc/Mach-O: Don't put assembler temporary labels in the symbol table.
...
- I moved section creation back into AsmParser. I think policy decisions like
this should be pushed higher, not lower, when possible (in addition the
assembler has flags which change this behavior, for example).
llvm-svn: 80162
2009-08-26 22:13:22 +00:00
Daniel Dunbar
e1f51a4fed
llvm-mc: Make MCValue take const MCSymbol*s.
...
llvm-svn: 80078
2009-08-26 09:16:46 +00:00
Daniel Dunbar
a56aa7f5d6
llvm-mc: Make non-sensical max bytes to .align an error.
...
Also, warn about overflow in alignment values.
llvm-svn: 80077
2009-08-26 09:16:34 +00:00
Andreas Neustifter
c6a1a9ffec
Changed std::cout to outs(), retaining formating.
...
llvm-svn: 80076
2009-08-26 09:05:21 +00:00
Daniel Dunbar
521a3e3892
EXIT STAGE LEFT: gccas, gccld
...
llvm-svn: 80023
2009-08-25 20:21:09 +00:00
Dan Gohman
5f0f402eab
Delete some unnecessary flushes.
...
llvm-svn: 80013
2009-08-25 17:48:17 +00:00
Dan Gohman
53f0d68f87
Make LLVM command-line tools overwrite their output files without -f.
...
This is conventional command-line tool behavior. -f now just means
"enable binary output on terminals".
Add a -f option to llvm-extract and llvm-link, for consistency.
Remove F_Force from raw_fd_ostream and enable overwriting and
truncating by default. Introduce an F_Excl flag to permit users to
enable a failure when the file already exists. This flag is
currently unused.
Update Makefiles and documentation accordingly.
llvm-svn: 79990
2009-08-25 15:34:52 +00:00
Duncan Sands
dd8e4f488d
Fix the build when using gcc-4.4 on linux. Header needed
...
for stderr and fprintf.
llvm-svn: 79909
2009-08-24 10:59:01 +00:00
Chris Lattner
0c7ea3d3cc
remove the last *stream> #include from a public header.
...
llvm-svn: 79892
2009-08-24 04:14:03 +00:00
Dan Gohman
1d440b353e
These flushes were only needed when the code was transitioning between
...
std::cout and outs().
llvm-svn: 79891
2009-08-24 04:13:48 +00:00
Chris Lattner
39262eb119
prune the #includes in raw_ostream.h by moving a
...
member out of line. ftostr is not particularly speedy,
so that method is presumably not perf sensitive.
llvm-svn: 79885
2009-08-24 03:52:50 +00:00
Chris Lattner
3203639c35
Prune #includes from llvm/Linker.h and llvm/System/Path.h,
...
forcing them down into various .cpp files.
This change also:
1. Renames TimeValue::toString() and Path::toString() to ::str()
for similarity with the STL.
2. Removes all stream insertion support for sys::Path, forcing
clients to call .str().
3. Removes a use of Config/alloca.h from bugpoint, using smallvector
instead.
4. Weans llvm-db off <iostream>
sys::Path really needs to be gutted, but I don't have the desire to
do it at this point.
llvm-svn: 79869
2009-08-23 22:45:37 +00:00
Chris Lattner
d6a9cc484b
eliminate the ostream version of CheckBitcodeOutputToConsole,
...
change the raw_ostream one to take the raw_ostream byref instead
of byptr. Prune #includes, eliminate a use of Streams.h
llvm-svn: 79863
2009-08-23 21:36:09 +00:00
Chris Lattner
b0478019b4
eliminate the std::ostream forms of the bitcode writing APIs.
...
llvm-svn: 79840
2009-08-23 07:49:08 +00:00
Chris Lattner
0ac224bf1a
use raw_fd_ostream instead of fstream with graphwriter,
...
flush the right stream in opt.cpp.
llvm-svn: 79837
2009-08-23 07:31:22 +00:00
Chris Lattner
1c0452caeb
Change Pass::print to take a raw ostream instead of std::ostream,
...
update all code that this affects.
llvm-svn: 79830
2009-08-23 06:03:38 +00:00
Chris Lattner
8500c36f86
remove the std::ostream version of module and type printing.
...
llvm-svn: 79823
2009-08-23 04:52:46 +00:00
Chris Lattner
01dae858b6
eliminate the "Value" printing methods that print to a std::ostream.
...
This required converting a bunch of stuff off DOUT and other cleanups.
llvm-svn: 79819
2009-08-23 04:37:46 +00:00
Chris Lattner
1992ea13a1
simplify output file selection, fixing two FIXMEs about binary output
...
llvm-svn: 79808
2009-08-23 02:56:05 +00:00
Chris Lattner
f16d8ade4f
Change raw_fd_ostream to take flags as an optional bitmask
...
instead of as two bools. Use this to add a F_Append flag
which has the obvious behavior.
Other unrelated changes conflated into this patch:
1. REmove EH stuff from llvm-dis and llvm-as, the try blocks
are dead.
2. Simplify the filename inference code in llvm-as/llvm-dis,
because raw_fd_ostream does the right thing with '-'.
3. Switch machine verifier to use raw_ostream instead of ostream
(Which is the thing that needed append in the first place).
llvm-svn: 79807
2009-08-23 02:51:22 +00:00
Chris Lattner
5d8af49626
Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.
...
llvm-svn: 79763
2009-08-22 20:48:53 +00:00
Daniel Dunbar
2bb8df3b5d
llvm-mc: Clean up some handling of symbol/section association to be more correct
...
(external was really undefined and there wasn't an explicit representation for
absolute symbols).
- This still needs some cleanup to how the absolute "pseudo" section is dealt
with, but I haven't figured out the nicest approach yet.
llvm-svn: 79733
2009-08-22 07:22:36 +00:00
Eric Christopher
d24c28aef3
Make unit-at-a-time on by default to match the behavior of llvm-gcc.
...
llvm-svn: 79698
2009-08-21 23:30:30 +00:00
Daniel Dunbar
15dbbf3644
llvm-mc: Improve handling of implicit alignment for magic section directives
...
(e.g., .objc_message_refs).
- Just emit a .align when we see the directive; this isn't exactly what 'as'
does but in practice it should be ok, at least for now. See FIXME.
llvm-svn: 79697
2009-08-21 23:30:15 +00:00
Eric Christopher
63ce9dc3a8
Kill trailing whitespace.
...
llvm-svn: 79696
2009-08-21 23:29:40 +00:00
Daniel Dunbar
a64aa8d442
llvm-mc: In a .fill directive, still honor .align even if invalid maximum bytes
...
count is given (this matches 'as').
llvm-svn: 79683
2009-08-21 23:01:53 +00:00
Daniel Dunbar
fe93385495
llvm-mc: Accept .fill size of 8.
...
llvm-svn: 79635
2009-08-21 15:43:35 +00:00
Daniel Dunbar
7e81ff0f87
llvm-mc: Start MCAssembler and MCMachOStreamer.
...
- Together these form the (Mach-O) back end of the assembler.
- MCAssembler is the actual assembler backend, which is designed to have a
reasonable API. This will eventually grow to support multiple object file
implementations, but for now its Mach-O/i386 only.
- MCMachOStreamer adapts the MCStreamer "actions" API to the MCAssembler API,
e.g. converting the various directives into fragments, managing state like
the current section, and so on.
- llvm-mc will use the new backend via '-filetype=obj', which may eventually
be, but is not yet, since I hear that people like assemblers which actually
assemble.
- The only thing that works at the moment is changing sections. For the time
being I have a Python Mach-O dumping tool in test/scripts so this stuff can
be easily tested, eventually I expect to replace this with a real LLVM tool.
- More doxyments to come.
I assume that since this stuff doesn't touch any of the things which are part of
2.6 that it is ok to put this in not so long before the freeze, but if someone
objects let me know, I can pull it.
llvm-svn: 79612
2009-08-21 09:11:24 +00:00
Daniel Dunbar
d59019f7c8
llvm-mc: Various section parsing fixes.
...
- Add missing flags for various Objective-C sections.
- Fix names for [non_]lazy_symbol_pointer (these are misspelled in the manual).
- .symbol_stub does not have the self modifying code flag set (this appears to
be wrong in the manual?).
- Add implicit alignment values; not yet used.
Also, call MCStreamer::Finish at the end of a successful parse.
llvm-svn: 79611
2009-08-21 08:34:18 +00:00
Daniel Dunbar
090d824f0e
Don't install llvm-mc by default.
...
llvm-svn: 79604
2009-08-21 07:28:33 +00:00
Daniel Dunbar
1ea5a59505
Fix a commento.
...
llvm-svn: 79427
2009-08-19 16:25:53 +00:00
Benjamin Kramer
edbfae6370
Proper MSVC build fix (and remove my hack again). Patch by Yonggang Luo.
...
llvm-svn: 79418
2009-08-19 12:38:51 +00:00
Benjamin Kramer
deadf72086
Add a hack to unbreak MSVC builds. str(n)casecmp are POSIX functions and aren't available on windows (mingw defines them though).
...
llvm-svn: 79417
2009-08-19 12:16:17 +00:00
Nick Lewycky
6e6623b451
Include valgrind in the steps to reproduce if valgrind was used to reproduce
...
the problem.
llvm-svn: 79322
2009-08-18 06:08:01 +00:00
Chris Lattner
605e44a5b0
"-" should write to stdout, not stderr.
...
llvm-svn: 79310
2009-08-18 04:03:24 +00:00
Daniel Dunbar
fd368c900e
Change bugpoint to use Triple to make runtime decisions.
...
- This is cleaner, and makes bugpoint match the host instead of the build
architecture.
- Patch by Sandeep Patel!
llvm-svn: 79309
2009-08-18 03:35:57 +00:00
Anton Korobeynikov
c9d9a008b5
The attached patches attempt to fix cross builds. For example, if you
...
try to use i686-darwin to build for arm-eabi, you'll quickly run into
several false assumptions that the target OS must be the same as the
host OS. These patches split $(OS) into $(HOST_OS) and $(TARGET_OS) to
help builds like "make check" and the test-suite able to cross
compile. Along the way a target of *-unknown-eabi is defined as
"Freestanding" so that TARGET_OS checks have something to work with.
Patch by Sandeep Patel!
llvm-svn: 79296
2009-08-18 00:40:33 +00:00
Chris Lattner
69a19050c0
give MCAsmStreamer a TargetAsmInfo.
...
llvm-svn: 79222
2009-08-17 04:23:44 +00:00
Oscar Fuentes
3682d10c41
CMake: Discriminate MINGW, MSYS, CYGWIN: does not try to build llvm-config under mingw without msys.
...
llvm-svn: 79202
2009-08-16 20:50:41 +00:00
Daniel Dunbar
4990c2b03d
llvm-mc: Support escaped characters in string literals (for .ascii and .asciz)
...
llvm-svn: 79010
2009-08-14 18:19:52 +00:00
Oscar Fuentes
fc64077eb6
CMake: Automatic regeneration of the library dependencies file.
...
It doesn't stop or reconfigure the build, though, so the user will see
a broken build that magically succeeds at the next attempt. It is
technically possible to halt the build with a helpful message, and
even to automatically restart the build using the new dependencies as
it we did when llvm-config was used by cmake for learning
dependencies. This is left on the TODO list.
llvm-svn: 79004
2009-08-14 16:59:41 +00:00
Oscar Fuentes
26bad29667
CMake: propagate to the parent scope LLVM_COMMON_DEPENDS. This is
...
necessary for the changes being effective on the successive targets
llvm-svn: 78989
2009-08-14 04:29:33 +00:00
Daniel Dunbar
dc5840c57c
Update llvm-mc / MCAsmStreamer to print the instruction using the actual target
...
specific printer (this only works on x86, for now).
- This makes it possible to do some correctness checking of the parsing and
matching, since we can compare the results of 'as' on the original input, to
those of 'as' on the output from llvm-mc.
- In theory, we could now have an easy ATT -> Intel syntax converter. :)
llvm-svn: 78986
2009-08-14 03:48:55 +00:00
Daniel Dunbar
da9a46b9de
llvm-mc: Move MCAsmToken::getLoc() into MC library where it belongs.
...
llvm-svn: 78980
2009-08-14 02:18:40 +00:00
Oscar Fuentes
435d375f61
CMake: build llvm-config before the other tools.
...
llvm-svn: 78975
2009-08-14 01:55:05 +00:00
Owen Anderson
9df206d02d
Push LLVMContexts through the IntegerType APIs.
...
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Dan Gohman
e07ba37af7
Simplify this code so that it doesn't depend on raw_ostream being copyable.
...
llvm-svn: 78915
2009-08-13 16:51:51 +00:00
Daniel Dunbar
a94c1b2ee2
Update llvm-prof for ProfileInfo API changes.
...
- Patch by Erick Tryzelaar
llvm-svn: 78880
2009-08-13 01:55:43 +00:00
Dan Gohman
bc6b14ba00
This void is implicit in C++.
...
llvm-svn: 78848
2009-08-12 22:10:57 +00:00
Oscar Fuentes
cd0825dcd1
CMake: Localized dependency on Perl.
...
llvm-svn: 78788
2009-08-12 04:16:19 +00:00
Oscar Fuentes
9c8634650a
CMake: Re-enabled build of llvm-config. Removed recursive invocation
...
of cmake.
llvm-svn: 78768
2009-08-12 01:36:27 +00:00
Daniel Dunbar
d4f20f9186
llvm-mc: Fix a crash on invalid due to a typo in relocatable expression
...
evaluation.
llvm-svn: 78692
2009-08-11 17:47:52 +00:00
Benjamin Kramer
9a590500ea
Make LLVMContext and LLVMContextImpl classes instead of structs.
...
llvm-svn: 78690
2009-08-11 17:45:13 +00:00
Benjamin Kramer
4b3ed5a200
Silence MSVC warning.
...
llvm-svn: 78660
2009-08-11 11:01:19 +00:00
Daniel Dunbar
8b8ee45c05
llvm-mc: Accept .word as a synonym for .short
...
llvm-svn: 78641
2009-08-11 04:44:00 +00:00
Daniel Dunbar
712f6f40ed
llvm-mc: Honor -o option (and add -f).
...
llvm-svn: 78640
2009-08-11 04:34:48 +00:00
Daniel Dunbar
9c03cc13de
llvm-mc: Sketch parsing for .file, .line, and .loc. No streamer hooks for these
...
yet (I'm not even sure what they do).
llvm-svn: 78639
2009-08-11 04:24:50 +00:00
Daniel Dunbar
677e05c42d
llvm-mc: Fix darwin .section parsing. It was skipping the section name and a ','
...
(and outputting a diagnostic pointing at the wrong place), all of which lead to
much confusion.
llvm-svn: 78637
2009-08-11 03:42:33 +00:00
Jim Grosbach
c9a1dd9291
SjLj based exception handling unwinding support. This patch is nasty, brutish
...
and short. Well, it's kinda short. Definitely nasty and brutish.
The front-end generates the register/unregister calls into the SjLj runtime,
call-site indices and landing pad dispatch. The back end fills in the LSDA
with the call-site information provided by the front end. Catch blocks are
not yet implemented.
Built on Darwin and verified no llvm-core "make check" regressions.
llvm-svn: 78625
2009-08-11 00:09:57 +00:00
Chris Lattner
3e6da637f6
split MachO section handling stuff out to its out .h/.cpp file.
...
llvm-svn: 78576
2009-08-10 18:15:01 +00:00
Chris Lattner
f14da636ad
add a fixme
...
llvm-svn: 78575
2009-08-10 18:05:55 +00:00
Chris Lattner
7ee4b3a2c0
fix some warnings for the MSVC build, by Yonggang Luo!
...
llvm-svn: 78571
2009-08-10 17:35:42 +00:00
Chris Lattner
cc70d578be
Make the big switch: Change MCSectionMachO to represent a section *semantically*
...
instead of syntactically as a string. This means that it keeps track of the
segment, section, flags, etc directly and asmprints them in the right format.
This also includes parsing and validation support for llvm-mc and
"attribute(section)", so we should now start getting errors about invalid
section attributes from the compiler instead of the assembler on darwin.
Still todo:
1) Uniquing of darwin mcsections
2) Move all the Darwin stuff out to MCSectionMachO.[cpp|h]
3) there are a few FIXMEs, for example what is the syntax to get the
S_GB_ZEROFILL segment type?
llvm-svn: 78547
2009-08-10 01:39:42 +00:00
Chris Lattner
9e2c3aa666
sink the 'name' and 'isdirective' state out of MCSection into its derived classes.
...
This totally optimizes PIC16 sections by not having an 'isdirective' bit anymore!! ;-)
llvm-svn: 78517
2009-08-08 23:39:42 +00:00
Chris Lattner
f8ab7ad73a
switch this to create coff sections for now, it doesn't really matter for
...
llvm-mc's purpose yet and we'll want to switch to creating semantic sections
at some point.
llvm-svn: 78509
2009-08-08 22:38:48 +00:00
Daniel Dunbar
9d9f5741a8
Some ProfileInfo cleanups.
...
- Part of optimal static profiling patch sequence by Andreas Neustifter.
llvm-svn: 78485
2009-08-08 18:59:03 +00:00
Daniel Dunbar
87825212a4
More ProfileInfo improvements.
...
- Part of optimal static profiling patch sequence by Andreas Neustifter.
- Store edge, block, and function information separately for each functions
(instead of in one giant map).
- Return frequencies as double instead of int, and use a sentinel value for
missing information.
llvm-svn: 78477
2009-08-08 17:43:09 +00:00
Benjamin Kramer
1b44e6e359
Always initialize AsmConds.
...
llvm-svn: 78463
2009-08-08 11:26:50 +00:00
Kevin Enderby
dd20299f97
Added Mac OS X assembler style conditional assembly. I may come back and see if
...
I can clean this up a bit more and do way with the TheCondState and just use
the top element on the TheCondStack if not empty. Also may tweak the code
around ParseConditionalAssemblyDirectives() to simplify the AsmParser code.
llvm-svn: 78423
2009-08-07 22:46:00 +00:00
Daniel Dunbar
3123a37b69
MSVC warning fixes; patch by Stein Roger!
...
llvm-svn: 78405
2009-08-07 20:50:09 +00:00
Sanjiv Gupta
749f6d30d6
llvm-ld has a new option called -b to specify the name of bitcode output file, use that.
...
llvm-svn: 78282
2009-08-06 04:09:26 +00:00
Owen Anderson
3d0e1b855d
Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs.
...
llvm-svn: 78258
2009-08-05 23:16:16 +00:00
Daniel Dunbar
49dc5e993d
Make block and function count available via ProfileInfo.
...
- Part of optimal static profiling patch sequence by Andreas Neustifter.
llvm-svn: 78247
2009-08-05 21:51:16 +00:00
Dan Gohman
7cc0d1906c
Use (void *)(intptr_t) to cast function addresses to void*
...
for use with sys::Path::GetMainExecutable, to avoid warnings
with -pedantic.
llvm-svn: 78245
2009-08-05 21:03:39 +00:00
Dan Gohman
ba72f59923
Fix FindExecutable to use sys::Path::GetMainExecutable instead of
...
just argv[0]. And remove the code for searching the current
working directory and for searching PATH; the point of FindExecutable
is not to find whatever version of the executable can be found by
searching around, but to find an executable that accompanies the
current executable.
Update the tools to use sys::Program::FindProgramByName when they
want PATH searching.
llvm-svn: 78240
2009-08-05 20:21:17 +00:00
Daniel Dunbar
eabd825693
Remove unnecessary ProfileInfoLoader methods.
...
- Part of optimal static profiling patch sequence by Andreas Neustifter.
llvm-svn: 78199
2009-08-05 15:55:56 +00:00
Anton Korobeynikov
2a248f19bf
Pass user only if it's non-empty. Patch by Sandeep.
...
llvm-svn: 78184
2009-08-05 09:32:53 +00:00
Anton Korobeynikov
49930d2542
Add save-temps option to bugpoint to keep temporary stuff.
...
Patch by Sandeep Patel
llvm-svn: 78183
2009-08-05 09:32:10 +00:00
Dan Gohman
47a3558350
lli doesn't need <iostream> anymore.
...
llvm-svn: 78133
2009-08-05 00:28:59 +00:00
Owen Anderson
cf2c39dc30
Factor some of the constants+context related code out into a separate header, to make LLVMContextImpl.h
...
not hideous. Also, fix some MSVC compile errors.
llvm-svn: 78115
2009-08-04 22:41:48 +00:00
Daniel Dunbar
85d2406691
No really, it's unused.
...
llvm-svn: 78047
2009-08-04 04:08:40 +00:00
Daniel Dunbar
a96d5b360b
Provide target data from the module if the target machine doesn't have any.
...
llvm-svn: 77973
2009-08-03 17:34:19 +00:00
Nick Lewycky
51179612f2
Remove the GCC path from libLTO. This has been superceded by setAssemblerPath.
...
llvm-svn: 77960
2009-08-03 07:16:42 +00:00
Daniel Dunbar
2781e4bd89
Remove now unused arguments from TargetRegistry::lookupTarget.
...
llvm-svn: 77950
2009-08-03 04:20:57 +00:00
Daniel Dunbar
775da1948b
Pass target triple string in to TargetMachine constructor.
...
This is not just a matter of passing in the target triple from the module;
currently backends are making decisions based on the build and host
architecture. The goal is to migrate to making these decisions based off of the
triple (in conjunction with the feature string). Thus most clients pass in the
target triple, or the host triple if that is empty.
This has one important change in the way behavior of the JIT and llc.
For the JIT, it was previously selecting the Target based on the host
(naturally), but it was setting the target machine features based on the triple
from the module. Now it is setting the target machine features based on the
triple of the host.
For LLC, -march was previously only used to select the target, the target
machine features were initialized from the module's triple (which may have been
empty). Now the target triple is taken from the module, or the host's triple is
used if that is empty. Then the triple is adjusted to match -march.
The take away is that -march for llc is now used in conjunction with the host
triple to initialize the subtarget. If users want more deterministic behavior
from llc, they should use -mtriple, or set the triple in the input module.
llvm-svn: 77946
2009-08-03 04:03:51 +00:00