summaryrefslogtreecommitdiff
path: root/tools/llc
Commit message (Collapse)AuthorAge
* Add support for a new extension to the .file directive:Nick Lewycky2011-10-17
| | | | | | | | | | | .file filenumber "directory" "filename" This removes one join+split of the directory+filename in MC internals. Because bitcode files have independent fields for directory and filenames in debug info, this patch may change the .o files written by existing .bc files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142300 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance llvm::SourceMgr to support diagnostic ranges, the same way clang ↵Chris Lattner2011-10-16
| | | | | | | | | | | | | | | | | does. Enhance the X86 asmparser to produce ranges in the one case that was annoying me, for example: test.s:10:15: error: invalid operand for instruction movl 0(%rax), 0(%edx) ^~~~~~~ It should be straight-forward to enhance filecheck, tblgen, and/or the .ll parser to use ranges where appropriate if someone is interested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142106 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetRegistry and TargetSelect from Target to Support where they belong.Evan Cheng2011-08-24
| | | | | | | These are strictly utilities for registering targets and components. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138450 91177308-0d34-0410-b5e6-96231b3b80d8
* Combine all MC initialization routines into one. e.g. InitializeX86MCAsmInfo,Evan Cheng2011-07-22
| | | | | | | InitializeX86MCInstrInfo, etc. are combined into InitializeX86TargetMC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135812 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the registered target printing in version strings completely out ofChandler Carruth2011-07-22
| | | | | | | | | | | | | | | | | the Support library. Now its part of the TargetRegistry, and the three commands that care about this explicitly register this extra bit of version information. The set of commands which care was computed by intersecting those which use the Support library's version string printing and those that initialize all the registered targets in a way that produces a meaningful list. The only odd ball out is that 'clang -cc1as -version' no longer prints the registered targets. I don't think anyone is really interested in that (especially as the fact that llvm-mc does so is under a FIXME), but if someone really does want this back I'll happily apply the same patch there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135757 91177308-0d34-0410-b5e6-96231b3b80d8
* - Move CodeModel from a TargetMachine global option to MCCodeGenInfo.Evan Cheng2011-07-20
| | | | | | | | | - Introduce JITDefault code model. This tells targets to set different default code model for JIT. This eliminates the ugly hack in TargetMachine where code model is changed after construction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135580 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce MCCodeGenInfo, which keeps information that can affect codegenEvan Cheng2011-07-19
| | | | | | | | (including compilation, assembly). Move relocation model Reloc::Model from TargetMachine to MCCodeGenInfo so it's accessible even without TargetMachine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135468 91177308-0d34-0410-b5e6-96231b3b80d8
* LLC doesn't need to create MCInstrInfo's.Evan Cheng2011-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135369 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename createAsmInfo to createMCAsmInfo and move registration code to ↵Evan Cheng2011-07-14
| | | | | | MCTargetDesc to prepare for next round of changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135219 91177308-0d34-0410-b5e6-96231b3b80d8
* - Eliminate MCCodeEmitter's dependency on TargetMachine. It now uses MCInstrInfoEvan Cheng2011-07-11
| | | | | | | | | | | | | and MCSubtargetInfo. - Added methods to update subtarget features (used when targets automatically detect subtarget features or switch modes). - Teach X86Subtarget to update MCSubtargetInfo features bits since the MCSubtargetInfo layer can be shared with other modules. - These fixes .code 16 / .code 32 support since mode switch is updated in MCSubtargetInfo so MC code emitter can do the right thing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134884 91177308-0d34-0410-b5e6-96231b3b80d8
* Change createAsmParser to take a MCSubtargetInfo instead of triple,Evan Cheng2011-07-09
| | | | | | | | | | CPU, and feature string. Parsing some asm directives can change subtarget state (e.g. .code 16) and it must be reflected in other modules (e.g. MCCodeEmitter). That is, the MCSubtargetInfo instance must be shared. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134795 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the ridiculous SubtargetFeatures API where it implicitly expects CPU name toEvan Cheng2011-06-30
| | | | | | | | | | | be the first encoded as the first feature. It then uses the CPU name to look up features / scheduling itineray even though clients know full well the CPU name being used to query these properties. The fix is to just have the clients explictly pass the CPU name! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134127 91177308-0d34-0410-b5e6-96231b3b80d8
* Sink SubtargetFeature and TargetInstrItineraries (renamed ↵Evan Cheng2011-06-29
| | | | | | MCInstrItineraries) into MC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134049 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead option.Evan Cheng2011-05-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131947 91177308-0d34-0410-b5e6-96231b3b80d8
* Add all the plumbing needed for MC to expand cfi to the old tables inRafael Espindola2011-04-30
| | | | | | | the final assembly. It is the same technique used when targeting assemblers that don't support .loc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130587 91177308-0d34-0410-b5e6-96231b3b80d8
* llc: Fix a refacto, .loc support didn't work before 10.6.Daniel Dunbar2011-04-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129841 91177308-0d34-0410-b5e6-96231b3b80d8
* ADT/Triple: Renambe isOSX... methods to isMacOSX for consistency with the OSDaniel Dunbar2011-04-20
| | | | | | triple component. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129838 91177308-0d34-0410-b5e6-96231b3b80d8
* llc: Eliminate a use of getDarwinMajorNumber().Daniel Dunbar2011-04-19
| | | | | | | | | - As before, there is a minor semantic change here (evidenced by the test change) for Darwin triples that have no version component. I debated changing the default behavior of isOSVersionLT, but decided it made more sense for triples to be explicit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129805 91177308-0d34-0410-b5e6-96231b3b80d8
* Added *hidden* flags -print-options and -print-all-options soAndrew Trick2011-04-05
| | | | | | | | | | | | | | | | | | | | developers can see if their driver changed any cl::Option's. The current implementation isn't perfect but handles most kinds of options. This is nice to have when decomposing the stages of compilation and moving between different drivers. It's also a good sanity check when comparing results produced by different command line invocations that are expected to produce the comparable results. Note: This is not an attempt to prolong the life of cl::Option. On the contrary, it's a placeholder for a feature that must exist when cl::Option is replaced by a more appropriate framework. A new framework needs: a central option registry, dynamic name lookup, non-global containers of option values (e.g. per-module, per-function), *and* the ability to print options values and their defaults at any point during compilation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128910 91177308-0d34-0410-b5e6-96231b3b80d8
* whitespaceAndrew Trick2011-04-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128905 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable .loc support on older darwin OSes.Devang Patel2010-12-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120747 91177308-0d34-0410-b5e6-96231b3b80d8
* Add hiddent command line option, as an debugging aid, to disable .loc use.Devang Patel2010-12-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120575 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
* Move tool_output_file into its own file.Dan Gohman2010-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115973 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."Michael J. Spencer2010-09-13
| | | | | | | | | | This reverts commit r113632 Conflicts: cmake/modules/AddLLVM.cmake git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113819 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.Michael J. Spencer2010-09-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113632 91177308-0d34-0410-b5e6-96231b3b80d8
* Make tool_output_file's raw_ostream instance a member variable insteadDan Gohman2010-09-01
| | | | | | | | | | | of a base class. This makes it possible to unregister the file from FilesToRemove when the file is done. Also, this eliminates the need for formatted_tool_output_file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112706 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix llc to run the verifier once, not twice.Dan Gohman2010-08-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112532 91177308-0d34-0410-b5e6-96231b3b80d8
* Straighten out any triple strings passed on the command line beforeDuncan Sands2010-08-28
| | | | | | | they hit the rest of the system. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112344 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new tool_output_file in several tools. This fixes a varietyDan Gohman2010-08-20
| | | | | | | | | of problems with output files being left behind or output streams being left unclosed. Fix llvm-mc to respect the -o option in all modes, rather than hardcoding outs() in some cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111603 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate some redundancy by relying on raw_fd_ostream to handle "-"Dan Gohman2010-08-18
| | | | | | | properly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111373 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't translate "-" to outs() manually; raw_ostream does thatDan Gohman2010-08-18
| | | | | | | automatically. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111370 91177308-0d34-0410-b5e6-96231b3b80d8
* llc: Fix help typo as pointed out by Nick Lewycky.Michael J. Spencer2010-08-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110556 91177308-0d34-0410-b5e6-96231b3b80d8
* llc: Clarify -mc-relax-all description.Michael J. Spencer2010-08-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110477 91177308-0d34-0410-b5e6-96231b3b80d8
* llc: Add -mc-relax-all.Michael J. Spencer2010-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109954 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid calling outs() and fouts() when the stream isn't really needed.Dan Gohman2010-05-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104873 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the "WantsWholeFile" concept, as it's no longer needed. CBEDan Gohman2010-05-11
| | | | | | | | | and the others use the regular addPassesToEmitFile hook now, and llc no longer needs a bunch of redundant code to handle the whole-file case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103492 91177308-0d34-0410-b5e6-96231b3b80d8
* make -filetype=obj default to emitting its output to foo.obj Chris Lattner2010-05-06
| | | | | | | when on windows instead of foo.o. Patch by Nathan Jeffords! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103150 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead option.Daniel Dunbar2010-04-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102621 91177308-0d34-0410-b5e6-96231b3b80d8
* add .o file writing for inline asm in llc. Here's a sillyChris Lattner2010-04-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | demo: $ clang asm.c -S -o - -emit-llvm | llc -filetype=obj -o t.o <inline asm>:1:2: error: unrecognized instruction abc incl %eax ^ LLVM ERROR: Error parsing inline asm Only problem seems to be that the parser finalizes OutStreamer at the end of the first inline asm, which isn't what we want. For example: $ cat asm.c int foo(int X) { __asm__ ("incl %0" : "+r" (X)); return X; } $ clang asm.c -S -o - -emit-llvm | llc ... subq $8, %rsp movl %edi, (%rsp) movl %edi, %eax ## InlineAsm Start incl %eax ## InlineAsm End movl %eax, (%rsp) movl %eax, 4(%rsp) addq $8, %rsp ret $ clang asm.c -S -o - -emit-llvm | llc -filetype=obj -o t.o $ otool -tv t.o t.o: (__TEXT,__text) section _foo: 0000000000000000 subq $0x08,%rsp 0000000000000004 movl %edi,(%rsp) 0000000000000007 movl %edi,%eax 0000000000000009 incl %eax $ don't stop at inc! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100491 91177308-0d34-0410-b5e6-96231b3b80d8
* Trim #includes.Dan Gohman2010-03-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99416 91177308-0d34-0410-b5e6-96231b3b80d8
* llc doesn't need LinkAllVMCore.Dan Gohman2010-03-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99186 91177308-0d34-0410-b5e6-96231b3b80d8
* Make llc opt into the addPassesToEmitFile verify pass.Dan Gohman2010-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97502 91177308-0d34-0410-b5e6-96231b3b80d8
* change addPassesToEmitFile to return true on failure instead of its input,Chris Lattner2010-02-03
| | | | | | | | add -filetype=null for performance testing and remove -filetype=dynlib, which isn't planned to be implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95202 91177308-0d34-0410-b5e6-96231b3b80d8
* Hook up -filetype=obj through the MachO streamer. Here's a demo:Chris Lattner2010-02-02
| | | | | | | | | | | | | | | $ cat t.ll @g = global i32 42 $ llc t.ll -o t.o -filetype=obj $ nm t.o 00000000 D _g There is still a ton of work left. Instructions are not being encoded yet apparently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95162 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a bunch of stuff around the edges of the ELF writer.Chris Lattner2010-02-02
| | | | | | | | | Now the only use of the ELF writer is the JIT, which won't be easy to fix in the short term. :( :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95148 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate FileModel::Model, just use CodeGenFileType. The clientChris Lattner2010-02-02
| | | | | | | | of the code generator shouldn't care what object format a target uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95124 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate all forms of addPassesToEmitMachineCode exceptChris Lattner2010-02-02
| | | | | | | | | | the one used by the JIT. Remove all forms of addPassesToEmitFileFinish except the one used by the static code generator. Inline the remaining version of addPassesToEmitFileFinish into its only caller. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95109 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill the Mach-O writer, and temporarily make filetype=obj an error.Nate Begeman2010-02-01
| | | | | | | The MCStreamer based assemblers will take over for this functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95033 91177308-0d34-0410-b5e6-96231b3b80d8
* Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin2010-01-27
| | | | | | | | | | | | | | | | | | | | | | Modules and ModuleProviders. Because the "ModuleProvider" simply materializes GlobalValues now, and doesn't provide modules, it's renamed to "GVMaterializer". Code that used to need a ModuleProvider to materialize Functions can now materialize the Functions directly. Functions no longer use a magic linkage to record that they're materializable; they simply ask the GVMaterializer. Because the C ABI must never change, we can't remove LLVMModuleProviderRef or the functions that refer to it. Instead, because Module now exposes the same functionality ModuleProvider used to, we store a Module* in any LLVMModuleProviderRef and translate in the wrapper methods. The bindings to other languages still use the ModuleProvider concept. It would probably be worth some time to update them to follow the C++ more closely, but I don't intend to do it. Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94686 91177308-0d34-0410-b5e6-96231b3b80d8