[llvm-branch-commits] [llvm-gcc-branch] r91968 - /llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-convert.cpp

Bob Wilson bob.wilson at apple.com
Tue Dec 22 17:19:09 PST 2009


Author: bwilson
Date: Tue Dec 22 19:19:08 2009
New Revision: 91968

URL: http://llvm.org/viewvc/llvm-project?rev=91968&view=rev
Log:
--- Merging r91964 into '.':
U    gcc/llvm-convert.cpp

Modified:
    llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-convert.cpp?rev=91968&r1=91967&r2=91968&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-convert.cpp Tue Dec 22 19:19:08 2009
@@ -4445,17 +4445,19 @@
         LValue LV = EmitLV(Val);
         assert(!LV.isBitfield() && "Inline asm can't have bitfield operand");
 
-        // Structs and unions are permitted here, as long as they're the
-        // same size as a register.
+        // Small structs and unions can be treated as integers.
         uint64_t TySize = TD.getTypeSizeInBits(LLVMTy);
         if (TySize == 1 || TySize == 8 || TySize == 16 ||
-            TySize == 32 || TySize == 64) {
+            TySize == 32 || TySize == 64 || (TySize == 128 && !AllowsMem)) {
           LLVMTy = IntegerType::get(Context, TySize);
           Op = Builder.CreateLoad(BitCastToType(LV.Ptr,
-                                 LLVMTy->getPointerTo()));
+                                                LLVMTy->getPointerTo()));
         } else {
-          // Otherwise, emit our value as a lvalue and let the codegen deal with
-          // it.
+          // Codegen only supports indirect operands with mem constraints.
+          if (!AllowsMem)
+            error("%Haggregate does not match inline asm register constraint",
+                  &EXPR_LOCATION(exp));
+          // Otherwise, emit our value as a lvalue.
           isIndirect = true;
           Op = LV.Ptr;
         }





More information about the llvm-branch-commits mailing list