]> granicus.if.org Git - clang/commitdiff
implement PR5274: mark 'restrict' parameters as noalias
authorNuno Lopes <nunoplopes@sapo.pt>
Mon, 7 Dec 2009 18:30:06 +0000 (18:30 +0000)
committerNuno Lopes <nunoplopes@sapo.pt>
Mon, 7 Dec 2009 18:30:06 +0000 (18:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90778 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCall.cpp

index 62a5792d27db3e1051d2fa8a1d9716de3092a6bb..4856f5404c1aeb5bad015f7c457825bee004caf6 100644 (file)
@@ -561,6 +561,9 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
     const ABIArgInfo &AI = it->info;
     unsigned Attributes = 0;
 
+    if (ParamType.isRestrictQualified())
+      Attributes |= llvm::Attribute::NoAlias;
+
     switch (AI.getKind()) {
     case ABIArgInfo::Coerce:
       break;