summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/CBackend/CBackend.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove the C backend.Eric Christopher2012-03-231-3616/+0
| | | | llvm-svn: 153307
* llvm::SwitchInstStepan Dyatkovskiy2012-03-111-1/+1
| | | | | | | Renamed methods caseBegin, caseEnd and caseDefault with case_begin, case_end, and case_default. Added some notes relative to case iterators. llvm-svn: 152532
* Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:Stepan Dyatkovskiy2012-03-081-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*". ConstCaseIt is just a read-only iterator. CaseIt is read-write iterator; it allows to change case successor and case value. Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters. Main way of iterator usage looks like this: SwitchInst *SI = ... // intialize it somehow for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) { BasicBlock *BB = i.getCaseSuccessor(); ConstantInt *V = i.getCaseValue(); // Do something. } If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method. If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method. There are also related changes in llvm-clients: klee and clang. llvm-svn: 152297
* [unwind removal] We no longer have 'unwind' instructions being generated, soBill Wendling2012-02-061-3/+0
| | | | | | remove the code that handles them. llvm-svn: 149901
* reapply the patches reverted in r149470 that reenable ConstantDataArray,Chris Lattner2012-02-051-63/+11
| | | | | | | | | but with a critical fix to the SelectionDAG code that optimizes copies from strings into immediate stores: the previous code was stopping reading string data at the first nul. Address this by adding a new argument to llvm::getConstantStringInfo, preserving the behavior before the patch. llvm-svn: 149800
* SwitchInst refactoring.Stepan Dyatkovskiy2012-02-011-2/+2
| | | | | | | | | | | | | | | | | The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want. What was done: 1. Changed semantics of index inside the getCaseValue method: getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous. 2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned. 3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment. 4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst. 4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor. 4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor. Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang. llvm-svn: 149481
* Revert Chris' commits up to r149348 that started causing VMCoreTests unit ↵Argyrios Kyrtzidis2012-02-011-11/+63
| | | | | | | | | | | | | | | | | | | test to fail. These are: r149348 r149351 r149352 r149354 r149356 r149357 r149361 r149362 r149364 r149365 llvm-svn: 149470
* with recent changes, ConstantArray is never a "string". Remove the associatedChris Lattner2012-01-311-63/+11
| | | | | | methods and constant fold the clients to false. llvm-svn: 149362
* use the right accessor for ConstantDataArray.Chris Lattner2012-01-311-1/+1
| | | | llvm-svn: 149342
* C++, CBE, and TLOF support for ConstantDataSequentialChris Lattner2012-01-241-11/+69
| | | | llvm-svn: 148805
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-3/+0
| | | | llvm-svn: 148578
* Sink codegen optimization level into MCCodeGenInfo along side relocation modelEvan Cheng2011-11-161-1/+0
| | | | | | | and code model. This eliminates the need to pass OptLevel flag all over the place and makes it possible for any codegen pass to use this information. llvm-svn: 144788
* rename getHostTriple into getDefaultTargetTripleSebastian Pop2011-11-011-2/+2
| | | | llvm-svn: 143502
* Remove the old atomic instrinsics. autoupgrade functionality is included ↵Eli Friedman2011-10-061-4/+0
| | | | | | with this patch. llvm-svn: 141333
* Clean up uses of switch instructions so they are not dependent on the ↵Eli Friedman2011-09-291-4/+11
| | | | | | operand ordering. Patch by Stepan Dyatkovskiy. llvm-svn: 140803
* Move TargetRegistry and TargetSelect from Target to Support where they belong.Evan Cheng2011-08-241-1/+1
| | | | | | These are strictly utilities for registering targets and components. llvm-svn: 138450
* switch to the new struct apis.Chris Lattner2011-08-121-2/+2
| | | | llvm-svn: 137481
* Revert r137134. It breaks some code as Eli pointed out.Bill Wendling2011-08-091-1/+1
| | | | llvm-svn: 137135
* Print out the variable declaration only if it is a declaration. Otherwise, aBill Wendling2011-08-091-1/+1
| | | | | | | 'static' variable will be emitted twice. PR10081 llvm-svn: 137134
* Add the 'resume' instruction for the new EH rewrite.Bill Wendling2011-07-311-1/+3
| | | | | | | | | This adds the 'resume' instruction class, IR parsing, and bitcode reading and writing. The 'resume' instruction resumes propagation of an existing (in-flight) exception whose unwinding was interrupted with a 'landingpad' instruction (to be added later). llvm-svn: 136589
* Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,Bill Wendling2011-07-301-3/+1
| | | | | | | r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444, r136445, r136446, r136253 pending review. llvm-svn: 136556
* Merge the contents from exception-handling-rewrite to the mainline.Bill Wendling2011-07-271-1/+3
| | | | | | This adds the new instructions 'landingpad' and 'resume'. llvm-svn: 136253
* Move CBackend and CppBackend MC initialization to TargetInfo.Evan Cheng2011-07-251-2/+0
| | | | llvm-svn: 135982
* Combine all MC initialization routines into one. e.g. InitializeX86MCAsmInfo,Evan Cheng2011-07-221-9/+1
| | | | | | InitializeX86MCInstrInfo, etc. are combined into InitializeX86TargetMC. llvm-svn: 135812
* Goodbye TargetAsmInfo. This eliminate last bit of CodeGen and Target in llvm-mc.Evan Cheng2011-07-201-1/+1
| | | | | | | There is still a bit more refactoring left to do in Targets. But we are now very close to fixing all the layering issues in MC. llvm-svn: 135611
* Add MCObjectFileInfo and sink the MCSections initialization code fromEvan Cheng2011-07-201-3/+6
| | | | | | | | TargetLoweringObjectFileImpl down to MCObjectFileInfo. TargetAsmInfo is done to one last method. It's *almost* gone! llvm-svn: 135569
* Introduce MCCodeGenInfo, which keeps information that can affect codegenEvan Cheng2011-07-191-0/+2
| | | | | | | (including compilation, assembly). Move relocation model Reloc::Model from TargetMachine to MCCodeGenInfo so it's accessible even without TargetMachine. llvm-svn: 135468
* Sink getDwarfRegNum, getLLVMRegNum, getSEHRegNum from TargetRegisterInfo downEvan Cheng2011-07-181-2/+8
| | | | | | | | | to MCRegisterInfo. Also initialize the mapping at construction time. This patch eliminate TargetRegisterInfo from TargetAsmInfo. It's another step towards fixing the layering violation. llvm-svn: 135424
* Migrate LLVM and Clang to use the new makeArrayRef(...) functions where ↵Frits van Bommel2011-07-181-2/+2
| | | | | | | | previously explicit non-default constructors were used. Mostly mechanical with some manual reformatting. llvm-svn: 135390
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-64/+64
| | | | llvm-svn: 135375
* Rename createAsmInfo to createMCAsmInfo and move registration code to ↵Evan Cheng2011-07-141-8/+6
| | | | | | MCTargetDesc to prepare for next round of changes. llvm-svn: 135219
* Convert InsertValueInst and ExtractValueInst APIs to use ArrayRef.Jay Foad2011-07-131-2/+4
| | | | llvm-svn: 135040
* - Eliminate MCCodeEmitter's dependency on TargetMachine. It now uses MCInstrInfoEvan Cheng2011-07-111-0/+5
| | | | | | | | | | | | 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. llvm-svn: 134884
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-091-161/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch brings numerous advantages to LLVM. One way to look at it is through diffstat: 109 files changed, 3005 insertions(+), 5906 deletions(-) Removing almost 3K lines of code is a good thing. Other advantages include: 1. Value::getType() is a simple load that can be CSE'd, not a mutating union-find operation. 2. Types a uniqued and never move once created, defining away PATypeHolder. 3. Structs can be "named" now, and their name is part of the identity that uniques them. This means that the compiler doesn't merge them structurally which makes the IR much less confusing. 4. Now that there is no way to get a cycle in a type graph without a named struct type, "upreferences" go away. 5. Type refinement is completely gone, which should make LTO much MUCH faster in some common cases with C++ code. 6. Types are now generally immutable, so we can use "Type *" instead "const Type *" everywhere. Downsides of this patch are that it removes some functions from the C API, so people using those will have to upgrade to (not yet added) new API. "LLVM 3.0" is the right time to do this. There are still some cleanups pending after this, this patch is large enough as-is. llvm-svn: 134829
* Change createAsmParser to take a MCSubtargetInfo instead of triple,Evan Cheng2011-07-091-0/+5
| | | | | | | | | 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. llvm-svn: 134795
* Add support for sadd.with.overflow and uadd.with.overflow intrinsics to the ↵Anna Zaks2011-06-211-20/+154
| | | | | | CBackend by emitting definitions for each intrinsic that occurs in the module. llvm-svn: 133522
* Anna's test commit (#2).Anna Zaks2011-06-141-1/+1
| | | | llvm-svn: 133023
* Anna's test commit.Anna Zaks2011-06-141-1/+1
| | | | llvm-svn: 133017
* Fix a source of non determinism in FindUsedTypes, use a SetVector instead of aJulien Lerouge2011-05-131-5/+4
| | | | | | | | set. rdar://9423996 llvm-svn: 131283
* Remove some support for ReturnInsts with multiple operands, and forJay Foad2011-04-041-18/+0
| | | | | | | returning a scalar value in a function whose return type is a single- element structure or array. llvm-svn: 128810
* Fixed version of 121434 with no new memory leaks.Rafael Espindola2010-12-101-1/+1
| | | | llvm-svn: 121471
* Revert my previous patch to make the valgrind bots happy.Rafael Espindola2010-12-101-1/+1
| | | | llvm-svn: 121461
* Initial support for the cfi directives. This is just enough to getRafael Espindola2010-12-091-1/+1
| | | | | | | | | | | f: .cfi_startproc nop .cfi_endproc assembled (on ELF). llvm-svn: 121434
* I swear I did a make clean and make before committing all this...Michael J. Spencer2010-11-291-1/+1
| | | | llvm-svn: 120304
* Inline asm multiple alternative constraints development phase 2 - improved ↵John Thompson2010-10-291-4/+4
| | | | | | basic logic, added initial platform support. llvm-svn: 117667
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-191-1/+4
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* CBackend: Fix MSVC build.Michael J. Spencer2010-09-141-0/+4
| | | | | | This may produce warnings on MSVS, but it's better than failures. llvm-svn: 113834
* CBackend: Cleanup whitespace before I do this next commit.Michael J. Spencer2010-09-141-155/+155
| | | | llvm-svn: 113833
* Add X86 MMX type to bitcode and Type.Dale Johannesen2010-09-101-1/+5
| | | | | | | (The Ada bindings probably need it too, but all the obvious places to change say "do not edit this file".) llvm-svn: 113618
* remove dead protoChris Lattner2010-08-261-1/+0
| | | | llvm-svn: 112131
OpenPOWER on IntegriCloud