Commit Graph

2725 Commits

Author SHA1 Message Date
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
Chris Lattner e4dfc89615 add some of the new tokens, others are still missing.
llvm-svn: 74595
2009-07-01 06:36:49 +00:00
Daniel Dunbar fc35841077 llvm-mc: Emit parsed instructions to the MCStreamer.
llvm-svn: 74594
2009-07-01 06:35:48 +00:00
Daniel Dunbar d0a08e0430 llvm-mc: Introduce method to match a parsed x86 instruction into an MCInst.
llvm-svn: 74573
2009-06-30 23:38:38 +00:00
Daniel Dunbar cfcdf5c1ac llvm-mc: Accept relocatable expressions when parsing displacements and
immediates.

llvm-svn: 74568
2009-06-30 23:02:44 +00:00
Daniel Dunbar 8561b6aea0 llvm-mc: Symbols in a relocatable expression of the (a - b + cst) form are
allowed to be undefined when the expression is seen, we cannot enforce the
same-section requirement until the entire assembly file has been seen.

llvm-svn: 74565
2009-06-30 22:49:27 +00:00
Daniel Dunbar 3971273aa2 Suppress may-be-used-uninitialized warning.
llvm-svn: 74529
2009-06-30 16:02:47 +00:00
Douglas Gregor 16f652876f Fix CMake build
llvm-svn: 74527
2009-06-30 14:37:26 +00:00
Daniel Dunbar 75630b355a llvm-mc: Accept relocatable expressions for .org, assignments, .byte, etc.
llvm-svn: 74498
2009-06-30 02:10:03 +00:00
Daniel Dunbar 19f847fa68 llvm-mc: Rewrite binary subtraction for relocatable expressions, we can't always
legally negate an MCValue.

llvm-svn: 74497
2009-06-30 02:08:27 +00:00
Daniel Dunbar bd4bf3d4f7 llvm-mc: Evaluation for relocatable expressions.
llvm-svn: 74496
2009-06-30 01:49:52 +00:00
Daniel Dunbar c9dc78ae40 Normalize SourceMgr messages.
- Don't print "Parsing" in front of every message.

 - Take additional "type" argument which is prepended to the message (with ": ")
   if given.

 - Update clients to print errors (warnings) as:
<filename>:<line number>: error(warning): ...

llvm-svn: 74489
2009-06-30 00:49:23 +00:00
Daniel Dunbar a5508c893a llvm-mc: Parse symbol attribute directives.
llvm-svn: 74487
2009-06-30 00:33:19 +00:00
Mikhail Glushenkov 8a4d713e48 Clang is now production quality (at least for C).
llvm-svn: 74484
2009-06-30 00:16:22 +00:00
Mikhail Glushenkov 3fcdada6b4 Add a way to access argv[0] in hooks.
llvm-svn: 74483
2009-06-30 00:16:00 +00:00
Daniel Dunbar cc566a714b llvm-mc: Parse .{,b,p2}align{,w,l} directives.
llvm-svn: 74478
2009-06-29 23:46:59 +00:00
Daniel Dunbar ae7ac01059 llvm-mc: Diagnose misuse (mix) of defined symbols and labels.
- For example, we diagnose errors on:
--
a:
a = 10
--

 - For now we reject code like:
--
.long a
a = 10
--
   which "as" accepts (on Darwin).

llvm-svn: 74476
2009-06-29 23:43:14 +00:00
Daniel Dunbar 5992b4a211 llvm-mc: Recognize C++ style comments.
llvm-svn: 74463
2009-06-29 22:00:57 +00:00
Daniel Dunbar 6b22f9ca45 llvm-mc: Recognize C++ style comments.
llvm-svn: 74462
2009-06-29 21:58:22 +00:00
Daniel Dunbar 231898baf5 Fix uninitialized variable warning.
llvm-svn: 74457
2009-06-29 21:14:21 +00:00
Daniel Dunbar fdbbc52cfd Don't build LLVMC when configured with --disable-pic (it needs requires shared
module support to build).

llvm-svn: 74456
2009-06-29 21:12:26 +00:00
Daniel Dunbar 84bfd7b184 MC: Improve expression parsing and implement evaluation of absolute expressions
(missed files).

