diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-10-22 13:51:06 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-10-22 13:51:06 +0000 |
| commit | e37bf44c8012f36f900955d8513e03791803045e (patch) | |
| tree | 7241ca35ed3d657046a7375eec7d5384d223c797 /lib/CodeGen/CGExprCXX.cpp | |
| parent | 89673e0c7edb17927d531857be56766894c347c3 (diff) | |
| download | clang-e37bf44c8012f36f900955d8513e03791803045e.tar.gz clang-e37bf44c8012f36f900955d8513e03791803045e.tar.bz2 clang-e37bf44c8012f36f900955d8513e03791803045e.tar.xz | |
This patch causes clang to reject alias attributes that point to undefined
names. For example, with this patch we now reject
void f1(void) __attribute__((alias("g1")));
This patch is implemented in CodeGen. It is quiet a bit simpler and more
compatible with gcc than implementing it in Sema. The downside is that the
errors only fire during -emit-llvm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193161 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprCXX.cpp')
| -rw-r--r-- | lib/CodeGen/CGExprCXX.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp index 567444253c..2311e084b7 100644 --- a/lib/CodeGen/CGExprCXX.cpp +++ b/lib/CodeGen/CGExprCXX.cpp @@ -929,9 +929,8 @@ 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() && - Fn && Fn->hasFnAttribute(llvm::Attribute::NoBuiltin)) { + !Callee->hasAttr<AliasAttr>()) { // FIXME: Add addAttribute to CallSite. if (llvm::CallInst *CI = dyn_cast<llvm::CallInst>(CallOrInvoke)) CI->addAttribute(llvm::AttributeSet::FunctionIndex, |
