Commit Graph

2910 Commits

Author SHA1 Message Date
Andreas Neustifter 5155fc1b69 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 96abad185d llvm-mc: Emit .lcomm as .zerofill.
llvm-svn: 80343
2009-08-28 05:48:46 +00:00
Daniel Dunbar e48a69b2a3 llvm-mc: Unique zero fill sections.
llvm-svn: 80342
2009-08-28 05:48:29 +00:00
Daniel Dunbar 8d38b8d20c 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 ba33ff294e llvm-mc: Unique sections in .zerofill.
llvm-svn: 80305
2009-08-27 23:45:06 +00:00
Benjamin Kramer 53fd9f392d Inverse logic to increase portability.
llvm-svn: 80240
2009-08-27 12:02:34 +00:00
Sanjiv Gupta 99c20d1459 To make mcc16 run correctly on mac.
llvm-svn: 80239
2009-08-27 11:54:38 +00:00
Daniel Dunbar c7c5f9fa86 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 d18dd1d5f8 llvm-mc: Only show instruction encodings with --show-encoding.
llvm-svn: 80230
2009-08-27 07:56:39 +00:00
Daniel Dunbar 81cb753298 llvm-mc: Tweak MCCodeEmitter skeleton.
llvm-svn: 80193
2009-08-27 01:34:22 +00:00
Daniel Dunbar 65105174a6 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 4d7b2e3307 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 e73b267301 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 90398bd222 llvm-mc: Make MCValue take const MCSymbol*s.
llvm-svn: 80078
2009-08-26 09:16:46 +00:00
Daniel Dunbar 18f3c9b994 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 5f4e42ef9c Changed std::cout to outs(), retaining formating.
llvm-svn: 80076
2009-08-26 09:05:21 +00:00
Daniel Dunbar 4cf325e090 EXIT STAGE LEFT: gccas, gccld
llvm-svn: 80023
2009-08-25 20:21:09 +00:00
Dan Gohman 896ef2be35 Delete some unnecessary flushes.
llvm-svn: 80013
2009-08-25 17:48:17 +00:00
Dan Gohman 61a8796ddb 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 54dd438394 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 c143023bac remove the last *stream> #include from a public header.
llvm-svn: 79892
2009-08-24 04:14:03 +00:00
Dan Gohman 2ebc96ae95 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 06fa176862 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 c521f54198 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 b9f25f9e19 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 6973395cc7 eliminate the std::ostream forms of the bitcode writing APIs.
llvm-svn: 79840
2009-08-23 07:49:08 +00:00
Chris Lattner d04d9102ab 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 1362602eb2 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 3924bb5792 remove the std::ostream version of module and type printing.
llvm-svn: 79823
2009-08-23 04:52:46 +00:00
Chris Lattner b25de3ff60 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 abd1736998 simplify output file selection, fixing two FIXMEs about binary output
llvm-svn: 79808
2009-08-23 02:56:05 +00:00
Chris Lattner 9e6f1f160a 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 7b26fce23e Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.
llvm-svn: 79763
2009-08-22 20:48:53 +00:00
Daniel Dunbar 6860ac7375 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 c8f625b1eb 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 67dfb1de23 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 e64061f675 Kill trailing whitespace.
llvm-svn: 79696
2009-08-21 23:29:40 +00:00
Daniel Dunbar 4abcccb965 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 8e5edd81bb llvm-mc: Accept .fill size of 8.
llvm-svn: 79635
2009-08-21 15:43:35 +00:00
Daniel Dunbar 3016db39dd 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 9df5f33818 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 ad8b653f93 Don't install llvm-mc by default.
llvm-svn: 79604
2009-08-21 07:28:33 +00:00
Daniel Dunbar 5c947db79c Fix a commento.
llvm-svn: 79427
2009-08-19 16:25:53 +00:00
Benjamin Kramer 47f6943a95 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 9d908589d3 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 e6e82b8480 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 dd1db9cc81 "-" should write to stdout, not stderr.
llvm-svn: 79310
2009-08-18 04:03:24 +00:00
Daniel Dunbar 8575a60d33 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 90e17e787f 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 a61e93d4b5 give MCAsmStreamer a TargetAsmInfo.
llvm-svn: 79222
2009-08-17 04:23:44 +00:00
Oscar Fuentes 91bd6c922d 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 ef668c169b 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 1ea4b3a4b5 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 5444cb13ab 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 80d484e7cc 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 cbf4faf48d llvm-mc: Move MCAsmToken::getLoc() into MC library where it belongs.
llvm-svn: 78980
2009-08-14 02:18:40 +00:00
Oscar Fuentes 9082c71057 CMake: build llvm-config before the other tools.
llvm-svn: 78975
2009-08-14 01:55:05 +00:00
Owen Anderson 55f1c09e31 Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Dan Gohman 6dd7cb5dfe 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 7ee9649097 Update llvm-prof for ProfileInfo API changes.
- Patch by Erick Tryzelaar

