aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/User.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove some dead functions, patch by Ryan Flynn!Chris Lattner2009-07-141-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75664 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the Win32 VS2008 build:Sebastian Redl2009-03-191-0/+4
| | | | | | | | | | - Make type declarations match the struct/class keyword of the definition. - Move AddSignalHandler into the namespace where it belongs. - Correctly call functions from template base. - Some other small changes. With this patch, LLVM and Clang should build properly and with far less noise under VS2008. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67347 91177308-0d34-0410-b5e6-96231b3b80d8
* Rearrange operands of the BranchInst, to be able toGabor Greif2009-03-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | access each with a fixed negative index from op_end(). This has two important implications: - getUser() will work faster, because there are less iterations for the waymarking algorithm to perform. This is important when running various analyses that want to determine callers of basic blocks. - getSuccessor() now runs faster, because the indirection via OperandList is not necessary: Uses corresponding to the successors are at fixed offset to "this". The price we pay is the slightly more complicated logic in the operator User::delete, as it has to pick up the information whether it has to free the memory of an original unconditional BranchInst or a BranchInst that was originally conditional, but has been shortened to unconditional. I was not able to come up with a nicer solution to this problem. (And rest assured, I tried *a lot*). Similar reorderings will follow for InvokeInst and CallInst. After that some optimizations to pred_iterator and CallSite will fall out naturally. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66815 91177308-0d34-0410-b5e6-96231b3b80d8
* Give Op<N>() AppleScript-like semantics, i.e. for negative N it indexes ↵Gabor Greif2009-03-101-4/+9
| | | | | | | | relative to op_end. This is a preliminary to changes to come. No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66593 91177308-0d34-0410-b5e6-96231b3b80d8
* make the Op<N> methods protected, how it was intended to beGabor Greif2009-03-091-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66430 91177308-0d34-0410-b5e6-96231b3b80d8
* fix and clean up a commentGabor Greif2009-02-211-5/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65212 91177308-0d34-0410-b5e6-96231b3b80d8
* add accessorsChris Lattner2009-01-311-0/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63478 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not allow a user to set the operand for a constant.Tanya Lattner2008-10-281-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58335 91177308-0d34-0410-b5e6-96231b3b80d8
* Move some documentation from the header file into ProgrammersManual. About ↵Gabor Greif2008-06-161-165/+0
| | | | | | to improve. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52360 91177308-0d34-0410-b5e6-96231b3b80d8
* op_iterator-ify dropAllReferencesGabor Greif2008-06-111-5/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52215 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress warnings about missing placement delete. This should now be ↵Gabor Greif2008-05-221-0/+5
| | | | | | std-conformant even if compiled with exceptions on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51429 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove warnings about unused parameters and shadowed variables.Bill Wendling2008-05-191-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51266 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the operator new and operator delete out of line. This fixes an issue withNate Begeman2008-05-151-17/+2
| | | | | | | | operator new() referring to the static initTags function, which has to be in the same linkage unit as any file including User.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51136 91177308-0d34-0410-b5e6-96231b3b80d8
* merge of use-diet branch to trunkGabor Greif2008-05-101-6/+236
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50943 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix more -Wshorten-64-to-32 warnings.Evan Cheng2008-05-051-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50659 91177308-0d34-0410-b5e6-96231b3b80d8
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-061-1/+5
| | | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49277 91177308-0d34-0410-b5e6-96231b3b80d8
* To support multiple return values, now ret instruction supports multiple ↵Devang Patel2008-02-231-2/+3
| | | | | | operands instead of one aggregate operand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47508 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't attribute in file headers anymore. See llvmdev for theChris Lattner2007-12-291-2/+2
| | | | | | | | discussion of this change. Boy are my fingers tired. ;-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting dtor devirtualization patch.Gordon Henriksen2007-12-101-4/+0
| | | | | | | _sabre_: it has a major problem: by the time ~Value is run, all of the "parts" of the derived classes have been destroyed _sabre_: the vtable lives to fight another day git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44760 91177308-0d34-0410-b5e6-96231b3b80d8
* Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!Gordon Henriksen2007-12-091-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44747 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch ValueSymbolTable to use StringMap<Value*> instead of ↵Chris Lattner2007-02-121-4/+2
| | | | | | | | | | std::map<std::string, Value*> as its main datastructure. There are many improvements yet to be made, but this speeds up opt --std-compile-opts on 447.dealII by 7.3%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34193 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the definition of value_use_iterator::getOperandNo to User.h where theChris Lattner2006-05-081-0/+7
| | | | | | | | definition of the User class is available, this fixes the build with some compiler versions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28163 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-211-7/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21408 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix spelling, patch contributed by Gabor GreifChris Lattner2005-02-271-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20342 91177308-0d34-0410-b5e6-96231b3b80d8
* Instead of storing operands as std::vector<Use>, just maintain a pointerChris Lattner2005-01-291-32/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and num operands in the User class. this allows us to embed the operands directly in the subclasses if possible. For example, for binary operators we store the two operands in the derived class. The has several effects: 1. it improves locality because the operands and instruction are together 2. it makes accesses to operands faster (one less load) if you access them through the derived class pointer. For example this: Value *GetBinaryOperatorOp(BinaryOperator *I, int i) { return I->getOperand(i); } Was compiled to: _Z19GetBinaryOperatorOpPN4llvm14BinaryOperatorEi: movl 4(%esp), %edx movl 8(%esp), %eax sall $4, %eax movl 24(%edx), %ecx addl %ecx, %eax movl (%eax), %eax ret and is now compiled to: _Z19GetBinaryOperatorOpPN4llvm14BinaryOperatorEi: movl 8(%esp), %eax movl 4(%esp), %edx sall $4, %eax addl %edx, %eax movl 44(%eax), %eax ret Accesses through "Instruction*" are unmodified. 3. This reduces memory consumption (by about 3%) by eliminating 1 word of vector overhead and a malloc header on a seperate object. 4. This speeds up gccas about 10% (both debug and release builds) on large things (such as 176.gcc). For example, it takes a debug build from 172.9 -> 155.6s and a release gccas from 67.7 -> 61.8s git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19883 91177308-0d34-0410-b5e6-96231b3b80d8
* Warning fixes for VC++, contributed by Morten Ofstad!Chris Lattner2004-11-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17831 91177308-0d34-0410-b5e6-96231b3b80d8
* bug 122:Reid Spencer2004-07-171-2/+1
| | | | | | | Remove redundancy in User::classof(Value*); GlobalValue isa Constant now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14924 91177308-0d34-0410-b5e6-96231b3b80d8
* Make ctor inline, change ValueTy ->unsignedChris Lattner2004-06-271-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14430 91177308-0d34-0410-b5e6-96231b3b80d8
* Consider anything with a ValueType that is >= Instruction to be an instructionChris Lattner2004-06-261-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14429 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes for PR114: Thanks to Reid Spencer!Chris Lattner2003-11-161-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10029 91177308-0d34-0410-b5e6-96231b3b80d8
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-111-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
* Added LLVM copyright header (for lack of a better term).John Criswell2003-10-201-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9304 91177308-0d34-0410-b5e6-96231b3b80d8
* lalalaChris Lattner2003-10-151-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9146 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new op_erase methodChris Lattner2003-10-131-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9068 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a method to reserve space for operandsChris Lattner2003-10-091-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8992 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded dtorsChris Lattner2003-10-061-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8896 91177308-0d34-0410-b5e6-96231b3b80d8
* Standardize header file commentsChris Lattner2003-09-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8782 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a ton of extraneous #includesChris Lattner2003-06-221-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6842 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new op_erase methodChris Lattner2003-06-171-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6757 91177308-0d34-0410-b5e6-96231b3b80d8
* Included assert.h so that the code compiles under newer versions of GCC.John Criswell2003-06-111-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6682 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't require the user to do something like isa<foo>(II->get()). The ->getChris Lattner2003-05-291-0/+20
| | | | | | | should be implicit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6395 91177308-0d34-0410-b5e6-96231b3b80d8
* - Remove the User::eraseOperand method which is never used, reallyChris Lattner2002-10-011-4/+0
| | | | | | | dangerous, and not something we want to expose. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4007 91177308-0d34-0410-b5e6-96231b3b80d8
* Add routines to update or erase operands (and to do so without externalVikram S. Adve2002-09-161-0/+4
| | | | | | | assumptions about which operand number stores what operand). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3750 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert comments to Doxygen styleChris Lattner2002-08-251-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3507 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneccesary methodChris Lattner2002-08-221-4/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3452 91177308-0d34-0410-b5e6-96231b3b80d8
* Add method copyOperands().Vikram S. Adve2002-08-221-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3445 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a misguided API extensionChris Lattner2002-03-211-10/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1926 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes to build successfully with GCC 3.02Chris Lattner2002-01-201-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1503 91177308-0d34-0410-b5e6-96231b3b80d8
* Renamed inst_const_iterator -> const_inst_iteratorChris Lattner2001-12-041-3/+3
| | | | | | | | Renamed op_const_iterator -> const_op_iterator Renamed PointerType::getValueType() -> PointerType::getElementType() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1408 91177308-0d34-0410-b5e6-96231b3b80d8
* Add classof implementations for UserChris Lattner2001-10-131-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@739 91177308-0d34-0410-b5e6-96231b3b80d8