[llvm-commits] [llvm-gcc-4.2] r40630 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Anton Korobeynikov
asl at math.spbu.ru
Tue Jul 31 01:12:35 PDT 2007
Author: asl
Date: Tue Jul 31 03:12:35 2007
New Revision: 40630
URL: http://llvm.org/viewvc/llvm-project?rev=40630&view=rev
Log:
Propagate r40582 from llvm-gcc-4.0:
Add support to emit noalias attribute on function parameters when the __restrict qualifier is used.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=40630&r1=40629&r2=40630&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Tue Jul 31 03:12:35 2007
@@ -1031,6 +1031,11 @@
else
Attributes |= ParamAttr::SExt;
}
+
+ // Compute noalias attributes.
+ if (TREE_CODE(ArgTy) == POINTER_TYPE || TREE_CODE(ArgTy) == REFERENCE_TYPE)
+ if (TYPE_RESTRICT(ArgTy))
+ Attributes |= ParamAttr::NoAlias;
#ifdef LLVM_TARGET_ENABLE_REGPARM
// Allow the target to mark this as inreg.
More information about the llvm-commits
mailing list