llvm-svn: 78880
2009-08-13 01:55:43 +00:00
Dan Gohman 1432ef864e This void is implicit in C++.
llvm-svn: 78848
2009-08-12 22:10:57 +00:00
Oscar Fuentes 06eef1c2fe CMake: Localized dependency on Perl.
llvm-svn: 78788
2009-08-12 04:16:19 +00:00
Oscar Fuentes c1341ea9de 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 7f8a9ebc8d 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 78c3bcb582 Make LLVMContext and LLVMContextImpl classes instead of structs.
llvm-svn: 78690
2009-08-11 17:45:13 +00:00
Benjamin Kramer 6d78d69586 Silence MSVC warning.
llvm-svn: 78660
2009-08-11 11:01:19 +00:00
Daniel Dunbar ba95a7cd8d llvm-mc: Accept .word as a synonym for .short
llvm-svn: 78641
2009-08-11 04:44:00 +00:00
Daniel Dunbar cd4eee5443 llvm-mc: Honor -o option (and add -f).
llvm-svn: 78640
2009-08-11 04:34:48 +00:00
Daniel Dunbar a4b069ce00 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 9af747b421 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 693e36a3e8 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 6c20391d38 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 97189e5d04 add a fixme
llvm-svn: 78575
2009-08-10 18:05:55 +00:00
Chris Lattner 7b01bf6125 fix some warnings for the MSVC build, by Yonggang Luo!
llvm-svn: 78571
2009-08-10 17:35:42 +00:00
Chris Lattner cb307a27bf 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 591105c540 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 089b7de20d 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 2f140834cf 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 3b5008e23a 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 7641cf8e4d Always initialize AsmConds.
llvm-svn: 78463
2009-08-08 11:26:50 +00:00
Kevin Enderby d9f952948e 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 86ec7bae4f MSVC warning fixes; patch by Stein Roger!
llvm-svn: 78405
2009-08-07 20:50:09 +00:00
Sanjiv Gupta bdaaacad9a 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 03cb69fbd1 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 4f6f6d080f 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 198f5e84c6 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 46ffffa750 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 b6fec38426 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 0c3f8d5f53 Pass user only if it's non-empty. Patch by Sandeep.
llvm-svn: 78184
2009-08-05 09:32:53 +00:00
Anton Korobeynikov 7cbff91e62 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 b880939834 lli doesn't need <iostream> anymore.
llvm-svn: 78133
2009-08-05 00:28:59 +00:00
Owen Anderson afd0c4cd56 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 ad9a6c4855 No really, it's unused.
llvm-svn: 78047
2009-08-04 04:08:40 +00:00
Daniel Dunbar c0deed3263 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 129bb4165f 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 719d235520 Remove now unused arguments from TargetRegistry::lookupTarget.
llvm-svn: 77950
2009-08-03 04:20:57 +00:00
Daniel Dunbar 0f16ea5c30 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
Chris Lattner 73d577c933 Make SectionKind::get() private.
llvm-svn: 77835
2009-08-02 00:02:44 +00:00
Chris Lattner a61c05adc0 update for API change.
llvm-svn: 77804
2009-08-01 21:14:30 +00:00
Chris Lattner 95bad379a9 All MCSections are now required to have a SectionKind.
llvm-svn: 77787
2009-08-01 18:25:49 +00:00
Daniel Dunbar c54ecb384d llvm-mc: More quoted identifier support.
llvm-svn: 77761
2009-08-01 00:48:30 +00:00
Daniel Dunbar 9ee33ca28e llvm-mc: Support quoted identifiers.
- Uses MCAsmToken::getIdentifier which returns the (sub)string representing the
   meaningfull contents a string or identifier token.

 - Directives aren't done yet.

llvm-svn: 77739
2009-07-31 21:55:09 +00:00
Owen Anderson 5a1acd9912 Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.

llvm-svn: 77721
2009-07-31 20:28:14 +00:00
Chris Lattner 4b21d044a4 fix some more issues where we expected GetSection to do "get or create"
llvm-svn: 77700
2009-07-31 18:27:48 +00:00
Chris Lattner 0f5a6fc38b fix a bunch of failing tests now that MCContext::GetSection doesn't create sections.
llvm-svn: 77689
2009-07-31 17:47:16 +00:00
Owen Anderson b292b8ce70 Move more code back to 2.5 APIs.
llvm-svn: 77635
2009-07-30 23:03:37 +00:00
Devang Patel 5ac2f49516 Handle NamedMDNode.
llvm-svn: 77633
2009-07-30 23:03:19 +00:00
Owen Anderson 4056ca9568 Move types back to the 2.5 API.
llvm-svn: 77516
2009-07-29 22:17:13 +00:00
Owen Anderson 487375e9a2 Move ConstantExpr to 2.5 API.
llvm-svn: 77494
2009-07-29 18:55:55 +00:00
David Goodwin 2c04ff6402 Add a bugpoint flag to disable block extraction.
llvm-svn: 77389
2009-07-28 23:08:36 +00:00
Daniel Dunbar fdbad74423 Update CMakeLists
llvm-svn: 77385
2009-07-28 22:46:39 +00:00
Daniel Dunbar e1fdb0e8ce Move X86 instruction parsing into X86/AsmParser.
llvm-svn: 77384
2009-07-28 22:40:46 +00:00
Daniel Dunbar c43267a472 Make expression parsing and error/warning reporting available through the
generic MCAsmParser interface.

