summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprCXX.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-10-22 14:23:09 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-10-22 14:23:09 +0000
commit87017a781f9e2d70a0478abaae26ba486f6e717e (patch)
treedf8c4995fcbbdb1f576aa836e6dae7c0be4e6fc4 /lib/CodeGen/CGExprCXX.cpp
parente37bf44c8012f36f900955d8513e03791803045e (diff)
downloadclang-87017a781f9e2d70a0478abaae26ba486f6e717e.tar.gz
clang-87017a781f9e2d70a0478abaae26ba486f6e717e.tar.bz2
clang-87017a781f9e2d70a0478abaae26ba486f6e717e.tar.xz
Revert "This patch causes clang to reject alias attributes that point to undefined names. For example, with this patch we now reject"
This reverts commit r193161. It broke void foo() __attribute__((alias("bar"))); void bar() {} void zed() __attribute__((alias("foo"))); Looks like we have to fix pr17639 first :-( git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193162 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprCXX.cpp')
-rw-r--r--lib/CodeGen/CGExprCXX.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp
index 2311e084b7..567444253c 100644
--- a/lib/CodeGen/CGExprCXX.cpp
+++ b/lib/CodeGen/CGExprCXX.cpp
@@ -929,8 +929,9 @@ static RValue EmitNewDeleteCall(CodeGenFunction &CGF,
/// to a replaceable global allocation function.
///
/// We model such elidable calls with the 'builtin' attribute.
+ llvm::Function *Fn = dyn_cast<llvm::Function>(CalleeAddr);
if (Callee->isReplaceableGlobalAllocationFunction() &&
- !Callee->hasAttr<AliasAttr>()) {
+ Fn && Fn->hasFnAttribute(llvm::Attribute::NoBuiltin)) {
// FIXME: Add addAttribute to CallSite.
if (llvm::CallInst *CI = dyn_cast<llvm::CallInst>(CallOrInvoke))
CI->addAttribute(llvm::AttributeSet::FunctionIndex,