[llvm-commits] [llvm] r47385 - /llvm/trunk/lib/Target/CBackend/CBackend.cpp

Evan Cheng evan.cheng at apple.com
Wed Feb 20 10:32:06 PST 2008


Author: evancheng
Date: Wed Feb 20 12:32:05 2008
New Revision: 47385

URL: http://llvm.org/viewvc/llvm-project?rev=47385&view=rev
Log:
Temporarily backing out r47337. It breaks a number of CBE tests.

Modified:
    llvm/trunk/lib/Target/CBackend/CBackend.cpp

Modified: llvm/trunk/lib/Target/CBackend/CBackend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CBackend/CBackend.cpp?rev=47385&r1=47384&r2=47385&view=diff

==============================================================================
--- llvm/trunk/lib/Target/CBackend/CBackend.cpp (original)
+++ llvm/trunk/lib/Target/CBackend/CBackend.cpp Wed Feb 20 12:32:05 2008
@@ -1198,12 +1198,12 @@
 }
 
 void CWriter::writeOperand(Value *Operand) {
-  if (isa<GlobalVariable>(Operand) || isDirectAlloca(Operand) || ByValParams.count(Operand))
+  if (isa<GlobalVariable>(Operand) || isDirectAlloca(Operand))
     Out << "(&";  // Global variables are referenced as their addresses by llvm
 
   writeOperandInternal(Operand);
 
-  if (isa<GlobalVariable>(Operand) || isDirectAlloca(Operand) || ByValParams.count(Operand))
+  if (isa<GlobalVariable>(Operand) || isDirectAlloca(Operand))
     Out << ')';
 }
 
@@ -2723,11 +2723,13 @@
     // Check if the argument is expected to be passed by value.
     bool isOutByVal = PAL && PAL->paramHasAttr(ArgNo+1, ParamAttr::ByVal);
     // Check if this argument itself is passed in by reference. 
-    //bool isInByVal = ByValParams.count(*AI);
-    if (isOutByVal)
+    bool isInByVal = ByValParams.count(*AI);
+    if (isOutByVal && !isInByVal)
       Out << "*(";
+    else if (!isOutByVal && isInByVal)
+      Out << "&(";
     writeOperand(*AI);
-    if (isOutByVal)
+    if (isOutByVal ^ isInByVal)
       Out << ")";
     PrintedArg = true;
   }





More information about the llvm-commits mailing list