llvm-svn: 77381
2009-07-28 22:22:31 +00:00
Daniel Dunbar f59ee96a16 Provide generic MCAsmParser when constructing target specific parsers.
llvm-svn: 77362
2009-07-28 20:47:52 +00:00
Owen Anderson c2c7932c64 Change ConstantArray to 2.5 API.
llvm-svn: 77347
2009-07-28 18:32:17 +00:00
Daniel Dunbar d806996191 Switch X86 assembly parser to using the generic lexer interface.
llvm-svn: 77341
2009-07-28 18:17:26 +00:00
Daniel Dunbar 6d1e79dded Expose Tokens to target specific assembly parsers.
llvm-svn: 77337
2009-07-28 17:58:44 +00:00
Daniel Dunbar bc79816f28 Switch AsmLexer::Lex to returning a reference to the current token.
llvm-svn: 77328
2009-07-28 16:56:42 +00:00
Daniel Dunbar ee4465cf82 Drop some AsmLexer methods in favor of their AsmToken equivalents.
llvm-svn: 77323
2009-07-28 16:38:40 +00:00
Daniel Dunbar f2dcd77253 llvm-mc: Sink token enum into AsmToken.
llvm-svn: 77322
2009-07-28 16:08:33 +00:00
Nick Lewycky 1b329eb2bf Remove memory corruption bug. string.c_str() was returning a temporary that was
dead before we used it.

llvm-svn: 77304
2009-07-28 06:53:50 +00:00
Daniel Dunbar 8368f4e8a4 llvm-mc: Factor AsmToken class out of AsmLexer.
llvm-svn: 77292
2009-07-28 03:00:54 +00:00
Daniel Dunbar 5cf338ad60 llvm-mc: Stop uniqueing string tokens, nothing actually uses this.
llvm-svn: 77287
2009-07-28 00:58:50 +00:00
Dan Gohman a30c0a1b3e Pass true to the Internalize parameter of createStandardLTOPasses,
to match llvm-ld's default behavior.

llvm-svn: 77273
2009-07-27 23:23:47 +00:00
Daniel Dunbar eb6bb32bef llvm-mc: Implement .abort fully in the front end
llvm-svn: 77272
2009-07-27 23:20:52 +00:00
Owen Anderson 45308b578b Move ConstantStruct back to 2.5 API.
llvm-svn: 77266
2009-07-27 22:29:26 +00:00
Daniel Dunbar 52d03b252e llvm-mc: Move AsmLexer::getCurStrVal to StringRef based API.
- My DFS traversal of LLVM is, at least for now, nearly complete! :)

