Commit Graph

2548 Commits

Author SHA1 Message Date
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