[llvm-commits] CVS: llvm-gcc/gcc/llvm-expand.c
Chris Lattner
lattner at cs.uiuc.edu
Thu Jul 28 15:37:32 PDT 2005
Changes in directory llvm-gcc/gcc:
llvm-expand.c updated: 1.111 -> 1.112
---
Log message:
Add a workaround for a "GCC's trees are not type consistent" problem.
---
Diffs of the changes: (+8 -4)
llvm-expand.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
Index: llvm-gcc/gcc/llvm-expand.c
diff -u llvm-gcc/gcc/llvm-expand.c:1.111 llvm-gcc/gcc/llvm-expand.c:1.112
--- llvm-gcc/gcc/llvm-expand.c:1.111 Thu Jul 28 15:18:53 2005
+++ llvm-gcc/gcc/llvm-expand.c Thu Jul 28 17:37:20 2005
@@ -7066,10 +7066,14 @@
LLVM_TARGET_ARG_MODIFY_ARG_TYPE_IF_NEEDED(*ArgAccumulator, ArgTy);
- assert((*ArgNo >= GET_FUNCTION_TYPE_NUMARGS(FuncTy) ||
- ArgTy == GET_FUNCTION_TYPE_ARGUMENT(FuncTy, *ArgNo)) &&
- "ERROR: Function type mismatch!");
-
+ /* GCC is extremely lax about types being equal. If the types are slightly
+ * different, convert to the one that LLVM expects from the function
+ * prototype.
+ */
+ if (*ArgNo < GET_FUNCTION_TYPE_NUMARGS(FuncTy) &&
+ ArgTy != GET_FUNCTION_TYPE_ARGUMENT(FuncTy, *ArgNo))
+ ArgTy = GET_FUNCTION_TYPE_ARGUMENT(FuncTy, *ArgNo);
+
Arg = llvm_argument_new(ArgTy, Name);
llvm_ilist_push_back(llvm_argument, Fn->Arguments, Arg);
if (Address) {
More information about the llvm-commits
mailing list