llvm-svn: 74450
2009-06-29 20:40:36 +00:00
Daniel Dunbar 7e8d6c7215 MC: Improve expression parsing and implement evaluation of absolute expressions.
llvm-svn: 74448
2009-06-29 20:37:27 +00:00
Evan Cheng d6460965a5 Indentation.
llvm-svn: 74281
2009-06-26 06:57:16 +00:00
Daniel Dunbar 4a5a561a24 MC: Parse .org directives.
llvm-svn: 74218
2009-06-25 22:44:51 +00:00
Daniel Dunbar 2d2ee150eb MC: Parse .set and assignments.
llvm-svn: 74208
2009-06-25 21:56:11 +00:00
Mikhail Glushenkov d1d21a1ce9 Update documentation.
llvm-svn: 74191
2009-06-25 18:20:44 +00:00
Jeffrey Yasskin 0b08f3d7cc Add a JITEventListener interface that gets called back when a new function is
emitted or the machine code for a function is freed.  Chris mentioned that we
may also want a notification when a stub is emitted, but that'll be a future
change.  I intend to use this to tell oprofile where functions are emitted and
what lines correspond to what addresses.

llvm-svn: 74157
2009-06-25 02:04:04 +00:00
Mikhail Glushenkov 73da626340 Remove duplication.
Factor out common preprocessor-related bits to Makefile.rules.

llvm-svn: 74153
2009-06-25 01:07:00 +00:00
Daniel Dunbar a10e519e04 Basic .s parsing for .asci[iz], .fill, .space, {.byte, .short, ... }
- Includes some DG tests in test/MC/AsmParser, which are rather primitive since
   we don't have a -verify mode yet.

llvm-svn: 74139
2009-06-24 23:30:00 +00:00
Owen Anderson b70adf2b92 Get rid of the global CFGOnly flag by threading a ShortNames parameters through the GraphViz rendering code.
Update other uses in the codebase for this change.

llvm-svn: 74084
2009-06-24 17:37:09 +00:00
Chris Lattner 3912036c25 remove dead makefile flags.
llvm-svn: 74065
2009-06-24 05:29:56 +00:00
Chris Lattner f7ebca4db6 implement a bunch of synonyms for section switching.
llvm-svn: 74062
2009-06-24 05:13:15 +00:00
Chris Lattner bedf6c2995 add support for parsing and emitting .section directives. We can now parse
things like:
.section __TEXT,__cstring,cstring_literals

llvm-svn: 74058
2009-06-24 04:43:34 +00:00
Chris Lattner 3f5738d599 add trivial support for passing label definitions through the MCStreamer.
This is suboptimal in several aspects, see the commented out assertion.
I need to talk to Daniel about this.

llvm-svn: 74057
2009-06-24 04:31:49 +00:00
Chris Lattner 92ffdd15f8 create an MCStreamer and provide it to AsmParser.
llvm-svn: 74039
2009-06-24 00:52:40 +00:00
Chris Lattner 4c501fc196 make the lexer unique strings it lexes instead of passing them back as
std::strings.

llvm-svn: 74036
2009-06-24 00:33:19 +00:00
Daniel Dunbar ca29e4d7f4 Start flushing out MCContext.
- Lives inside new library lib/MC (LLVMMC.a)

llvm-svn: 74013
2009-06-23 22:01:43 +00:00
Mikhail Glushenkov 8b4e03898c Temporary copy-pasto to make examples compile.
llvm-svn: 74001
2009-06-23 20:47:24 +00:00
Mikhail Glushenkov 248c414024 Make llvmc work again.
Chris recently broke llvmc with his Makefile changes (r75379). That patch made
the global change .o -> .a, which caused built-in llvmc plugins to stop working
since plugin initialization in llvmc is based on static variables not referenced
from the main executable. This patch implements auto-generated forced references
to the plugin libraries.

llvm-svn: 74000
2009-06-23 20:46:48 +00:00
Chris Lattner 3417d71ff4 refactor a bunch of X86 specific stuff out to its own file.
llvm-svn: 73982
2009-06-23 18:41:30 +00:00
Douglas Gregor e324ceeced CMake: remove support for llvm-config-generated dependencies in the build
llvm-svn: 73979
2009-06-23 18:30:17 +00:00
Chris Lattner f97d8bbe73 implement a trivial binary expression parser, we can now parse all of 176.gcc.llc.s
llvm-svn: 73950
2009-06-23 05:57:07 +00:00
Chris Lattner 9ec76a0b79 get a definition of strull on windows, thanks to Howard Su.
llvm-svn: 73929
2009-06-23 00:24:36 +00:00
Bob Wilson b8b636d145 Recognize and handle ARM v7 target triples for Darwin.
llvm-svn: 73889
2009-06-22 18:01:28 +00:00
Duncan Sands 376c6f16de Include cstdio to get EOF, needed with gcc-4.4.
llvm-svn: 73879
2009-06-22 06:59:32 +00:00
Chris Lattner 1d1fe918de process memory operands with a parenthesized expression for a displacement,
like "(4+5)(%eax)".

