summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Function.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Now Attributes are divided in three groupsDevang Patel2008-09-261-1/+1
| | | | | | | | | | | | | - return attributes - inreg, zext and sext - parameter attributes - function attributes - nounwind, readonly, readnone, noreturn Return attributes use 0 as the index. Function attributes use ~0U as the index. This patch requires corresponding changes in llvm-gcc and clang. llvm-svn: 56704
* Large mechanical patch.Devang Patel2008-09-251-20/+20
| | | | | | | | | | | | | | | s/ParamAttr/Attribute/g s/PAList/AttrList/g s/FnAttributeWithIndex/AttributeWithIndex/g s/FnAttr/Attribute/g This sets the stage - to implement function notes as function attributes and - to distinguish between function attributes and return value attributes. This requires corresponding changes in llvm-gcc and clang. llvm-svn: 56622
* s/ParamAttrsWithIndex/FnAttributeWithIndex/gDevang Patel2008-09-241-1/+1
| | | | llvm-svn: 56535
* s/ParameterAttributes/Attributes/gDevang Patel2008-09-231-5/+5
| | | | llvm-svn: 56513
* Use parameter attribute store (soon to be renamed) forDevang Patel2008-09-231-1/+0
| | | | | | Function Notes also. Function notes are stored at index ~0. llvm-svn: 56511
* Initialize function notes.Devang Patel2008-09-021-0/+2
| | | | llvm-svn: 55645
* Rename some GC classes so that their roll will hopefully be clearer.Gordon Henriksen2008-08-171-30/+32
| | | | | | | | | | | | | | | | | | In particular, Collector was confusing to implementors. Several thought that this compile-time class was the place to implement their runtime GC heap. Of course, it doesn't even exist at runtime. Specifically, the renames are: Collector -> GCStrategy CollectorMetadata -> GCFunctionInfo CollectorModuleMetadata -> GCModuleInfo CollectorRegistry -> GCRegistry Function::getCollector -> getGC (setGC, hasGC, clearGC) Several accessors and nested types have also been renamed to be consistent. These changes should be obvious. llvm-svn: 54899
* Added support for overloading intrinsics (atomics) based on pointersMon P Wang2008-07-301-2/+7
| | | | | | | to different address spaces. This alters the naming scheme for those intrinsics, e.g., atomic.load.add.i32 => atomic.load.add.i32.p0i32 llvm-svn: 54195
* Add some helpers for manipulating functionDuncan Sands2008-07-081-13/+7
| | | | | | parameter attributes. llvm-svn: 53228
* Wrap MVT::ValueType in a struct to get type safetyDuncan Sands2008-06-061-1/+1
| | | | | | | | | | | | | | | | and better control the abstraction. Rename the type to MVT. To update out-of-tree patches, the main thing to do is to rename MVT::ValueType to MVT, and rewrite expressions like MVT::getSizeInBits(VT) in the form VT.getSizeInBits(). Use VT.getSimpleVT() to extract a MVT::SimpleValueType for use in switch statements (you will get an assert failure if VT is an extended value type - these shouldn't exist after type legalization). This results in a small speedup of codegen and no new testsuite failures (x86-64 linux). llvm-svn: 52044
* Factor code to copy global value attributes likeDuncan Sands2008-05-261-0/+12
| | | | | | | | | | | | | | | the section or the visibility from one global value to another: copyAttributesFrom. This is particularly useful for duplicating functions: previously this was done by explicitly copying each attribute in turn at each place where a new function was created out of an old one, with the result that obscure attributes were regularly forgotten (like the collector or the section). Hopefully now everything is uniform and nothing is forgotten. llvm-svn: 51567
* Add functions to enable adding a single attribute to a function andEric Christopher2008-05-161-0/+6
| | | | | | its associated call site. llvm-svn: 51204
* Fix a bunch of 80col violations that arose from the Create API change. Tweak ↵Gabor Greif2008-05-151-1/+2
| | | | | | makefile targets to find these better. llvm-svn: 51143
* Make StripPointerCast a common function (should we mak it method of Value ↵Anton Korobeynikov2008-05-061-24/+0
| | | | | | instead?) llvm-svn: 50775
* Expose parameter attributes via C bindings.Gordon Henriksen2008-04-281-0/+11
| | | | | | Patch by Anders Johnsen! llvm-svn: 50360
* Convenience method for setting the nounwindDuncan Sands2008-04-081-0/+9
| | | | | | attribute for a function. llvm-svn: 49373
* Make sure that intrinsics automagically get theDuncan Sands2008-04-071-3/+5
| | | | | | | right parameter attributes no matter how they are obtained. llvm-svn: 49335
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-061-1/+1
| | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. llvm-svn: 49277
* move a bunch of trivial methods to be inline.Chris Lattner2008-03-131-36/+0
| | | | llvm-svn: 48326
* Reimplement the parameter attributes support, phase #1. hilights:Chris Lattner2008-03-121-31/+6
| | | | | | | | | | | | | | | | | | | | | | | 1. There is now a "PAListPtr" class, which is a smart pointer around the underlying uniqued parameter attribute list object, and manages its refcount. It is now impossible to mess up the refcount. 2. PAListPtr is now the main interface to the underlying object, and the underlying object is now completely opaque. 3. Implementation details like SmallVector and FoldingSet are now no longer part of the interface. 4. You can create a PAListPtr with an arbitrary sequence of ParamAttrsWithIndex's, no need to make a SmallVector of a specific size (you can just use an array or scalar or vector if you wish). 5. All the client code that had to check for a null pointer before dereferencing the pointer is simplified to just access the PAListPtr directly. 6. The interfaces for adding attrs to a list and removing them is a bit simpler. Phase #2 will rename some stuff (e.g. PAListPtr) and do other less invasive changes. llvm-svn: 48289
* s/isReturnStruct()/hasStructRetAttr()/gDevang Patel2008-03-031-4/+4
| | | | llvm-svn: 47857
* If a function uses multive values in ret instruction then itDevang Patel2008-03-031-1/+2
| | | | | | is returning a struct value. llvm-svn: 47848
* Split ParameterAttributes.h, putting the complicatedDale Johannesen2008-02-221-1/+1
| | | | | | | stuff into ParamAttrsList.h. Per feedback from ParamAttrs changes. llvm-svn: 47504
* Pass alignment on ByVal parameters, from FE, allDale Johannesen2008-02-221-0/+5
| | | | | | the way through. It is now used for codegen. llvm-svn: 47484
* Use isa<> instead of getTypeID() to check StructType.Devang Patel2008-02-211-1/+1
| | | | llvm-svn: 47460
* What if functions can return aggregate values ?Devang Patel2008-02-201-1/+2
| | | | | | One small step towards multiple return value support. llvm-svn: 47406
* Expand ParameterAttributes to 32 bits (in preparationDale Johannesen2008-02-191-3/+3
| | | | | | | for adding alignment info, not there yet). Clean up interfaces to reference ParameterAttributes consistently. llvm-svn: 47342
* I got the predicate backwards in my last patch. The comment is correct, the ↵Owen Anderson2008-02-181-1/+1
| | | | | | code was not. llvm-svn: 47264
* Duncan pointed out that we can fast fail here, because the sret parameter ofOwen Anderson2008-02-181-1/+2
| | | | | | a function must be the first parameter. llvm-svn: 47254
* Add a predicate to Argument to check for the StructRet attribute.Owen Anderson2008-02-171-0/+7
| | | | llvm-svn: 47248
* Add hasByValAttr() and hasNoAliasAttr() methods to the Argument class.Chris Lattner2008-01-241-0/+31
| | | | llvm-svn: 46314
* Remove the function attr cache for intrinsics. This does not maintain the Chris Lattner2008-01-031-7/+1
| | | | | | | refcount on these correctly, and can end up referring to deleted attributes. This fixes PR1881. llvm-svn: 45525
* Split param attr implementation out from Function.cpp into itsChris Lattner2008-01-021-213/+34
| | | | | | | own file. Don't #include ParameterAttributes.h into any major public header files: just move methods out of line as appropriate. llvm-svn: 45517
* Fix a build issue on cygwinChris Lattner2008-01-021-6/+3
| | | | llvm-svn: 45506
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* When inlining through an 'nounwind' call, mark inlinedDuncan Sands2007-12-191-0/+26
| | | | | | | | | calls 'nounwind'. It is important for correct C++ exception handling that nounwind markings do not get lost, so this transformation is actually needed for correctness. llvm-svn: 45218
* Change the PointerType api for creating pointer types. The old functionality ↵Christopher Lamb2007-12-171-1/+2
| | | | | | of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space. llvm-svn: 45082
* Delete the CollectorNamePool if it should become empty.Gordon Henriksen2007-12-101-0/+4
| | | | llvm-svn: 44775
* Adding a collector name attribute to Function in the IR. These Gordon Henriksen2007-12-101-0/+39
| | | | | | | | | | | | | | | | | | | | methods are new to Function: bool hasCollector() const; const std::string &getCollector() const; void setCollector(const std::string &); void clearCollector(); The assembly representation is as such: define void @f() gc "shadow-stack" { ... The implementation uses an on-the-side table to map Functions to collector names, such that there is no overhead. A StringPool is further used to unique collector names, which are extremely likely to be unique per process. llvm-svn: 44769
* Reverting dtor devirtualization patch.Gordon Henriksen2007-12-101-7/+6
| | | | | | | _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 llvm-svn: 44760
* Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!Gordon Henriksen2007-12-091-6/+7
| | | | llvm-svn: 44747
* Rather than having special rules like "intrinsics cannotDuncan Sands2007-12-031-4/+29
| | | | | | | | | throw exceptions", just mark intrinsics with the nounwind attribute. Likewise, mark intrinsics as readnone/readonly and get rid of special aliasing logic (which didn't use anything more than this anyway). llvm-svn: 44544
* Small optimization of parameter attribute lookup.Duncan Sands2007-11-301-1/+1
| | | | llvm-svn: 44458
* Add a convenience method for modifying parameterDuncan Sands2007-11-301-1/+59
| | | | | | | | attributes. While there, I noticed that not all attribute methods returned a pointer-to-constant, so I fixed that. llvm-svn: 44457
* Add some convenience methods for querying attributes, andDuncan Sands2007-11-281-7/+0
| | | | | | use them. llvm-svn: 44403
* Fix PR1146: parameter attributes are longer part ofDuncan Sands2007-11-271-5/+29
| | | | | | | | | | | | the function type, instead they belong to functions and function calls. This is an updated and slightly corrected version of Reid Spencer's original patch. The only known problem is that auto-upgrading of bitcode files doesn't seem to work properly (see test/Bitcode/AutoUpgradeIntrinsics.ll). Hopefully a bitcode guru (who might that be? :) ) will fix it. llvm-svn: 44359
* Fix PR1816. If a bitcast of a function only exists because of aDuncan Sands2007-11-251-1/+44
| | | | | | | | | trivial difference in function attributes, allow calls to it to be converted to direct calls. Based on a patch by Török Edwin. While there, move the various lists of mutually incompatible parameters etc out of the verifier and into ParameterAttributes.h. llvm-svn: 44315
* Rename the 'const' parameter attribute to 'readnone',Duncan Sands2007-11-221-4/+4
| | | | | | | and the 'pure' parameter attribute to 'readonly'. Names suggested by DannyB. llvm-svn: 44273
* In order for parameter attribute uniquing to makeDuncan Sands2007-11-201-2/+6
| | | | | | | | | | | | any sense it is important that ParamAttr::None gets treated the same as not supplying an attribute at all. Rather than stripping ParamAttr::None out of the list of attributes, assert if ParamAttr::None is seen. Fix up the bitcode reader which liked to insert ParamAttr::None all over the place. Patch based on one by Török Edwin. llvm-svn: 44250
* Add pure/const attributes. Documentation will follow.Anton Korobeynikov2007-11-141-0/+4
| | | | llvm-svn: 44109
OpenPOWER on IntegriCloud