[llvm-commits] [llvm-gcc-4.0] r40582 - /llvm-gcc-4.0/trunk/gcc/llvm-types.cpp
Christopher Lamb
christopher.lamb at gmail.com
Sun Jul 29 16:25:53 PDT 2007
Author: clamb
Date: Sun Jul 29 18:25:53 2007
New Revision: 40582
URL: http://llvm.org/viewvc/llvm-project?rev=40582&view=rev
Log:
Add support to emit noalias attribute on function parameters when the __restrict qualifier is used.
Modified:
llvm-gcc-4.0/trunk/gcc/llvm-types.cpp
Modified: llvm-gcc-4.0/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-types.cpp?rev=40582&r1=40581&r2=40582&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-types.cpp Sun Jul 29 18:25:53 2007
@@ -1010,6 +1010,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