llvm-svn: 73878
2009-06-22 06:35:58 +00:00
Chris Lattner 7fdbce7a60 Implement full support for parsing primary expressions. We can now parse
all of health and voronoi (ignoring directives).  We only get 409 lines into
176.gcc though because we don't have binary operators yet:

Parsing 176.gcc.llc.s:409: unexpected token in operand list
	movsbl	_arityvec+1(,%edi,8), %eax
	      	         ^

llvm-svn: 73877
2009-06-22 06:32:03 +00:00
Chris Lattner a7b51ed5e6 implement parser support for '*' operands, as in "call *%eax".
llvm-svn: 73876
2009-06-22 06:02:13 +00:00
Chris Lattner 78db36271c implement memory operand parsing.
llvm-svn: 73875
2009-06-22 05:51:26 +00:00
Chris Lattner e5074c46b2 start implementing some simple operand parsing.
llvm-svn: 73867
2009-06-22 01:29:09 +00:00
Chris Lattner 2adc9e739c rename SourceMgr::PrintError to PrintMessage.
llvm-svn: 73861
2009-06-21 21:22:11 +00:00
Chris Lattner 36e0212c16 set up the top-level parsing loop.
llvm-svn: 73860
2009-06-21 20:54:55 +00:00
Chris Lattner b013345338 stub out parser for asm files. Change invariant on lexer to always
print its error message when it returns an asmtok::Error token.
Compute a proper error code for llvm-mc in 'lex' mode.  Add new
-as-lex option to enable lexing mode (vs parsing mode).

llvm-svn: 73859
2009-06-21 20:16:42 +00:00
Chris Lattner 419a97491a add string literals.
llvm-svn: 73858
2009-06-21 19:56:35 +00:00
Chris Lattner 99f0b60f45 hopefully fix the build on linux.
llvm-svn: 73857
2009-06-21 19:43:50 +00:00
Chris Lattner d0765617d2 implement enough of a lexer to get through Olden/health/Output/health.llc.s
without errors.

llvm-svn: 73855
2009-06-21 19:21:25 +00:00
Chris Lattner d485848229 oh yeah, cmake needs to be told explicitly about new files :)
llvm-svn: 73849
2009-06-21 07:19:34 +00:00
Chris Lattner c8dfbcbb31 some baby steps.
llvm-svn: 73848
2009-06-21 07:19:10 +00:00
Chris Lattner d70e15b46f start wiring up support for asm parsing.
llvm-svn: 73846
2009-06-21 05:22:37 +00:00
Chris Lattner 2cce7d5988 fix build problem pointed out by John Thompson!
llvm-svn: 73739
2009-06-18 23:46:04 +00:00
Chris Lattner c7ab953177 fix file header
llvm-svn: 73733
2009-06-18 23:05:21 +00:00
Chris Lattner 8dd8a52533 Add a skeleton driver for new machine code level fun. llvm-mc is meant
to be a test driver of other components in the system, which will develop
over time.

llvm-svn: 73732
2009-06-18 23:04:45 +00:00
Chris Lattner 5dcc4f6999 switch to using llvm/Target/TargetSelect.h
llvm-svn: 73611
2009-06-17 16:42:19 +00:00
Nick Lewycky 510dae3051 Fix libLTO by #include'ing the initializers for all targets and all asm
printers.

While I'm here, alphabetize.

llvm-svn: 73606
2009-06-17 06:52:10 +00:00
Mikhail Glushenkov fbd815fb7a Another small documentation update.
llvm-svn: 73596
2009-06-17 02:56:08 +00:00
Chris Lattner 4ced3324c5 Use Doug's new LLVM_NATIVE_ARCH macro in config.h to link in the native
target so that the JIT works in LLI, not just the interpreter.

llvm-svn: 73595
2009-06-17 02:15:40 +00:00
Chris Lattner eaae8d0cdc Remove support for building LLVM libraries into "relinked"
object files.  Now we always build LLVM libraries into archives (.a files).

This makes the 'make' build work more like the cmake build, among other
things.  Doing this exposed some latent circular library dependencies, so
I think that llvm-config wasn't quite right for .o files anyway.

llvm-svn: 73579
2009-06-16 23:00:42 +00:00
Douglas Gregor 1b731d5dbe Introduce new headers whose inclusion forces linking and
initialization of all targets (InitializeAllTargets.h) or assembler
printers (InitializeAllAsmPrinters.h). This is a step toward the
elimination of relinked object files, so that we can build normal
archives.

