summaryrefslogtreecommitdiffstats
path: root/include/llvm/IR/Function.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/IR/Function.h')
-rw-r--r--include/llvm/IR/Function.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/llvm/IR/Function.h b/include/llvm/IR/Function.h
index cb43bba..22444bd 100644
--- a/include/llvm/IR/Function.h
+++ b/include/llvm/IR/Function.h
@@ -23,7 +23,7 @@
#include "llvm/IR/Attributes.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/CallingConv.h"
-#include "llvm/IR/GlobalValue.h"
+#include "llvm/IR/GlobalObject.h"
#include "llvm/Support/Compiler.h"
namespace llvm {
@@ -68,8 +68,7 @@ private:
mutable ilist_half_node<Argument> Sentinel;
};
-class Function : public GlobalValue,
- public ilist_node<Function> {
+class Function : public GlobalObject, public ilist_node<Function> {
public:
typedef iplist<Argument> ArgumentListType;
typedef iplist<BasicBlock> BasicBlockListType;
@@ -123,11 +122,11 @@ private:
/// the module.
///
Function(FunctionType *Ty, LinkageTypes Linkage,
- const Twine &N = "", Module *M = 0);
+ const Twine &N = "", Module *M = nullptr);
public:
static Function *Create(FunctionType *Ty, LinkageTypes Linkage,
- const Twine &N = "", Module *M = 0) {
+ const Twine &N = "", Module *M = nullptr) {
return new(0) Function(Ty, Linkage, N, M);
}
@@ -298,7 +297,8 @@ public:
/// @brief Determine if the function returns a structure through first
/// pointer argument.
bool hasStructRetAttr() const {
- return AttributeSets.hasAttribute(1, Attribute::StructRet);
+ return AttributeSets.hasAttribute(1, Attribute::StructRet) ||
+ AttributeSets.hasAttribute(2, Attribute::StructRet);
}
/// @brief Determine if the parameter does not alias other parameters.
@@ -483,7 +483,7 @@ public:
/// other than direct calls or invokes to it, or blockaddress expressions.
/// Optionally passes back an offending user for diagnostic purposes.
///
- bool hasAddressTaken(const User** = 0) const;
+ bool hasAddressTaken(const User** = nullptr) const;
/// isDefTriviallyDead - Return true if it is trivially safe to remove
/// this function definition from the module (because it isn't externally
@@ -505,12 +505,12 @@ private:
inline ValueSymbolTable *
ilist_traits<BasicBlock>::getSymTab(Function *F) {
- return F ? &F->getValueSymbolTable() : 0;
+ return F ? &F->getValueSymbolTable() : nullptr;
}
inline ValueSymbolTable *
ilist_traits<Argument>::getSymTab(Function *F) {
- return F ? &F->getValueSymbolTable() : 0;
+ return F ? &F->getValueSymbolTable() : nullptr;
}
} // End llvm namespace