diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-02-04 23:24:38 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-02-04 23:24:38 +0000 |
commit | 56e7552c7353c74dea112f89dee453b23214327a (patch) | |
tree | f9f4305f89d58f941b4dde9d37340f868db2de9e | |
parent | f08a47bb70e2c2523fdb39a7e831ce3438d9d787 (diff) | |
download | bcm5719-llvm-56e7552c7353c74dea112f89dee453b23214327a.tar.gz bcm5719-llvm-56e7552c7353c74dea112f89dee453b23214327a.zip |
Add ABIArgInfo::dump()
llvm-svn: 63794
-rw-r--r-- | clang/lib/CodeGen/ABIInfo.h | 2 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 31 |
2 files changed, 33 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/ABIInfo.h b/clang/lib/CodeGen/ABIInfo.h index a2d80ed78ca..651192391a5 100644 --- a/clang/lib/CodeGen/ABIInfo.h +++ b/clang/lib/CodeGen/ABIInfo.h @@ -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 diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index a13b2325717..a3dd877ce58 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -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. |