Commit Graph

2725 Commits

Author SHA1 Message Date
Dan Gohman 0054b460ff 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 41bf56de79 TAI -> MAI
llvm-svn: 80899
2009-09-03 06:13:54 +00:00
Daniel Dunbar 76628def06 Tweak comment.
llvm-svn: 80891
2009-09-03 05:47:22 +00:00
Douglas Gregor ef7c1fd909 Unbreak my CMake build. Say you'll link again.
llvm-svn: 80842
2009-09-02 22:45:31 +00:00
Dan Gohman c76bfb777e 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 897ffadd2d llvm-mc: Pass values to MCStreamer as MCExprs, not MCValues.
llvm-svn: 80578
2009-08-31 08:09:28 +00:00
Daniel Dunbar b7b2097aac llvm-mc: Simplify EmitAssignment ('.set' is identical to '=').
llvm-svn: 80577
2009-08-31 08:09:09 +00:00
Daniel Dunbar b12b33051d llvm-mc: Remove MCAsmParser::Parse[Paren]RelocatableExpression.
llvm-svn: 80576
2009-08-31 08:08:50 +00:00
Daniel Dunbar 7c82d56930 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 940cda2590 llvm-mc: Add MCAsmParser::getContext.
llvm-svn: 80571
2009-08-31 08:07:44 +00:00
Daniel Dunbar f363645da2 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 115e4d6d7b llvm-mc: Move AsmExpr into MC lib (as MCExpr).
llvm-svn: 80567
2009-08-31 08:06:59 +00:00
Chris Lattner edcbfe8529 only print the override triple if it exists!
llvm-svn: 80534
2009-08-31 03:22:35 +00:00
Chris Lattner 305b115a87 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 6a715dccdf 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 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