summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorRyan Flynn <pizza@parseerror.com>2009-08-09 20:07:29 +0000
committerRyan Flynn <pizza@parseerror.com>2009-08-09 20:07:29 +0000
commit1f1fdc070efa8d32d97a51dbffdae466ad83e480 (patch)
treee20efac5175097e57038f617b65cdadefe494953 /clang/lib/CodeGen/CGCall.cpp
parentd461c1c559e3cd0aef3ad18246a866ab2a8e52d8 (diff)
downloadbcm5719-llvm-1f1fdc070efa8d32d97a51dbffdae466ad83e480.tar.gz
bcm5719-llvm-1f1fdc070efa8d32d97a51dbffdae466ad83e480.zip
map previously ignored __attribute((malloc)) to noalias attribute of llvm function's return
llvm-svn: 78541
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 12d4d9ca252..24d82747a40 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -385,6 +385,8 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
FuncAttrs |= llvm::Attribute::ReadNone;
else if (TargetDecl->hasAttr<PureAttr>())
FuncAttrs |= llvm::Attribute::ReadOnly;
+ if (TargetDecl->hasAttr<MallocAttr>())
+ RetAttrs |= llvm::Attribute::NoAlias;
}
if (CompileOpts.DisableRedZone)
OpenPOWER on IntegriCloud