[llvm-commits] [llvm] r70610 - in /llvm/trunk: lib/Target/CppBackend/CPPBackend.cpp test/CodeGen/CPP/2009-05-01-Long-Double.ll

Chris Lattner sabre at nondot.org
Fri May 1 16:54:27 PDT 2009


Author: lattner
Date: Fri May  1 18:54:26 2009
New Revision: 70610

URL: http://llvm.org/viewvc/llvm-project?rev=70610&view=rev
Log:
'The attached patch fixes an issue where llc -march=cpp fails with
"Invalid primitive type" on input containing the x86_fp80 type.'
Patch by Collin Winter!



Added:
    llvm/trunk/test/CodeGen/CPP/2009-05-01-Long-Double.ll
Modified:
    llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp

Modified: llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp?rev=70610&r1=70609&r2=70610&view=diff

==============================================================================
--- llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp (original)
+++ llvm/trunk/lib/Target/CppBackend/CPPBackend.cpp Fri May  1 18:54:26 2009
@@ -359,9 +359,10 @@
         unsigned BitWidth = cast<IntegerType>(Ty)->getBitWidth();
         return "IntegerType::get(" + utostr(BitWidth) + ")";
       }
-      case Type::FloatTyID:  return "Type::FloatTy";
-      case Type::DoubleTyID: return "Type::DoubleTy";
-      case Type::LabelTyID:  return "Type::LabelTy";
+      case Type::X86_FP80TyID: return "Type::X86_FP80Ty";
+      case Type::FloatTyID:    return "Type::FloatTy";
+      case Type::DoubleTyID:   return "Type::DoubleTy";
+      case Type::LabelTyID:    return "Type::LabelTy";
       default:
         error("Invalid primitive type");
         break;

Added: llvm/trunk/test/CodeGen/CPP/2009-05-01-Long-Double.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/CPP/2009-05-01-Long-Double.ll?rev=70610&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/CPP/2009-05-01-Long-Double.ll (added)
+++ llvm/trunk/test/CodeGen/CPP/2009-05-01-Long-Double.ll Fri May  1 18:54:26 2009
@@ -0,0 +1,13 @@
+; RUN: llvm-as < %s | llc -march=cpp -cppgen=program -f -o %t
+
+define x86_fp80 @some_func() nounwind {
+entry:
+	%retval = alloca x86_fp80		; <x86_fp80*> [#uses=2]
+	%call = call i32 (...)* @other_func()		; <i32> [#uses=1]
+	%conv = sitofp i32 %call to x86_fp80		; <x86_fp80> [#uses=1]
+	store x86_fp80 %conv, x86_fp80* %retval
+	%0 = load x86_fp80* %retval		; <x86_fp80> [#uses=1]
+	ret x86_fp80 %0
+}
+
+declare i32 @other_func(...)





More information about the llvm-commits mailing list