aboutsummaryrefslogtreecommitdiff
path: root/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
commit76168e289ca4b307259e3bc9b3353f03b05bb6b9 (patch)
tree0200fde8022319a4ea4d63582a4a64d9c5cd6322 /lib/CodeGen/CGCall.cpp
parent237957c45774713f81fbd5394b3db4317fef0938 (diff)
map previously ignored __attribute((malloc)) to noalias attribute of llvm function's return
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78541 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCall.cpp')
-rw-r--r--lib/CodeGen/CGCall.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index 12d4d9ca25..24d82747a4 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/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)