aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2016-01-15 23:07:58 +0000
committerDavid Blaikie <dblaikie@gmail.com>2016-01-15 23:07:58 +0000
commitab105bbf0cb190dac084717c316e5e54dd3fb104 (patch)
treec066c523f2288ce7a4de08cce18836d126e1b33b /llvm/lib/IR/Function.cpp
parent3f746e67df954b55d58e02295e15d6ae353e9511 (diff)
downloadllvm-ab105bbf0cb190dac084717c316e5e54dd3fb104.zip
llvm-ab105bbf0cb190dac084717c316e5e54dd3fb104.tar.gz
llvm-ab105bbf0cb190dac084717c316e5e54dd3fb104.tar.bz2
[opaque pointer types] Remove an unnecessary extra explicit value type in Function
Now that this is up in GlobalValue, just use the value there. llvm-svn: 257949
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index cfdfc40..125f839 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -224,7 +224,9 @@ LLVMContext &Function::getContext() const {
return getType()->getContext();
}
-FunctionType *Function::getFunctionType() const { return Ty; }
+FunctionType *Function::getFunctionType() const {
+ return cast<FunctionType>(getValueType());
+}
bool Function::isVarArg() const {
return getFunctionType()->isVarArg();
@@ -249,8 +251,7 @@ void Function::eraseFromParent() {
Function::Function(FunctionType *Ty, LinkageTypes Linkage, const Twine &name,
Module *ParentModule)
: GlobalObject(Ty, Value::FunctionVal,
- OperandTraits<Function>::op_begin(this), 0, Linkage, name),
- Ty(Ty) {
+ OperandTraits<Function>::op_begin(this), 0, Linkage, name) {
assert(FunctionType::isValidReturnType(getReturnType()) &&
"invalid return type");
setGlobalObjectSubClassData(0);