//===---- TargetABIInfo.cpp - Encapsulate target ABI details ----*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// These classes wrap the information about a call or function
// definition used to handle ABI compliancy.
//
//===----------------------------------------------------------------------===//
#include "ABIInfo.h"
#include "CodeGenFunction.h"
#include "clang/AST/RecordLayout.h"
#include "llvm/Type.h"
using namespace clang;
using namespace CodeGen;
ABIInfo::~ABIInfo() {}
void ABIArgInfo::dump() const {
fprintf(stderr, "(ABIArgInfo Kind=");
switch (TheKind) {
case Direct:
fprintf(stderr, "Direct");
break;
case Extend:
fprintf(stderr, "Extend");
break;
case Ignore:
fprintf(stderr, "Ignore");
break;
case Coerce:
fprintf(stderr, "Coerce Type=");
getCoerceToType()->print(llvm::errs());
break;
case Indirect:
fprintf(stderr, "Indirect Align=%d", getIndirectAlign());
break;
case Expand:
fprintf(stderr, "Expand");
break;
}
fprintf(stderr, ")\n");
}
static bool isEmptyRecord(ASTContext &Context, QualType T);
/// isEmptyField - Return true iff a the field is "empty", that is it
/// is an unnamed bit-field or an (array of) empty record(s).
static bool isEmptyField(ASTContext &Context, const FieldDecl *FD) {
if (FD->isUnnamedBitfield())
return true;
QualType FT = FD->getType();