llvm-svn: 73543
2009-06-16 20:12:29 +00:00
Mikhail Glushenkov bf5085251a Documentation update.
llvm-svn: 73448
2009-06-16 00:13:52 +00:00
Rafael Espindola 27f6cb18d1 Remove the gcc= option. llvm-gcc uses only as=
Look for as in the path. Doing it here instead
of llvm-gcc because llvm-gcc has nothing as
convenient as sys::Program::FindProgramByName.

llvm-svn: 73383
2009-06-15 10:14:18 +00:00
Rafael Espindola dcf17e66c5 Bug fix:
string::find returns string::npos if the substring is not found.

llvm-svn: 73145
2009-06-09 21:14:25 +00:00
Mikhail Glushenkov aef7175f45 A basic PIC16 toolchain driver.
Nice addition to the examples and also a starting point for Sanjiv to work on.

llvm-svn: 73013
2009-06-07 07:08:01 +00:00
Nick Lewycky 5503c31ff9 Add option for specifying the path to assembler, "as". This overrides the path
to gcc.

llvm-svn: 73008
2009-06-07 00:50:45 +00:00
Devang Patel d1c7d34924 Add new function attribute - noimplicitfloat
Update code generator to use this attribute and remove NoImplicitFloat target option.
Update llc to set this attribute when -no-implicit-float command line option is used.

llvm-svn: 72959
2009-06-05 21:57:13 +00:00
Devang Patel 72a4d2fec1 Add new function attribute - noredzone.
Update code generator to use this attribute and remove DisableRedZone target option.
Update llc to set this attribute when -disable-red-zone command line option is used.

llvm-svn: 72894
2009-06-04 22:05:33 +00:00
Douglas Gregor 5c273ce20e CMake: Use explicit dependencies for Xcode (as well as MSVC), to make
the CMake-generated Xcode project build properly.

llvm-svn: 72883
2009-06-04 19:53:37 +00:00
Nick Kledzik 820c62e447 <rdar://problem/6944342> libLTO for darwin should add -static when assembling .s
llvm-svn: 72881
2009-06-04 19:14:08 +00:00
Nick Kledzik cac8c8a9b3 <rdar://problem/6940611> libLTO.dylib needs to let linker specify path to assembler
Add lto_codegen_set_assembler_path() API which allows the linker to specify the
path to the assembler tool to run.  When assembler is used (instead of compiler)
different command line options are used.
Add LTO_API_VERSION #define so clients (linkers) can conditionalize use of new APIs.

llvm-svn: 72823
2009-06-04 00:28:45 +00:00
Nick Kledzik 9149ac729f <rdar://problem/6941517> C++ static constructors not preserved for static executable using LTO
Move setRelocationModel() to be called before TargetMachine is instantiated.

llvm-svn: 72816
2009-06-03 22:52:12 +00:00
Daniel Dunbar 3cd724e590 Change LTO to run the global opt pass twice.
- This matches llvm-ld.

It took a bit of archeology to figure out what the right thing to do was
(whether this was intentionally added or intentionally removed). My final
conclusion is that Chris added this intentionally here:
  http://llvm.org/viewvc/llvm-project?view=rev&revision=16913
but the changes weren't propogated to llvm-ld until here:
  http://llvm.org/viewvc/llvm-project?view=rev&revision=34058
which was after lto.cpp had been cloned off (of llvm-ld), here:
  http://llvm.org/viewvc/llvm-project?view=rev&revision=29494

From the commit message, it looks like the motivation for running global opt
again is because we ran it prior to inlining. Based on that I updated the
comment and also only run the pass if we actually ran the inliner.

Chris, please review.

llvm-svn: 72811
2009-06-03 21:51:32 +00:00
Daniel Dunbar c292601287 Add createStandardLTOPasses to StandardPasses.h, and move lto and llvm-ld over.
- I know it sounds crazy, but I think all the pass lists are now coalesced into
   StandardPasses.h.

llvm-svn: 72805
2009-06-03 21:06:14 +00:00
Daniel Dunbar 94c7b791b1 Switch opt to using StandardPasses.h
- No functionality change, but please check if you don't believe me.

llvm-svn: 72789
2009-06-03 18:22:15 +00:00
Oscar Fuentes 6133813eb4 CMake: Implements and documents option LLVM_ENABLE_ASSERTS.
llvm-svn: 72774
2009-06-03 15:11:25 +00:00
Nick Kledzik 94e2d973c8 update comments about .objc_ symbols being generated
llvm-svn: 72708
2009-06-01 23:41:09 +00:00
Nick Kledzik b481c2015a <rdar://problem/6927148> libLTO needs to handle i386 magic objc class symbols
Parse __OBJC data structures and synthesize magic .objc_ symbols.
Also, alter mangler so that objc method names are readable.

llvm-svn: 72700
2009-06-01 20:33:09 +00:00