llvm-svn: 77258
2009-07-27 21:49:56 +00:00
Nick Lewycky fd6a2498ab Fix libLTO:
* Call InitializeAllTargets on every path where we might query the
   TargetRegistry. This fixes PR4604.
 * flush the formatted_raw_ostream& or else not all of the assembly will make
   it to the .s file. (It doesn't do this in its destructor?!)
 * Due to a reversed conditional, libLTO was reporting many symbols as both
   defined and undefined, including two definitions of the same symbol name
   in its symbol list.

llvm-svn: 77170
2009-07-26 22:16:39 +00:00
Daniel Dunbar 6115b39ffd Remove Value::getName{Start,End}, the last of the old Name APIs.
llvm-svn: 77152
2009-07-26 09:48:23 +00:00
Daniel Dunbar ee01b242e8 Factor commonality in triple match routines into helper template for registering
classes, and migrate existing targets over.

llvm-svn: 77126
2009-07-26 05:03:33 +00:00
Daniel Dunbar 47d679151b Add TargetRegistry::lookupTarget.
- This is a simplified mechanism which just looks up a target based on the
   target triple, with a few additional flags.

 - Remove getClosestStaticTargetForModule, the moral equivalent is now:
     lookupTarget(Mod->getTargetTriple, true, false, ...);

 - This no longer does the fuzzy matching with target data (based on endianness
   and pointer width) that getClosestStaticTargetForModule was doing, but this
   was deemed unnecessary.

llvm-svn: 77111
2009-07-26 02:12:58 +00:00
Daniel Dunbar d786b51ea4 Remove Value::setName(const char*, unsigned).
llvm-svn: 77100
2009-07-26 00:34:27 +00:00
Daniel Dunbar 67395e7c2c One more getName -> getNameStr
llvm-svn: 77027
2009-07-25 00:43:31 +00:00
Owen Anderson edb4a70325 Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.
llvm-svn: 77011
2009-07-24 23:12:02 +00:00
Daniel Dunbar 12368685d8 Switch to getNameStr().
llvm-svn: 76962
2009-07-24 08:24:36 +00:00
Reid Kleckner 4b3a356493 Re-committing r76828 with the JIT memory manager changes now that the build
bots like the BumpPtrAllocator changes.

llvm-svn: 76902
2009-07-23 21:46:56 +00:00
Daniel Dunbar 5bf72e20eb Convert StringMap to using StringRef for its APIs.
- Yay for '-'s and simplifications!

 - I kept StringMap::GetOrCreateValue for compatibility purposes, this can
   eventually go away. Likewise the StringMapEntry Create functions still follow
   the old style.

 - NIFC.

llvm-svn: 76888
2009-07-23 18:17:34 +00:00
Reid Kleckner 921673225c Reverting r76825 and r76828, since they caused clang runtime errors and some build failure involving memset.
llvm-svn: 76838
2009-07-23 01:40:54 +00:00
Devang Patel e059ba6ed2 Derive MDNode from MetadataBase instead of Constant. Emit MDNodes into METADATA_BLOCK in bitcode file.
llvm-svn: 76834
2009-07-23 01:07:34 +00:00
Reid Kleckner 1a722d9b73 Make the JIT code emitter properly retry and ask for more memory when it runs
out of memory, and also make the default memory manager allocate more memory
when it runs out.

Also, switch function stubs and global data over to using the BumpPtrAllocator.

This makes it so the JIT no longer mmaps (or the equivalent on Windows) 16 MB
of memory, and instead allocates in 512K slabs.  I suspect this size could go
lower, especially on embedded platforms, now that more slabs can be allocated.

llvm-svn: 76828
2009-07-23 00:49:59 +00:00
Daniel Dunbar 5899dda08c Switch some clients to Value::getName(), and other getName() user
simplification.
 - NFC

llvm-svn: 76789
2009-07-22 21:33:09 +00:00
Sanjiv Gupta 5200f046d5 Added -b option to override the default bitcode output file name.
llvm-svn: 76768
2009-07-22 18:41:45 +00:00
Devang Patel 7428d8acec Introduce MetadataBase, a base class for MDString and MDNode.
Derive MDString directly from MetadataBase. 
Introduce new bitcode block to hold metadata.

llvm-svn: 76759
2009-07-22 17:43:22 +00:00
Owen Anderson 47db941fd3 Get rid of the Pass+Context magic.
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Evan Cheng c9ec735aa8 80 col violation.
llvm-svn: 76629
2009-07-21 19:25:09 +00:00
Daniel Dunbar 5899e340f3 Simplify / normalize some uses of Value::getName.
llvm-svn: 76553
2009-07-21 08:54:24 +00:00
Kevin Enderby ee5513582d Removed the DumpSymbolsandMacros and LoadSymbolsandMacros MCStreamer API as
the parsing of the .dump and .load should be done in the assembly parser and
not have any need for an MCStreamer API.  Changed the code for now so these
just produce an error saying these specific directives are not yet implemented
since they are likely no longer used and may never need to be implemented.

llvm-svn: 76462
2009-07-20 20:25:37 +00:00
Daniel Dunbar 2b11c7de4a Add MCAsmLexer interface.
- This provides the AsmLexer interface to the target specific assembly parsers.

llvm-svn: 76460
2009-07-20 20:01:54 +00:00
Daniel Dunbar 3c2a893ac7 Add MCAsmParser interface.
- This provides the AsmParser interface to the target specific assembly
   parsers.

llvm-svn: 76453
2009-07-20 18:55:04 +00:00
David Goodwin 47ca461c82 For remote execution, must cd to the executable directory since the exe expects to find a dylib in the CWD ('.').
llvm-svn: 76432
2009-07-20 17:15:03 +00:00
Daniel Dunbar 7369951bfe Add -std-{compile,link}-opts to bugpoint.
- Sheesh.

llvm-svn: 76402
2009-07-20 07:01:01 +00:00
Bill Wendling a3c6f6bffa Add plumbing for the `linker_private' linkage type. This type is meant for
"private" symbols which the assember shouldn't strip, but which the linker may
remove after evaluation. This is mostly useful for Objective-C metadata.

This is plumbing, so we don't have a use of it yet. More to come, etc.

llvm-svn: 76385
2009-07-20 01:03:30 +00:00
Chris Lattner 14d021f538 fix test
llvm-svn: 76378
2009-07-19 20:19:25 +00:00
Chris Lattner 7e8aaad1a0 DisambiguateGlobalSymbols should not mangle intrinsics.
llvm-svn: 76377
2009-07-19 20:19:04 +00:00
Viktor Kutuzov 858702541d Require a remote command to exit with the exit status of the test program or with 255 if an error occurred.
llvm-svn: 76323
2009-07-18 18:39:24 +00:00
Daniel Dunbar a78d809abc Switch lli back to using allocate-gvs-with-code behavior.
- Otherwise we get two regressions in llvm-test for applications which run out
   of space.

 - Once the JIT memory manager is improved, this can be switched back.

llvm-svn: 76291
2009-07-18 08:07:13 +00:00
Reid Kleckner fc8a2d5a83 Add EngineBuilder to ExecutionEngine in favor of the five optional argument EE::create().
Also a test commit.

llvm-svn: 76276
2009-07-18 00:42:18 +00:00
Daniel Dunbar 7b1a4c18ea llvm-mc: Default -triple to LLVM_HOSTTRIPLE.
llvm-svn: 76260
2009-07-17 22:51:20 +00:00
Daniel Dunbar 8c6bad2f66 llvm-mc: Add -triple, and start fetching the target asm printer.
llvm-svn: 76257
2009-07-17 22:38:58 +00:00
Daniel Dunbar 36d5769ab0 Reenable asmparser dependency generation, now with improved Perl foo.
llvm-svn: 76243
2009-07-17 21:26:27 +00:00
Daniel Dunbar 6b35d3c9de Disable llvm-config magic for AsmParser, it is isn't right & is breaking the build.
llvm-svn: 76242
2009-07-17 21:22:20 +00:00
Daniel Dunbar 71475775b9 Sketch support for target specific assembly parser.
- Not fully enabled yet, need a configure regeneration.

llvm-svn: 76230
2009-07-17 20:42:00 +00:00
Bob Wilson 46f079e33f Fix a crash in SROA. The FunctionPass::doInitialization method was never
being called so that Context was never initialized.  I'm not sure if this
is the right fix but at least it keeps opt from crashing.

llvm-svn: 76220
2009-07-17 19:05:13 +00:00
Daniel Dunbar 41f9a3afdb opt: Add -std-link-opts argument, matches llvm-ld's optimizations.
llvm-svn: 76199
2009-07-17 18:09:39 +00:00
Kevin Enderby dd27e5e10a Removed the SubsectionsViaSymbols MCStreamer API and replaced it with a generic
EmitAssemblerFlag API which takes a value from the added AssemblerFlag
enumerated constants.

llvm-svn: 76087
2009-07-16 17:56:39 +00:00
Kevin Enderby 7bef8bc320 Clean up the definition of Str in AsmParser::ParseDirectiveDarwinDumpOrLoad
so it is defined with a lifetime that is as short as possible.

llvm-svn: 76082
2009-07-16 17:17:46 +00:00
Dan Gohman ee05152cfa Convert more tools code from cerr and cout to errs() and outs().
llvm-svn: 76070
2009-07-16 15:30:09 +00:00
Chris Lattner 693fbb8fee implement .include in the lexer/parser instead of passing it into the streamer.
llvm-svn: 75896
2009-07-16 06:14:39 +00:00
Daniel Dunbar 4580638808 Kill off last uses of TargetMachineRegistry class.
llvm-svn: 75892
2009-07-16 02:41:19 +00:00
Daniel Dunbar d3706458df Switch llc and createJIT to use simpler command line parsing for -march.
llvm-svn: 75890
2009-07-16 02:23:53 +00:00
Daniel Dunbar 3d92d936b9 Make sure targets are initialized before we do anything, even command line
processing.

llvm-svn: 75888
2009-07-16 02:04:54 +00:00
Dan Gohman 2b30e8be44 Fix this comment to mention outs() rather than cout.
llvm-svn: 75858
2009-07-15 23:33:14 +00:00
Owen Anderson 19251ec836 To simplify the upcoming context-on-type change, switch all command line tools to using the default global context for now.
This will let us to hardwire stuff to the global context in the short term while the API is sorted out.

llvm-svn: 75846
2009-07-15 22:16:10 +00:00
Daniel Dunbar e833810a5e Reapply TargetRegistry refactoring commits.
--- Reverse-merging r75799 into '.':
 U   test/Analysis/PointerTracking
U    include/llvm/Target/TargetMachineRegistry.h
U    include/llvm/Target/TargetMachine.h
U    include/llvm/Target/TargetRegistry.h
U    include/llvm/Target/TargetSelect.h
U    tools/lto/LTOCodeGenerator.cpp
U    tools/lto/LTOModule.cpp
U    tools/llc/llc.cpp
U    lib/Target/PowerPC/PPCTargetMachine.h
U    lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
U    lib/Target/PowerPC/PPCTargetMachine.cpp
U    lib/Target/PowerPC/PPC.h
U    lib/Target/ARM/ARMTargetMachine.cpp
U    lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
U    lib/Target/ARM/ARMTargetMachine.h
U    lib/Target/ARM/ARM.h
U    lib/Target/XCore/XCoreTargetMachine.cpp
U    lib/Target/XCore/XCoreTargetMachine.h
U    lib/Target/PIC16/PIC16TargetMachine.cpp
U    lib/Target/PIC16/PIC16TargetMachine.h
U    lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
U    lib/Target/Alpha/AlphaTargetMachine.cpp
U    lib/Target/Alpha/AlphaTargetMachine.h
U    lib/Target/X86/X86TargetMachine.h
U    lib/Target/X86/X86.h
U    lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
U    lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
U    lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h
U    lib/Target/X86/X86TargetMachine.cpp
U    lib/Target/MSP430/MSP430TargetMachine.cpp
U    lib/Target/MSP430/MSP430TargetMachine.h
U    lib/Target/CppBackend/CPPTargetMachine.h
U    lib/Target/CppBackend/CPPBackend.cpp
U    lib/Target/CBackend/CTargetMachine.h
U    lib/Target/CBackend/CBackend.cpp
U    lib/Target/TargetMachine.cpp
U    lib/Target/IA64/IA64TargetMachine.cpp
U    lib/Target/IA64/AsmPrinter/IA64AsmPrinter.cpp
U    lib/Target/IA64/IA64TargetMachine.h
U    lib/Target/IA64/IA64.h
U    lib/Target/MSIL/MSILWriter.cpp
U    lib/Target/CellSPU/SPUTargetMachine.h
U    lib/Target/CellSPU/SPU.h
U    lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
U    lib/Target/CellSPU/SPUTargetMachine.cpp
U    lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
U    lib/Target/Mips/MipsTargetMachine.cpp
U    lib/Target/Mips/MipsTargetMachine.h
U    lib/Target/Mips/Mips.h
U    lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
U    lib/Target/Sparc/SparcTargetMachine.cpp
U    lib/Target/Sparc/SparcTargetMachine.h
U    lib/ExecutionEngine/JIT/TargetSelect.cpp
U    lib/Support/TargetRegistry.cpp

llvm-svn: 75820
2009-07-15 20:24:03 +00:00
Dan Gohman 607818a2c1 Add a Force option to raw_fd_ostream to specify whether opening
an existing file is considered an error. Convert several tools
to use raw_fd_ostream instead of std::ostream, and to use this
new option instead of doing a manual check.

llvm-svn: 75801
2009-07-15 17:29:42 +00:00
Stuart Hastings 338191cd67 Revert 75762, 75763, 75766..75769, 75772..75775, 75778, 75780, 75782 to repair broken LLVM-GCC build.
Will revert 75770 in the llvm-gcc trunk.

llvm-svn: 75799
2009-07-15 17:27:11 +00:00
Dan Gohman d8db376071 Use errs() instead of std::cerr.
llvm-svn: 75791
2009-07-15 16:35:29 +00:00
Kevin Enderby 09ea5709a2 Added llvm-mc support for parsing the .dump and .load directives.
llvm-svn: 75786
2009-07-15 15:30:11 +00:00
Daniel Dunbar 5eb9700578 Migrate llc and the JIT to using the TargetRegistry for lookups.
- They still use the TargetMachineRegistry to populate the contents of the
   -march option (via the listener interface). We can't just populate it in the
   option parser because we can't expect the TargetRegistry to be populated yet
   (we no longer rely on static constructors).

 - There are a couple ways to finish killing off TargetMachineRegistry, but I
   haven't figured out the cleanest one yet...

llvm-svn: 75773
2009-07-15 11:36:15 +00:00
Daniel Dunbar a8d73996ce Switch some obvious clients to using the new TargetRegistry.
llvm-svn: 75767
2009-07-15 10:05:03 +00:00
Daniel Dunbar 2179d73133 Teach Makefiles & CMake to link in the <TARGET>Info library when linking the
TARGET component.
 - Also, updated some CMake library dependencies, it is still missing some
   though. :(

llvm-svn: 75755
2009-07-15 07:43:34 +00:00
Chris Lattner c35b5bac32 eliminate the Mangler::PreserveAsmNames bit, the sole client of this
can do it perfectly well itself.

llvm-svn: 75743
2009-07-15 04:50:47 +00:00
Evan Cheng d1c4705577 control reaches end of non-void function.
llvm-svn: 75714
2009-07-14 23:55:32 +00:00
Kevin Enderby d1ea5393c9 Added llvm-mc support for parsing the .include directive.
llvm-svn: 75711
2009-07-14 23:21:55 +00:00
Owen Anderson b6b2530000 Move EVER MORE stuff over to LLVMContext.
llvm-svn: 75703
2009-07-14 23:09:55 +00:00
Kevin Enderby cbe475dfe8 Added llvm-mc support for parsing the .lsym directive.
llvm-svn: 75685
2009-07-14 21:35:03 +00:00
David Greene a31f96cf2b Have asm printers use formatted_raw_ostream directly to avoid a
dynamic_cast<>.

llvm-svn: 75670
2009-07-14 20:18:05 +00:00
Viktor Kutuzov 1518de130e Fix for bugpoint -remote-client
llvm-svn: 75665
2009-07-14 19:10:55 +00:00
Chris Lattner 8c9a96b966 Reapply my previous asmprinter changes now with more testing and two
additional bug fixes:

1. The bug that everyone hit was a problem in the asmprinter where it
   would remove $stub but keep the L prefix on a name when emitting the
   indirect symbol.  This is easy to fix by keeping the name of the stub
   and the name of the symbol in a StringMap instead of just keeping a
   StringSet and trying to reconstruct it late.

2. There was a problem printing the personality function.  The current
   logic to print out the personality function from the DWARF information
   is a bit of a cesspool right now that duplicates a bunch of other 
   logic in the asm printer.  The short version of it is that it depends
   on emitting both the L and _ prefix for symbols (at least on darwin)
   and until I can untangle it, it is best to switch the mangler back to
   emitting both prefixes.

llvm-svn: 75646
2009-07-14 18:17:16 +00:00
Kevin Enderby 4c21caa656 Added llvm-mc support for parsing the .desc directive.
llvm-svn: 75645
2009-07-14 18:17:10 +00:00
Daniel Dunbar eb3e4271e8 Revert r7561{9,8,7,6}, which depend on r75610.
--- Reverse-merging r75619 into '.':
U    lib/Target/DarwinTargetAsmInfo.cpp
U    lib/CodeGen/AsmPrinter/AsmPrinter.cpp
--- Reverse-merging r75618 into '.':
U    lib/CodeGen/ELFWriter.cpp
U    lib/CodeGen/MachOCodeEmitter.cpp
U    lib/CodeGen/MachOWriter.cpp
--- Reverse-merging r75617 into '.':
U    lib/Target/CBackend/CBackend.cpp
--- Reverse-merging r75616 into '.':
U    tools/bugpoint/Miscompilation.cpp
U    tools/lto/LTOCodeGenerator.cpp
U    tools/lto/LTOModule.cpp

llvm-svn: 75638
2009-07-14 16:25:11 +00:00
Daniel Dunbar 277e11b116 Move main llvm-prof functionality into a ModulePass.
- To support using the ProfileInfo analysis results instead of accessing the
   ProfileInfoLoader directly.

 - Based on (part of) a patch by Andreas Neustifter.

 - No functionality change.

llvm-svn: 75625
2009-07-14 07:41:11 +00:00
Chris Lattner 0639a72834 rename getValueName -> getMangledName
llvm-svn: 75616
2009-07-14 06:19:07 +00:00
Kevin Enderby 56523ceba1 Added llvm-mc support for parsing the .abort directive.
llvm-svn: 75545
2009-07-13 23:15:14 +00:00
Dan Gohman e2d31aa132 #include "llvm/Assembly/Writer.h" to get the declaration for WriteAsOperand.
llvm-svn: 75542
2009-07-13 22:56:37 +00:00
Owen Anderson b258410a1b Fix the build.
llvm-svn: 75536
2009-07-13 22:40:32 +00:00
Owen Anderson e4dcecd006 As Chris pointed out, this doesn't actually need an LLVMContext to operate.
llvm-svn: 75508
2009-07-13 21:27:19 +00:00
Kevin Enderby c9d93ef2c6 add llvm-mc support for parsing the .subsections_via_symbols directive.
llvm-svn: 75500
2009-07-13 21:03:15 +00:00
Sanjiv Gupta 63bdb56274 Added a fixme for platform specific GetDirSeparator().
llvm-svn: 75461
2009-07-13 10:58:55 +00:00
Sanjiv Gupta ed5db9dd30 allow mcc16 users to specify --save-temps even though it is hidden by mcc16.
link libstd.so with llvm-ld by default with all the programs user is trying to build.

llvm-svn: 75460
2009-07-13 10:56:29 +00:00
Owen Anderson 53a52215b5 Begin the painful process of tearing apart the rat'ss nest that is Constants.cpp and ConstantFold.cpp.
This involves temporarily hard wiring some parts to use the global context.  This isn't ideal, but it's
the only way I could figure out to make this process vaguely incremental.

llvm-svn: 75445
2009-07-13 04:09:18 +00:00
Daniel Dunbar 65553d4505 Match declaration to definition.
llvm-svn: 75440
2009-07-12 23:50:34 +00:00
Chris Lattner a797d376de silence vc++ warning.
llvm-svn: 75394
2009-07-11 22:32:37 +00:00
Daniel Dunbar 9dc326fbaa Fix unused function warning.
llvm-svn: 75386
2009-07-11 21:24:52 +00:00
Mikhail Glushenkov bee767fa26 Update documentation.
llvm-svn: 75375
2009-07-11 19:27:40 +00:00
Sanjiv Gupta 594006524b Erase the temp dir before starting.
llvm-svn: 75367
2009-07-11 17:35:46 +00:00
Chris Lattner 07cadaf113 add support for .zerofill, patch by Kevin Enderby!
llvm-svn: 75301
2009-07-10 22:20:30 +00:00
David Goodwin 73f4e3f442 Support remote execute for ARM.
llvm-svn: 75292
2009-07-10 21:39:28 +00:00
Jeffrey Yasskin bf3d6ba557 Add a --with-oprofile flag to configure, which uses OProfile's agent
library to tell it the addresses of JITted functions.  For a
particular program, this changes the opreport -l output from:

samples %    image name        symbol name
48182  98.9729 anon (tgid:19412 range:0x7f12ccaab000-0x7f12cdaab000) anon (tgid:19412 range:0x7f12ccaab000-0x7f12cdaab000)
11     0.0226  libstdc++.so.6.0.9    /usr/lib/libstdc++.so.6.0.9

to:

samples %    image name        symbol name
24565  60.7308 19814.jo        fib_left
15365  37.9861 19814.jo        fib_right
22     0.0544  ld-2.7.so       do_lookup_x

llvm-svn: 75279
2009-07-10 21:08:20 +00:00
Sanjiv Gupta 62609a4131 Link std.lib (.bc code) with llvm-ld.
Link devices.lib (processor specific variables) with mplink.

llvm-svn: 75263
2009-07-10 19:04:05 +00:00
Owen Anderson 1e5f00e7a7 This started as a small change, I swear. Unfortunately, lots of things call the [I|F]CmpInst constructors. Who knew!?
llvm-svn: 75200
2009-07-09 23:48:35 +00:00
Mikhail Glushenkov 7ab20c7cf9 Documentation update.
llvm-svn: 75166
2009-07-09 19:39:16 +00:00
Mikhail Glushenkov 163f93e434 We don't need to set SaveTemps here.
'--temp-dir' always overrides 'save-temps'.

llvm-svn: 75165
2009-07-09 19:38:32 +00:00
Mikhail Glushenkov 353b8cc112 Adjust comment.
llvm-svn: 75164
2009-07-09 19:37:58 +00:00
Sanjiv Gupta f3b8609c6f By default -t is always on for mcc16 and it uses ./tmp-objs as the temp directory.
llvm-svn: 75155
2009-07-09 18:09:26 +00:00
Chris Lattner 28ad7547d2 add llvm-mc support for parsing the .lcomm directive, patch by Kevin Enderby!
llvm-svn: 75148
2009-07-09 17:25:12 +00:00
Sanjiv Gupta c378299f79 Added few more options to individual tools.
llvm-svn: 75120
2009-07-09 08:20:25 +00:00
Sanjiv Gupta 772924295d Return dir separator as per platform.
llvm-svn: 75119
2009-07-09 08:17:55 +00:00
Nick Lewycky 0661b93de9 Don't create undefined symbols for aliases.
llvm-svn: 75111
2009-07-09 06:03:04 +00:00
Owen Anderson b17f32945f Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.
llvm-svn: 75025
2009-07-08 19:03:57 +00:00
Owen Anderson 5948fdf68b Push LLVMContext through GlobalVariables and IRBuilder.
llvm-svn: 74985
2009-07-08 01:26:06 +00:00
Jeffrey Yasskin 90b081ac15 Fix http://llvm.org/PR4481: Make llvm-config print the right include paths when
srcdir!=objdir.

llvm-svn: 74956
2009-07-07 22:15:37 +00:00
Chris Lattner a1e11f530e Implement parsing support for the .comm directive. Patch by
Kevin Enderby!

llvm-svn: 74944
2009-07-07 20:30:46 +00:00
Chris Lattner f840ed7ed4 Fix lli to print an error and exit when EE returns null but no string. Patch
by Eric Rannaud!

llvm-svn: 74930
2009-07-07 18:31:09 +00:00
Mikhail Glushenkov 2512c2a1f6 Documentation update.
llvm-svn: 74913
2009-07-07 16:43:49 +00:00
Mikhail Glushenkov 244821fbe5 Show how to modify built-in options.
Sanjiv complained about the need to maintain local changes to
lib/CompilerDriver.

llvm-svn: 74912
2009-07-07 16:39:33 +00:00
Mikhail Glushenkov f4cc0cddbc Documentation update.
llvm-svn: 74907
2009-07-07 16:09:29 +00:00
Bruno Cardoso Lopes 5661ea68e7 Add the Object Code Emitter class. Original patch by Aaron Gray, I did some
cleanup, removed some #includes and moved Object Code Emitter out-of-line.

llvm-svn: 74813
2009-07-06 05:09:34 +00:00
Mikhail Glushenkov 29d06ea46c LLVMC doesn't need ENABLE_PIC to build now.
llvm-svn: 74783
2009-07-04 03:54:54 +00:00
Duncan Sands 31554aba47 Add newline at end of file.
llvm-svn: 74774
2009-07-03 15:38:01 +00:00
Torok Edwin f011f28767 Fix typo: intepreter->interpreter.
llvm-svn: 74770
2009-07-03 12:11:32 +00:00
Chris Lattner a76611a535 switch the .ll parser into SMDiagnostic.
llvm-svn: 74734
2009-07-02 22:46:18 +00:00
Chris Lattner 73f3611be9 implement error recovery in the llvm-mc parser. Feel the power!
llvm-svn: 74728
2009-07-02 21:53:43 +00:00
Sanjiv Gupta 6c41ac5b38 Prefix bin dir to executables.
llvm-svn: 74713
2009-07-02 17:51:09 +00:00
Sanjiv Gupta 2b65d1aac1 Fixed handling of -c option.wq
llvm-svn: 74711
2009-07-02 17:35:38 +00:00
Daniel Dunbar 0224b65f0a llvm-mc/x86: Fix various nit-picky bugs in displacement parsing.
- Test case to follow.

llvm-svn: 74687
2009-07-02 02:26:39 +00:00
Daniel Dunbar 9bff6531fd llvm-mc/x86: Fix bug in disambiguation of displacement operand, introduced by me
(I think).
 - We weren't properly parsing the leading parenthesized expression in something
   like 'push (4)(%eax)'.
 
 - Added ParseParenRelocatableExpression to support this. I suspect we should
   just use lookahead, though.

 - Test case to follow.

llvm-svn: 74685
2009-07-02 02:09:07 +00:00
Daniel Dunbar 36a2007059 llvm-mc/x86: Factor out ParseX86Register.
llvm-svn: 74684
2009-07-02 01:58:24 +00:00
Daniel Dunbar 142f104b29 llvm-mc/x86: Rename X86Operand::ScaleReg to IndexReg and make order consistent
with syntax.

llvm-svn: 74679
2009-07-02 00:51:52 +00:00
Owen Anderson 0ff993839c Maintain the old LTO API, by using the global context.
llvm-svn: 74678
2009-07-02 00:31:14 +00:00
Dan Gohman 43f33dd550 Fix a bunch of other places that used operator[] to test whether
a key is present in a std::map or DenseMap to use find instead.

llvm-svn: 74676
2009-07-02 00:17:47 +00:00
John Mosby f4f2f14f57 fix ld error with -no-undefined switch, which is undefined on darwin8
llvm-svn: 74674
2009-07-02 00:10:23 +00:00
Owen Anderson 2a15443aa8 Make the use of const with respect to LLVMContext sane. Hopefully this is the last time, for the
moment, that I will need to make far-reaching changes.

llvm-svn: 74655
2009-07-01 23:13:44 +00:00
Owen Anderson 1cf085d558 Hold the LLVMContext by reference rather than by pointer.
llvm-svn: 74640
2009-07-01 21:22:36 +00:00
Jeffrey Yasskin 1a93330ffa Add a portable strerror*() wrapper, llvm::sys::StrError(). This includes the
Windows variant, strerror_s, but I couldn't test that.

I'll update configure and config.h.in in a subsequent patch.

llvm-svn: 74621
2009-07-01 18:11:20 +00:00
Owen Anderson 6773d388aa Add a pointer to the owning LLVMContext to Module. This requires threading LLVMContext through a lot
of the bitcode reader and ASM parser APIs, as well as supporting it in all of the tools.

Patches for Clang and LLVM-GCC to follow.

llvm-svn: 74614
2009-07-01 16:58:40 +00:00
Sanjiv Gupta 8ff5a6c262 Executables will be at InstallDir/bin directory. Std header files will be at InstallDir/include, libs will be at InstallDir/lib. Define hooks for these and use them in the options for various tools.
llvm-svn: 74611
2009-07-01 16:10:29 +00:00
Daniel Dunbar b442e04259 llvm-mc: Add some more doxyments.
llvm-svn: 74607
2009-07-01 15:14:50 +00:00
Daniel Dunbar 9c4809a887 llvm-mc: Fill in the rest of tokens for 'as-lex' mode.
llvm-svn: 74598
2009-07-01 06:56:54 +00:00
Daniel Dunbar 0d5fc9a5b0 Rename MCValue::isConstant to isAbsolute.
llvm-svn: 74596
2009-07-01 06:48:00 +00:00