[llvm-commits] [llvm-gcc-4.2] r40054 - in /llvm-gcc-4.2/trunk/gcc: llvm-abi.h llvm-internal.h
Anton Korobeynikov
asl at math.spbu.ru
Thu Jul 19 05:58:17 PDT 2007
Author: asl
Date: Thu Jul 19 07:58:17 2007
New Revision: 40054
URL: http://llvm.org/viewvc/llvm-project?rev=40054&view=rev
Log:
Don't call DECL_LLVM on FIELD_DECL, use GetFieldIndex instead.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-abi.h
llvm-gcc-4.2/trunk/gcc/llvm-internal.h
Modified: llvm-gcc-4.2/trunk/gcc/llvm-abi.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-abi.h?rev=40054&r1=40053&r2=40054&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-abi.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-abi.h Thu Jul 19 07:58:17 2007
@@ -204,7 +204,7 @@
} else if (TREE_CODE(type) == RECORD_TYPE) {
for (tree Field = TYPE_FIELDS(type); Field; Field = TREE_CHAIN(Field))
if (TREE_CODE(Field) == FIELD_DECL) {
- unsigned FNo = cast<ConstantInt>(DECL_LLVM(Field))->getZExtValue();
+ unsigned FNo = GetFieldIndex(Field);
assert(FNo != ~0U && "Case not handled yet!");
C.EnterField(FNo, Ty);
Modified: llvm-gcc-4.2/trunk/gcc/llvm-internal.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-internal.h?rev=40054&r1=40053&r2=40054&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-internal.h (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-internal.h Thu Jul 19 07:58:17 2007
@@ -174,6 +174,12 @@
return TheTypeConverter->ConvertType(type);
}
+/// GetFieldIndex - Given FIELD_DECL obtain its index.
+///
+inline unsigned int GetFieldIndex(tree_node *field_decl) {
+ return TheTypeConverter->GetFieldIndex(field_decl);
+}
+
/// isInt64 - Return true if t is an INTEGER_CST that fits in a 64 bit integer.
/// If Unsigned is false, returns whether it fits in a int64_t. If Unsigned is
/// true, returns whether the value is non-negative and fits in a uint64_t.
More information about the llvm-commits
mailing list