//
// The LLVM Compiler Infrastructure
//
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
#include "llvm/GlobalValue.h"
#include "llvm/BasicBlock.h"
#include "llvm/Argument.h"
-#include "llvm/ParameterAttributes.h"
#include "llvm/Support/Annotation.h"
namespace llvm {
};
class Function : public GlobalValue, public Annotable {
-protected:
- static void destroyThis(Function*v);
- friend class Value;
public:
typedef iplist<Argument> ArgumentListType;
typedef iplist<BasicBlock> BasicBlockListType;
BuildLazyArguments();
}
void BuildLazyArguments() const;
+
+ Function(const Function&); // DO NOT IMPLEMENT
+ void operator=(const Function&); // DO NOT IMPLEMENT
public:
/// Function ctor - If the (optional) Module argument is specified, the
/// function is automatically inserted into the end of the function list for
///
Function(const FunctionType *Ty, LinkageTypes Linkage,
const std::string &N = "", Module *M = 0);
+ ~Function();
const Type *getReturnType() const; // Return the type of the ret val
const FunctionType *getFunctionType() const; // Return the FunctionType for me
/// @brief Set the parameter attributes.
void setParamAttrs(const ParamAttrsList *attrs);
+ /// hasCollector/getCollector/setCollector/clearCollector - The name of the
+ /// garbage collection algorithm to use during code generation.
+ bool hasCollector() const;
+ const char *getCollector() const;
+ void setCollector(const char *Str);
+ void clearCollector();
+
/// @brief Determine whether the function has the given attribute.
- bool paramHasAttr(uint16_t i, ParameterAttributes attr) const {
- return ParamAttrs && ParamAttrs->paramHasAttr(i, attr);
- }
+ bool paramHasAttr(uint16_t i, unsigned attr) const;
+
+ /// @brief Determine if the function cannot return.
+ bool doesNotReturn() const;
+
+ /// @brief Determine if the function cannot unwind.
+ bool doesNotThrow() const;
/// @brief Determine if the function does not access memory.
- bool doesNotAccessMemory() const {
- return paramHasAttr(0, ParamAttr::ReadNone);
- }
+ bool doesNotAccessMemory() const;
/// @brief Determine if the function does not access or only reads memory.
- bool onlyReadsMemory() const {
- return doesNotAccessMemory() || paramHasAttr(0, ParamAttr::ReadOnly);
- }
+ bool onlyReadsMemory() const;
/// @brief Determine if the function returns a structure.
- bool isStructReturn() const {
- return paramHasAttr(1, ParamAttr::StructRet);
- }
+ bool isStructReturn() const;
/// deleteBody - This method deletes the body of the function, and converts
/// the linkage to external.