[llvm-commits] [llvm-gcc-4.2] r54263 - in /llvm-gcc-4.2/trunk/gcc: llvm-convert.cpp llvm-debug.cpp llvm-types.cpp
Bill Wendling
isanbard at gmail.com
Thu Jul 31 23:05:17 PDT 2008
Author: void
Date: Fri Aug 1 01:05:17 2008
New Revision: 54263
URL: http://llvm.org/viewvc/llvm-project?rev=54263&view=rev
Log:
Treat the new BLOCK_POINTER_TYPE in the exact same way as a POINTER_TYPE or
REFERENCE_TYPE.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=54263&r1=54262&r2=54263&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Fri Aug 1 01:05:17 2008
@@ -2320,7 +2320,8 @@
assert(TREE_TYPE (TREE_OPERAND (exp, 0)) &&
(TREE_CODE(TREE_TYPE (TREE_OPERAND (exp, 0))) == POINTER_TYPE ||
- TREE_CODE(TREE_TYPE (TREE_OPERAND (exp, 0))) == REFERENCE_TYPE)
+ TREE_CODE(TREE_TYPE (TREE_OPERAND (exp, 0))) == REFERENCE_TYPE ||
+ TREE_CODE(TREE_TYPE (TREE_OPERAND (exp, 0))) == BLOCK_POINTER_TYPE)
&& "Not calling a function pointer?");
tree function_type = TREE_TYPE(TREE_TYPE (TREE_OPERAND (exp, 0)));
unsigned CallingConv;
@@ -5680,7 +5681,8 @@
assert((TREE_CODE (ArrayType) == ARRAY_TYPE ||
TREE_CODE (ArrayType) == POINTER_TYPE ||
- TREE_CODE (ArrayType) == REFERENCE_TYPE) &&
+ TREE_CODE (ArrayType) == REFERENCE_TYPE ||
+ TREE_CODE (ArrayType) == BLOCK_POINTER_TYPE) &&
"Unknown ARRAY_REF!");
// As an LLVM extension, we allow ARRAY_REF with a pointer as the first
@@ -6917,7 +6919,8 @@
tree IndexType = TREE_TYPE(Index);
assert((TREE_CODE (ArrayType) == ARRAY_TYPE ||
TREE_CODE (ArrayType) == POINTER_TYPE ||
- TREE_CODE (ArrayType) == REFERENCE_TYPE) &&
+ TREE_CODE (ArrayType) == REFERENCE_TYPE ||
+ TREE_CODE (ArrayType) == BLOCK_POINTER_TYPE) &&
"Unknown ARRAY_REF!");
// Check for variable sized reference.
Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=54263&r1=54262&r2=54263&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Fri Aug 1 01:05:17 2008
@@ -496,10 +496,14 @@
}
case POINTER_TYPE:
- case REFERENCE_TYPE: {
+ case REFERENCE_TYPE:
+ case BLOCK_POINTER_TYPE: {
// type* and type&
- unsigned T = TREE_CODE(type) == POINTER_TYPE ? DW_TAG_pointer_type :
- DW_TAG_reference_type;
+ // FIXME: Should BLOCK_POINTER_TYP have its own DW_TAG?
+ unsigned T = (TREE_CODE(type) == POINTER_TYPE ||
+ TREE_CODE(type) == BLOCK_POINTER_TYPE) ?
+ DW_TAG_pointer_type :
+ DW_TAG_reference_type;
DerivedTypeDesc *DerivedTy = new DerivedTypeDesc(T);
Ty = DerivedTy;
// Set the slot early to prevent recursion difficulties.
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=54263&r1=54262&r2=54263&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Fri Aug 1 01:05:17 2008
@@ -302,7 +302,8 @@
bool isSequentialCompatible(tree_node *type) {
assert((TREE_CODE(type) == ARRAY_TYPE ||
TREE_CODE(type) == POINTER_TYPE ||
- TREE_CODE(type) == REFERENCE_TYPE) && "not a sequential type!");
+ TREE_CODE(type) == REFERENCE_TYPE ||
+ TREE_CODE(type) == BLOCK_POINTER_TYPE) && "not a sequential type!");
// This relies on gcc types with constant size mapping to LLVM types with the
// same size. It is possible for the component type not to have a size:
// struct foo; extern foo bar[];
@@ -315,7 +316,8 @@
bool isArrayCompatible(tree_node *type) {
assert((TREE_CODE(type) == ARRAY_TYPE ||
TREE_CODE(type) == POINTER_TYPE ||
- TREE_CODE(type) == REFERENCE_TYPE) && "not a sequential type!");
+ TREE_CODE(type) == REFERENCE_TYPE ||
+ TREE_CODE(type) == BLOCK_POINTER_TYPE) && "not a sequential type!");
return
(TREE_CODE(type) == ARRAY_TYPE) && (
// Arrays with no size are fine as long as their components are layed out
@@ -598,6 +600,7 @@
case VECTOR_TYPE:
case POINTER_TYPE:
case REFERENCE_TYPE:
+ case BLOCK_POINTER_TYPE:
case OFFSET_TYPE:
// These types have no holes.
return true;
@@ -784,6 +787,7 @@
case POINTER_TYPE:
case REFERENCE_TYPE:
+ case BLOCK_POINTER_TYPE:
if (const PointerType *Ty = cast_or_null<PointerType>(GET_TYPE_LLVM(type))){
// We already converted this type. If this isn't a case where we have to
// reparse it, just return it.
@@ -1219,7 +1223,8 @@
// types.
tree RestrictArgTy = (DeclArgs) ? TREE_TYPE(DeclArgs) : ArgTy;
if (TREE_CODE(RestrictArgTy) == POINTER_TYPE ||
- TREE_CODE(RestrictArgTy) == REFERENCE_TYPE) {
+ TREE_CODE(RestrictArgTy) == REFERENCE_TYPE ||
+ TREE_CODE(RestrictArgTy) == BLOCK_POINTER_TYPE) {
if (TYPE_RESTRICT(RestrictArgTy))
Attributes |= ParamAttr::NoAlias;
}
More information about the llvm-commits
mailing list