diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-12-02 20:03:17 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-12-02 20:03:17 +0000 |
commit | 769efe621ab318cb9e245c613dad5da695316557 (patch) | |
tree | 028a3cef6851a8883fa19402ccebb8cf347b6304 /llvm/lib/IR/Function.cpp | |
parent | 00f2f91af4c7693e10cf70ef271b6cec89696e86 (diff) | |
download | llvm-769efe621ab318cb9e245c613dad5da695316557.zip llvm-769efe621ab318cb9e245c613dad5da695316557.tar.gz llvm-769efe621ab318cb9e245c613dad5da695316557.tar.bz2 |
Don't copy information from aliasee to alias.
They are independent.
llvm-svn: 254541
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
-rw-r--r-- | llvm/lib/IR/Function.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp index 97e2a84..5e4d2d2 100644 --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -411,12 +411,14 @@ void Function::clearGC() { } } -/// copyAttributesFrom - copy all additional attributes (those not needed to -/// create a Function) from the Function Src to this one. +/// Copy all additional attributes (those not needed to create a Function) from +/// the Function Src to this one. void Function::copyAttributesFrom(const GlobalValue *Src) { - assert(isa<Function>(Src) && "Expected a Function!"); GlobalObject::copyAttributesFrom(Src); - const Function *SrcF = cast<Function>(Src); + const Function *SrcF = dyn_cast<Function>(Src); + if (!SrcF) + return; + setCallingConv(SrcF->getCallingConv()); setAttributes(SrcF->getAttributes()); if (SrcF->hasGC()) |