Handle aggregate type arguments to direct and indirect calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69022 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PIC16/PIC16AsmPrinter.cpp b/lib/Target/PIC16/PIC16AsmPrinter.cpp
index 5c4b353..84cf312 100644
--- a/lib/Target/PIC16/PIC16AsmPrinter.cpp
+++ b/lib/Target/PIC16/PIC16AsmPrinter.cpp
@@ -227,6 +227,11 @@
     std::string Name = Mang->getValueName(I);
     if (Name.compare("abort") == 0)
       continue;
+    
+    // If it is llvm intrinsic call then don't emit
+    if (Name.find("llvm.") != std::string::npos)
+      continue;
+
     if (I->isDeclaration()) {
       O << "\textern " <<Name << "\n";
       O << "\textern " << Name << ".retval\n";
@@ -396,6 +401,11 @@
    }
   O << CurrentFnName << ".args      RES  " << ArgSize << "\n";
 
+  // Emit temporary space
+  int TempSize = PTLI->GetTmpSize();
+  if (TempSize > 0 )
+    O << CurrentFnName << ".tmp       RES  " << TempSize <<"\n";
+
   // Emit the function variables. 
    
   // In PIC16 all the function arguments and local variables are global.
@@ -423,7 +433,4 @@
     O << VarName << "  RES  " << Size << "\n";
   }
 
-  int TempSize = PTLI->GetTmpSize();
-  if (TempSize > 0 )
-    O << CurrentFnName << ".tmp       RES  " << TempSize <<"\n";
 }