summaryrefslogtreecommitdiff
path: root/include/llvm/Function.h
Commit message (Collapse)AuthorAge
* Use the Attributes::get method which takes an AttrVal value directly to ↵Bill Wendling2012-10-16
| | | | | | simplify the code a bit. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166009 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the Attributes::Builder outside of the Attributes class and into its ↵Bill Wendling2012-10-15
| | | | | | own class named AttrBuilder. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165960 91177308-0d34-0410-b5e6-96231b3b80d8
* Attributes RewriteBill Wendling2012-10-15
| | | | | | | | | | | Convert the internal representation of the Attributes class into a pointer to an opaque object that's uniqued by and stored in the LLVMContext object. The Attributes class then becomes a thin wrapper around this opaque object. Eventually, the internal representation will be expanded to include attributes that represent code generation options, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165917 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary classof()'sSean Silva2012-10-11
| | | | | | | isa<> et al. automatically infer when the cast is an upcast (including a self-cast), so these are no longer necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165767 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass into the AttributeWithIndex::get method an ArrayRef of attributeBill Wendling2012-10-10
| | | | | | | enums. These are then created via the correct Attributes creation method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165607 91177308-0d34-0410-b5e6-96231b3b80d8
* Have 'addFnAttr' take the attribute enum value. Then have it build the ↵Bill Wendling2012-10-10
| | | | | | attribute object and add it appropriately. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165595 91177308-0d34-0410-b5e6-96231b3b80d8
* Create enums for the different attributes.Bill Wendling2012-10-09
| | | | | | | | We use the enums to query whether an Attributes object has that attribute. The opaque layer is responsible for knowing where that specific attribute is stored. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165488 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some dead methods.Bill Wendling2012-10-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165485 91177308-0d34-0410-b5e6-96231b3b80d8
* Add function to return return attributes.Bill Wendling2012-10-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165164 91177308-0d34-0410-b5e6-96231b3b80d8
* Buildbot Fix.Bill Wendling2012-09-26
| | | | | | | | | This method can be called with a '0' argument which checks the return value. However, the method it calls doesn't expect '0' as a valid value. Call the correct method when it's 0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164735 91177308-0d34-0410-b5e6-96231b3b80d8
* Query the parameter attributes directly instead of using the Attribute symbols.Bill Wendling2012-09-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164727 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the `hasFnAttr' method from Function.Bill Wendling2012-09-26
| | | | | | | | The hasFnAttr method has been replaced by querying the Attributes explicitly. No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164725 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark unimplemented copy constructors and copy assignment operators as ↵Craig Topper2012-09-17
| | | | | | LLVM_DELETED_FUNCTION. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164017 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach Function::hasAddressTaken that BlockAddress doesn't really takeJay Foad2012-05-12
| | | | | | the address of a function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156703 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] Drop verbose _ATTRIBUTE from LLVM_ATTRIBUTE_{READONLY,READNONE} macroDaniel Dunbar2012-03-09
| | | | | | names. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152413 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor code from inlining and globalopt that checks whether a function ↵Eli Friedman2011-10-20
| | | | | | definition is unused, and enhance it so it can tell that functions which are only used by a blockaddress are in fact dead. This probably doesn't happen much on most code, but the Linux kernel's _THIS_IP_ can trigger this issue with blockaddress. (GlobalDCE can also handle the given tescase, but we only run that at -O3.) Found while looking at PR11180. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142572 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct over-zealous removal of hack.Bill Wendling2011-10-17
| | | | | | | | Some code want to check that *any* call within a function has the 'returns twice' attribute, not just that the current function has one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142221 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that we have the ReturnsTwice function attribute, this method isBill Wendling2011-10-17
| | | | | | | | obsolete. Check the attribute instead. <rdar://problem/8031714> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142212 91177308-0d34-0410-b5e6-96231b3b80d8
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
* consolidate GlobalValue::isDeclaration into one Chris Lattner2011-07-14
| | | | | | | non-virtual function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135163 91177308-0d34-0410-b5e6-96231b3b80d8
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some issues Duncan found in the previous commit.Rafael Espindola2011-05-25
| | | | | | | | I kept the reference to the ABI since that is the common case. The -fno-asynchronous-unwind-tables option is a user controlled way of breaking the ABI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132053 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the -unwind-tables option with a per function flag. This is moreRafael Espindola2011-05-25
| | | | | | | LTO friendly as we can now correctly merge files compiled with or without -fasynchronous-unwind-tables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132033 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't do tail calls in a function that call setjmp. The stack might beRafael Espindola2011-05-16
| | | | | | corrupted when setjmp returns again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131399 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch attribute macros to use 'LLVM_' as a prefix. We retain the old namesChandler Carruth2010-10-23
| | | | | | | until other LLVM projects using these are cleaned up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117200 91177308-0d34-0410-b5e6-96231b3b80d8
* Finally land the InvokeInst operand reordering.Gabor Greif2010-03-24
| | | | | | | | | | | | | I have audited all getOperandNo calls now, fixing hidden assumptions. CallSite related uglyness will be eliminated successively. Note this patch has a long and griveous history, for all the back-and-forths have a look at CallSite.h's log. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99399 91177308-0d34-0410-b5e6-96231b3b80d8
* back this out for now. Growing Function is not good.Jim Grosbach2010-01-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94097 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure that landing pad entries in the EH call site table are in the properJim Grosbach2010-01-21
| | | | | | order for SjLj style exception handling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94055 91177308-0d34-0410-b5e6-96231b3b80d8
* add a layer of accessors around the Value::SubClassData member, and use Chris Lattner2009-12-29
| | | | | | | | | | | | | a convention (shadowing the setter with private forwarding function) to prevent subclasses from accidentally using it. This exposed some bogosity in ConstantExprs, which was propaging the opcode of the constant expr into the NUW/NSW/Exact field in the getWithOperands/getWithOperandReplaced methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92239 91177308-0d34-0410-b5e6-96231b3b80d8
* mark getIntrinsicID() 'readonly'. This allows various classof methods Chris Lattner2009-11-15
| | | | | | | | | | (like DbgDeclareInst's) to shrink substantially. It sucks that we have to pull Compiler.h into such a public header, but at least Compiler.h doesn't pull anything else in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88863 91177308-0d34-0410-b5e6-96231b3b80d8
* Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.Sandeep Patel2009-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80773 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove all the LLVM_COMPACTIFY_SENTINELS-related macro magic as discussed ↵Gabor Greif2009-08-26
| | | | | | with Chris on IRC. Anybody wanting to debug sentinel dereferencing problems must revert this patch and perform the indicated modifications. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80128 91177308-0d34-0410-b5e6-96231b3b80d8
* re-committing yesterday's r79938.Gabor Greif2009-08-25
| | | | | | | | | | | | This time there is no additional include of llvm/Config/config.h at all. Instead I use a hard-coded preprecessor symbol: LLVM_COMPACTIFY_SENTINELS (should this work on the self-hosting buildbot, then cleanups come next) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80035 91177308-0d34-0410-b5e6-96231b3b80d8
* --- Reverse-merging r79938 into '.':Bill Wendling2009-08-25
| | | | | | | | | | | | | | | U include/llvm/BasicBlock.h U include/llvm/ADT/ilist_node.h U include/llvm/ADT/ilist.h U include/llvm/CodeGen/SelectionDAG.h U include/llvm/CodeGen/MachineFunction.h U include/llvm/CodeGen/MachineBasicBlock.h U include/llvm/Function.h Revert r79938. It was causing self-hosting build failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79960 91177308-0d34-0410-b5e6-96231b3b80d8
* Resubmit an earlier patch of mine:Gabor Greif2009-08-24
| | | | | | | | | | | | | | | | | | | | | | reduce the size of relevant "ghostly" sentinels by a pointer. This attempt now makes the compactification dependent on the configure variable LLVM_COMPACT_SENTINELS and should not cause any bootstrap failures for llvm-gcc any more. Please note that this is not yet the final version, and (as settled with Chris) I shall take out the autofoo/cmake portions in the next days. This will also lose the assertability on sentinel dereferencing and operator++, but that seems an acceptable price to pay for the simplified build logic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79938 91177308-0d34-0410-b5e6-96231b3b80d8
* Make LLVMContext and LLVMContextImpl classes instead of structs.Benjamin Kramer2009-08-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78690 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor some of the constants+context related code out into a separate ↵Owen Anderson2009-08-04
| | | | | | | | | header, to make LLVMContextImpl.h not hideous. Also, fix some MSVC compile errors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78115 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r77654 with a fix: MachineFunctionPass's getAnalysisUsageDan Gohman2009-07-31
| | | | | | | | | shouldn't do AU.setPreservesCFG(), because even though CodeGen passes don't modify the LLVM IR CFG, they may modify the MachineFunction CFG, and passes like MachineLoop are registered with isCFGOnly set to true. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77691 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r77654, it appears to be causing llvm-gcc bootstrap failures, and manyDaniel Dunbar2009-07-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | failures when building assorted projects with clang. --- Reverse-merging r77654 into '.': U include/llvm/CodeGen/Passes.h U include/llvm/CodeGen/MachineFunctionPass.h U include/llvm/CodeGen/MachineFunction.h U include/llvm/CodeGen/LazyLiveness.h U include/llvm/CodeGen/SelectionDAGISel.h D include/llvm/CodeGen/MachineFunctionAnalysis.h U include/llvm/Function.h U lib/Target/CellSPU/SPUISelDAGToDAG.cpp U lib/Target/PowerPC/PPCISelDAGToDAG.cpp U lib/CodeGen/LLVMTargetMachine.cpp U lib/CodeGen/MachineVerifier.cpp U lib/CodeGen/MachineFunction.cpp U lib/CodeGen/PrologEpilogInserter.cpp U lib/CodeGen/MachineLoopInfo.cpp U lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp D lib/CodeGen/MachineFunctionAnalysis.cpp D lib/CodeGen/MachineFunctionPass.cpp U lib/CodeGen/LiveVariables.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77661 91177308-0d34-0410-b5e6-96231b3b80d8
* Manage MachineFunctions with an analysis Pass instead of the AnnotableDan Gohman2009-07-31
| | | | | | | | mechanism. To support this, make MachineFunctionPass a little more complete. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77654 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial update to VMCore to use Twines for string arguments.Daniel Dunbar2009-07-25
| | | | | | | | - The only meat here is in Value.{h,cpp} the rest is essential 'const std::string &' -> 'const Twine &'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77048 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of the Pass+Context magic.Owen Anderson2009-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76702 91177308-0d34-0410-b5e6-96231b3b80d8
* "LLVMContext* " --> "LLVMContext *"Owen Anderson2009-07-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74878 91177308-0d34-0410-b5e6-96231b3b80d8
* More LLVMContext-ification.Owen Anderson2009-07-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74807 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an accessor to Function so that Passes can easily get access to the context.Owen Anderson2009-07-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74714 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement and use new method Function::hasAddressTaken().Jay Foad2009-06-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73164 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r67844. This fixes the llvm-gcc-4.2 build on Darwin.Dan Gohman2009-03-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67856 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r66415, which was reverted in r66426 forDuncan Sands2009-03-27
| | | | | | | | | | causing a bootstrap failure. Bootstraps here on x86-32-linux and x86-64-linux. Requested by the author Gabor Greif who says that a bug that might have been causing the failure has since been fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67844 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r66415. It's causing failures during bootstrap builds:Bill Wendling2009-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://developer.apple.com/bugreporter> for instructions. /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c: In function '__muldi3': /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c:567: internal compiler error: Bus error Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://developer.apple.com/bugreporter> for instructions. /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c: In function '__lshrdi3': /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c:421: internal compiler error: Bus error Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://developer.apple.com/bugreporter> for instructions. make[5]: *** [libgcc/./_lshrdi3.o] Error 1 make[5]: *** Waiting for unfinished jobs.... make[5]: *** [libgcc/./_muldi3.o] Error 1 make[5]: *** [libgcc/./_negdi2.o] Error 1 --- Reverse-merging (from foreign repository) r66415 into '.': U include/llvm/BasicBlock.h U include/llvm/ADT/ilist_node.h U include/llvm/CodeGen/SelectionDAG.h U include/llvm/CodeGen/MachineFunction.h U include/llvm/CodeGen/MachineBasicBlock.h U include/llvm/Function.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66426 91177308-0d34-0410-b5e6-96231b3b80d8
* in builds without asserts we do not need to allocate the Next pointer in ↵Gabor Greif2009-03-09
| | | | | | "ghostly" sentinels git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66415 91177308-0d34-0410-b5e6-96231b3b80d8