summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Function.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-05-13 18:45:48 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-05-13 18:45:48 +0000
commit99e05cf163f14ecc70ef68e550ddb568a075e64b (patch)
tree896c929db42235b47392ec0e74dc412b12f50ff6 /llvm/lib/IR/Function.cpp
parent94cbb666b26ddb5ab7cad0a52e2b057db517bae0 (diff)
downloadbcm5719-llvm-99e05cf163f14ecc70ef68e550ddb568a075e64b.tar.gz
bcm5719-llvm-99e05cf163f14ecc70ef68e550ddb568a075e64b.zip
Split GlobalValue into GlobalValue and GlobalObject.
This allows code to statically accept a Function or a GlobalVariable, but not an alias. This is already a cleanup by itself IMHO, but the main reason for it is that it gives a lot more confidence that the refactoring to fix the design of GlobalAlias is correct. That will be a followup patch. llvm-svn: 208716
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r--llvm/lib/IR/Function.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp
index c1a09686b02..de8e66f1bca 100644
--- a/llvm/lib/IR/Function.cpp
+++ b/llvm/lib/IR/Function.cpp
@@ -209,7 +209,7 @@ void Function::eraseFromParent() {
Function::Function(FunctionType *Ty, LinkageTypes Linkage,
const Twine &name, Module *ParentModule)
- : GlobalValue(PointerType::getUnqual(Ty),
+ : GlobalObject(PointerType::getUnqual(Ty),
Value::FunctionVal, nullptr, 0, Linkage, name) {
assert(FunctionType::isValidReturnType(getReturnType()) &&
"invalid return type");
@@ -361,7 +361,7 @@ void Function::clearGC() {
/// create a Function) from the Function Src to this one.
void Function::copyAttributesFrom(const GlobalValue *Src) {
assert(isa<Function>(Src) && "Expected a Function!");
- GlobalValue::copyAttributesFrom(Src);
+ GlobalObject::copyAttributesFrom(Src);
const Function *SrcF = cast<Function>(Src);
setCallingConv(SrcF->getCallingConv());
setAttributes(SrcF->getAttributes());
OpenPOWER on IntegriCloud