]> granicus.if.org Git - clang/commitdiff
Add ABIArgInfo::dump()
authorDaniel Dunbar <daniel@zuster.org>
Wed, 4 Feb 2009 23:24:38 +0000 (23:24 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 4 Feb 2009 23:24:38 +0000 (23:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63794 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/ABIInfo.h
lib/CodeGen/CGCall.cpp

index a2d80ed78cadc8619508636a415fbe6c8420e378..651192391a5a9e73d950897bd4071f65a64e8b4d 100644 (file)
@@ -113,6 +113,8 @@ namespace clang {
       assert(TheKind == ByVal && "Invalid kind!");
       return UIntData;
     }
+
+    void dump() const;
   };
 
   /// ABIInfo - Target specific hooks for defining how a type should be
index a13b232571751d7af1fe813bd65f904618417e9e..a3dd877ce58b59058a04a2c42523596bcd267569 100644 (file)
@@ -23,6 +23,7 @@
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Attributes.h"
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/raw_ostream.h"
 #include "llvm/Target/TargetData.h"
 
 #include "ABIInfo.h"
@@ -114,6 +115,36 @@ const CGFunctionInfo &CodeGenTypes::getFunctionInfo(QualType ResTy,
 
 ABIInfo::~ABIInfo() {}
 
+void ABIArgInfo::dump() const {
+  fprintf(stderr, "(ABIArgInfo Kind=");
+  switch (TheKind) {
+  case Direct: 
+    fprintf(stderr, "Direct");
+    break;
+  case StructRet: 
+    fprintf(stderr, "StructRet");
+    break;
+  case Ignore: 
+    fprintf(stderr, "Ignore");
+    break;
+  case Coerce: 
+    fprintf(stderr, "Coerce Type=");
+    getCoerceToType()->print(llvm::errs());
+    // FIXME: This is ridiculous.
+    llvm::errs().flush();
+    break;
+  case ByVal: 
+    fprintf(stderr, "ByVal Align=%d", getByValAlignment());
+    break;
+  case Expand: 
+    fprintf(stderr, "Expand");
+    break;
+  }
+  fprintf(stderr, ")\n");
+}
+
+/***/
+
 /// isEmptyStruct - Return true iff a structure has no non-empty
 /// members. Note that a structure with a flexible array member is not
 /// considered empty.