]> granicus.if.org Git - clang/commitdiff
Revert the fix for PR3800, it broke things.
authorAnders Carlsson <andersca@mac.com>
Tue, 4 Aug 2009 18:18:36 +0000 (18:18 +0000)
committerAnders Carlsson <andersca@mac.com>
Tue, 4 Aug 2009 18:18:36 +0000 (18:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78084 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGStmt.cpp
test/CodeGen/asm-inout.c

index f4bc5afd09b2d9ac7310bcfc23c366af78ffffcd..5b17b7b90084c57c3a8ad5f7d7f25d04292996da 100644 (file)
@@ -909,13 +909,16 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
     if (Info.isReadWrite()) {
       InOutConstraints += ',';
 
+      const Expr *InputExpr = S.getOutputExpr(i);
+      llvm::Value *Arg = EmitAsmInput(S, Info, InputExpr, InOutConstraints);
+      
       if (Info.allowsRegister())
         InOutConstraints += llvm::utostr(i);
       else
         InOutConstraints += OutputConstraint;
 
-      InOutArgTypes.push_back(Dest.getAddress()->getType());
-      InOutArgs.push_back(Dest.getAddress());
+      InOutArgTypes.push_back(Arg->getType());
+      InOutArgs.push_back(Arg);
     }
   }
   
index e0e42a319dfc6e736976c674370d8bee6c2db93b..0d8dbdfb9d381afe0a0eec9d6e8b30cba9235de4 100644 (file)
@@ -1,8 +1,18 @@
 // RUN: clang-cc -triple i386-unknown-unknown -emit-llvm %s -o %t &&
 // RUN: grep "load i8\*\*\* %p.addr"  %t | count 1
+// XFAIL
 
 // PR3800
 void f(void **p)
 {
     __asm__ volatile("" :"+m"(*p));
 }
+
+#if 0
+// FIXME: Once this works again, we must verify that the code below behaves as expected
+// See PR4677.
+void f() {
+  unsigned _data = 42;
+  __asm__("bswap   %0":"+r"(_data));
+}
+#endif