[llvm-commits] [llvm-gcc-4.2] r132366 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Eric Christopher echristo at apple.com
Tue May 31 15:08:30 PDT 2011


Author: echristo
Date: Tue May 31 17:08:30 2011
New Revision: 132366

URL: http://llvm.org/viewvc/llvm-project?rev=132366&view=rev
Log:
Look through struct wrapped types when deciding whether or not it's a
simple emit for the input constraints in an inline asm.

Fixes rdar://9529215

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=132366&r1=132365&r2=132366&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue May 31 17:08:30 2011
@@ -4978,7 +4978,9 @@
       if (LLVM_IS_DECL_MMX_REGISTER(Val))
         LLVMTy = Type::getX86_MMXTy(Context);
       const Type *OpTy = LLVMTy;
-      if (LLVMTy->isSingleValueType()) {
+      const StructType *STy = dyn_cast<StructType>(OpTy);
+      if (LLVMTy->isSingleValueType() ||
+          (STy && STy->getNumElements() == 1)) {
         if (TREE_CODE(Val)==ADDR_EXPR &&
             TREE_CODE(TREE_OPERAND(Val,0))==LABEL_DECL) {
           // Emit the label, but do not assume it is going to be the target





More information about the llvm-commits mailing list