[llvm-commits] [llvm-gcc-4.2] r80626 - in /llvm-gcc-4.2/trunk/gcc: ChangeLog.apple llvm-debug.cpp tree.c tree.h
Caroline Tice
ctice at apple.com
Mon Aug 31 14:22:12 PDT 2009
Author: ctice
Date: Mon Aug 31 16:22:12 2009
New Revision: 80626
URL: http://llvm.org/viewvc/llvm-project?rev=80626&view=rev
Log:
When converting tree types to llvm types, add appropriate flag to mark
Block "byref" variables; also added a new function to test when it's appropriate
to add the flags.
Modified:
llvm-gcc-4.2/trunk/gcc/ChangeLog.apple
llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
llvm-gcc-4.2/trunk/gcc/tree.c
llvm-gcc-4.2/trunk/gcc/tree.h
Modified: llvm-gcc-4.2/trunk/gcc/ChangeLog.apple
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/ChangeLog.apple?rev=80626&r1=80625&r2=80626&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/ChangeLog.apple (original)
+++ llvm-gcc-4.2/trunk/gcc/ChangeLog.apple Mon Aug 31 16:22:12 2009
@@ -1,3 +1,9 @@
+2009-08-31 Caroline Tice <ctice at apple.com>
+
+ Radar 6419781
+ * tree.c (type_is_block_byref_struct): New function.
+ * tree.h (type_is_block_byref_struct): New extern function decl.
+
2009-07-31 Bob Wilson <bob.wilson at apple.com>
Radar 7105099
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=80626&r1=80625&r2=80626&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Mon Aug 31 16:22:12 2009
@@ -445,6 +445,9 @@
TREE_CODE(type) == BLOCK_POINTER_TYPE) ?
DW_TAG_pointer_type :
DW_TAG_reference_type;
+ unsigned Flags = 0;
+ if (type_is_block_byref_struct(type))
+ Flags |= llvm::DIType::FlagBlockByrefStruct;
expanded_location Loc = GetNodeLocation(type);
std::string PName;
@@ -455,7 +458,7 @@
NodeSizeInBits(type),
NodeAlignInBits(type),
0 /*offset */,
- 0 /* flags */,
+ Flags,
FromTy);
}
@@ -591,7 +594,8 @@
unsigned Flags = llvm::DIType::FlagFwdDecl;
if (TYPE_BLOCK_IMPL_STRUCT(type))
Flags |= llvm::DIType::FlagAppleBlock;
-
+ if (type_is_block_byref_struct(type))
+ Flags |= llvm::DIType::FlagBlockByrefStruct;
llvm::DICompositeType FwdDecl =
DebugFactory.CreateCompositeType(Tag,
findRegion(type),
Modified: llvm-gcc-4.2/trunk/gcc/tree.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.c?rev=80626&r1=80625&r2=80626&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/tree.c (original)
+++ llvm-gcc-4.2/trunk/gcc/tree.c Mon Aug 31 16:22:12 2009
@@ -7975,4 +7975,37 @@
}
/* APPLE LOCAL end weak_import on property 6676828 */
+/* APPLE LOCAL begin radar 6419781 */
+bool
+type_is_block_byref_struct (tree type)
+{
+ bool ret_value = false;
+
+ if (!type)
+ return false;
+
+ if (TREE_CODE (type) == POINTER_TYPE)
+ type = TREE_TYPE (type);
+
+ if (!type
+ || ! TYPE_NAME (type)
+ || ! (TREE_CODE (type) == RECORD_TYPE))
+ return false;
+
+ if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE
+ && strncmp (IDENTIFIER_POINTER (TYPE_NAME (type)),
+ "__Block_byref_", 14) == 0)
+ return true;
+ else if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
+ && DECL_NAME (TYPE_NAME (type))
+ && IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)))
+ && (strncmp
+ (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))),
+ "__Block_byref_", 14) == 0))
+ return true;
+ else
+ return false;
+}
+/* APPLE LOCAL begin end 6419781 */
+
#include "gt-tree.h"
Modified: llvm-gcc-4.2/trunk/gcc/tree.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/tree.h?rev=80626&r1=80625&r2=80626&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/tree.h (original)
+++ llvm-gcc-4.2/trunk/gcc/tree.h Mon Aug 31 16:22:12 2009
@@ -4892,4 +4892,8 @@
/* APPLE LOCAL end radar 6300081 */
+/* APPLE LOCAL begin radar 6419781 */
+extern bool type_is_block_byref_struct (tree);
+/* APPLE LOCAL end radar 6419781 */
+
#endif /* GCC_TREE_H */
More information about the llvm-commits
mailing list