[llvm-commits] [llvm-gcc-4.2] r51684 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Duncan Sands
baldrick at free.fr
Thu May 29 08:37:33 PDT 2008
Author: baldrick
Date: Thu May 29 10:37:33 2008
New Revision: 51684
URL: http://llvm.org/viewvc/llvm-project?rev=51684&view=rev
Log:
Fix PR2380: don't crash on 64 bit values on a
32 bit machine when generating debug info: use
getInt64 instead of tree_low_cst, and isInt64
for host_integerp (these routines are drop-in
replacements that deal with 64 bit values on
all platforms rather than "host integers").
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
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=51684&r1=51683&r2=51684&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Thu May 29 10:37:33 2008
@@ -90,15 +90,15 @@
} else if (TYPE_P(Node)) {
if (TYPE_SIZE(Node) == NULL_TREE)
return 0;
- else if (host_integerp (TYPE_SIZE(Node), 1))
- return tree_low_cst (TYPE_SIZE(Node), 1);
+ else if (isInt64(TYPE_SIZE(Node), 1))
+ return getInt64(TYPE_SIZE(Node), 1);
else
return TYPE_ALIGN(Node);
} else if (DECL_P(Node)) {
if (DECL_SIZE(Node) == NULL_TREE)
return 0;
- else if (host_integerp (DECL_SIZE(Node), 1))
- return tree_low_cst (DECL_SIZE(Node), 1);
+ else if (isInt64(DECL_SIZE(Node), 1))
+ return getInt64(DECL_SIZE(Node), 1);
else
return DECL_ALIGN(Node);
}
@@ -583,10 +583,9 @@
tree MinValue = TYPE_MIN_VALUE(Domain);
tree MaxValue = TYPE_MAX_VALUE(Domain);
if (MinValue && MaxValue &&
- host_integerp(MinValue, 0) &&
- host_integerp(MaxValue, 0)) {
- Subrange->setLo(tree_low_cst(MinValue, 0));
- Subrange->setHi(tree_low_cst(MaxValue, 0));
+ isInt64(MinValue, 0) && isInt64(MaxValue, 0)) {
+ Subrange->setLo(getInt64(MinValue, 0));
+ Subrange->setHi(getInt64(MaxValue, 0));
}
}
@@ -612,8 +611,7 @@
EnumeratorDesc *EnumDesc = new EnumeratorDesc();
tree EnumValue = TREE_VALUE(Link);
- int64_t Value = tree_low_cst(EnumValue,
- tree_int_cst_sgn(EnumValue) > 0);
+ int64_t Value = getInt64(EnumValue, tree_int_cst_sgn(EnumValue) > 0);
const char *EnumName = IDENTIFIER_POINTER(TREE_PURPOSE(Link));
EnumDesc->setName(EnumName);
EnumDesc->setValue(Value);
@@ -657,7 +655,7 @@
}
}
- MemberDesc->setOffset(tree_low_cst(BINFO_OFFSET(BInfo), 0));
+ MemberDesc->setOffset(getInt64(BINFO_OFFSET(BInfo), 0));
Elements.push_back(MemberDesc);
}
}
More information about the llvm-commits
mailing list