Add __builtin_va_list definitions for x86_64 and ppc64.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42943 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/Targets.cpp b/Driver/Targets.cpp
index bf05c64..e7e6a05 100644
--- a/Driver/Targets.cpp
+++ b/Driver/Targets.cpp
@@ -279,6 +279,32 @@
   Define(Defs, "__LDBL_MIN__", "3.36210314311209350626e-4932L");
 }
 
+static const char* getI386VAListDeclaration() {
+  return "typedef char* __builtin_va_list;";
+}
+
+static const char* getX86_64VAListDeclaration() {
+  return 
+    "typedef struct __va_list_tag {"
+    "  unsigned gp_offset;"
+    "  unsigned fp_offset;"
+    "  void* overflow_arg_area;"
+    "  void* reg_save_area;"
+    "} __builtin_va_list[1];";
+}
+
+static const char* getPPCVAListDeclaration() {
+  return 
+    "typedef struct __va_list_tag {"
+    "  unsigned char gpr;"
+    "  unsigned char fpr;"
+    "  unsigned short reserved;"
+    "  void* overflow_arg_area;"
+    "  void* reg_save_area;"
+    "} __builtin_va_list[1];";
+}
+
+
 /// PPC builtin info.
 namespace PPC {
   enum {
@@ -336,6 +362,9 @@
                                  unsigned &NumRecords) const {
     PPC::getBuiltins(Records, NumRecords);
   }
+  virtual const char *getVAListDeclaration() const {
+    return getPPCVAListDeclaration();
+  }  
 };
 } // end anonymous namespace.
 
@@ -350,6 +379,9 @@
                                  unsigned &NumRecords) const {
     PPC::getBuiltins(Records, NumRecords);
   }
+  virtual const char *getVAListDeclaration() const {
+    return getPPCVAListDeclaration();
+  }  
 };
 } // end anonymous namespace.
 
@@ -364,6 +396,10 @@
                                  unsigned &NumRecords) const {
     X86::getBuiltins(Records, NumRecords);
   }
+  
+  virtual const char *getVAListDeclaration() const {
+    return getI386VAListDeclaration();
+  }
 };
 } // end anonymous namespace.
 
@@ -378,6 +414,9 @@
                                  unsigned &NumRecords) const {
     X86::getBuiltins(Records, NumRecords);
   }
+  virtual const char *getVAListDeclaration() const {
+    return getX86_64VAListDeclaration();
+  }  
 };
 } // end anonymous namespace.
 
@@ -398,6 +437,9 @@
                                  unsigned &NumRecords) const {
     X86::getBuiltins(Records, NumRecords);
   }
+  virtual const char *getVAListDeclaration() const {
+    return getI386VAListDeclaration();
+  }  
 };
 } // end anonymous namespace.