Home | History | Annotate | Download | only in IR

Lines Matching defs:Function

1 //===-- Function.cpp - Implement the Global object classes ----------------===//
10 // This file implements the Function class for the IR library.
14 #include "llvm/IR/Function.h"
36 template class llvm::SymbolTableListTraits<Argument, Function>;
37 template class llvm::SymbolTableListTraits<BasicBlock, Function>;
45 Argument::Argument(Type *Ty, const Twine &Name, Function *Par)
49 // Make sure that we get added to a function
57 void Argument::setParent(Function *parent) {
66 /// function. For example in "void foo(int a, float b)" a is 0 and b is 1.
68 const Function *F = getParent();
69 assert(F && "Argument is not in a function");
71 Function::const_arg_iterator AI = F->arg_begin();
80 /// in its containing function.
94 /// it in its containing function.
102 /// it in its containing function.
110 /// on it in its containing function.
118 /// it in its containing function.
128 /// it in its containing function.
135 /// in its containing function.
164 // Helper Methods in Function
167 LLVMContext &Function::getContext() const {
171 FunctionType *Function::getFunctionType() const {
175 bool Function::isVarArg() const {
179 Type *Function::getReturnType() const {
183 void Function::removeFromParent() {
187 void Function::eraseFromParent() {
192 // Function Implementation
195 Function::Function(FunctionType *Ty, LinkageTypes Linkage,
203 // If the function has arguments, mark them as lazily built.
207 // Make sure that we get added to a function
219 Function::~Function() {
226 // Remove the function from the on-the-side GC table.
234 void Function::BuildLazyArguments() const {
245 const_cast<Function*>(this)->setValueSubclassData(SDC &= ~1);
248 size_t Function::arg_size() const {
251 bool Function::arg_empty() const {
255 void Function::setParent(Module *parent) {
263 // dropAllReferences() - This function causes all the subinstructions to "let
271 void Function::dropAllReferences() {
281 void Function::addAttribute(unsigned i, Attribute::AttrKind attr) {
287 void Function::addAttributes(unsigned i, AttributeSet attrs) {
293 void Function::removeAttributes(unsigned i, AttributeSet attrs) {
299 // Maintain the GC name for each function in an on-the-side table. This saves
300 // allocating an additional word in Function for programs which do not use GC
303 static DenseMap<const Function*,PooledStringPtr> *GCNames;
307 bool Function::hasGC() const {
312 const char *Function::getGC() const {
313 assert(hasGC() && "Function has no collector");
318 void Function::setGC(const char *Str) {
323 GCNames = new DenseMap<const Function*,PooledStringPtr>();
327 void Function::clearGC() {
343 /// create a Function) from the Function Src to this one.
344 void Function::copyAttributesFrom(const GlobalValue *Src) {
345 assert(isa<Function>(Src) && "Expected a Function!");
347 const Function *SrcF = cast<Function>(Src);
357 /// function, or Intrinsic::not_intrinsic if the function is not an
359 /// zero to allow easy checking for whether a function is intrinsic or not. The
364 unsigned Function::getIntrinsicID() const {
381 unsigned Function::lookupIntrinsicID() const {
417 /// getIntrinsicInfoTableEntries function.
666 Function *Intrinsic::getDeclaration(Module *M, ID id, ArrayRef<Type*> Tys) {
670 cast<Function>(M->getOrInsertFunction(getName(id, Tys),
679 /// hasAddressTaken - returns true if there are any uses of this function
681 bool Function::hasAddressTaken(const User* *PutOffender) const {
695 bool Function::isDefTriviallyDead() const {
701 // Check if the function is used by anything other than a blockaddress.
709 /// callsFunctionThatReturnsTwice - Return true if the function has a call to
710 /// setjmp or other function that gcc recognizes as "returning twice".
711 bool Function::callsFunctionThatReturnsTwice() const {