10#include "TargetInfo.h"
11#include "llvm/ADT/StringExtras.h"
23 static ABIArgInfo complexArgInfo() {
30 MSP430ABIInfo(CodeGenTypes &CGT) : DefaultABIInfo(CGT) {}
34 return complexArgInfo();
41 return complexArgInfo();
48 void computeInfo(CGFunctionInfo &FI)
const override {
55 RValue EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType Ty,
56 AggValueSlot Slot)
const override {
66 MSP430TargetCodeGenInfo(CodeGenTypes &CGT)
67 : TargetCodeGenInfo(std::make_unique<MSP430ABIInfo>(CGT)) {}
68 void setTargetAttributes(
const Decl *D, llvm::GlobalValue *GV,
69 CodeGen::CodeGenModule &M)
const override;
74void MSP430TargetCodeGenInfo::setTargetAttributes(
76 if (GV->isDeclaration())
78 if (
const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) {
79 const auto *InterruptAttr = FD->getAttr<MSP430InterruptAttr>();
87 F->setCallingConv(llvm::CallingConv::MSP430_INTR);
90 F->addFnAttr(llvm::Attribute::NoInline);
91 F->addFnAttr(
"interrupt", llvm::utostr(InterruptAttr->getNumber()));
95std::unique_ptr<TargetCodeGenInfo>
97 return std::make_unique<MSP430TargetCodeGenInfo>(CGM.
getTypes());
static ABIArgInfo getDirect(llvm::Type *T=nullptr, unsigned Offset=0, llvm::Type *Padding=nullptr, bool CanBeFlattened=true, unsigned Align=0)
void setCanBeFlattened(bool Flatten)
ABIArgInfo & getReturnInfo()
CanQualType getReturnType() const
MutableArrayRef< ArgInfo > arguments()
RValue EmitLoadOfAnyValue(LValue V, AggValueSlot Slot=AggValueSlot::ignored(), SourceLocation Loc={})
Like EmitLoadOfLValue but also handles complex and aggregate types.
LValue MakeAddrLValue(Address Addr, QualType T, AlignmentSource Source=AlignmentSource::Type)
This class organizes the cross-function state that is used while generating LLVM code.
CodeGenTypes & getTypes()
DefaultABIInfo - The default implementation for ABI specific details.
ABIArgInfo classifyArgumentType(QualType RetTy) const
ABIArgInfo classifyReturnType(QualType RetTy) const
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues,...
Decl - This represents one declaration (or definition), e.g.
bool isAnyComplexType() const
ABIArgInfo classifyArgumentType(CodeGenModule &CGM, CanQualType type)
Classify the rules for how to pass a particular type.
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
std::unique_ptr< TargetCodeGenInfo > createMSP430TargetCodeGenInfo(CodeGenModule &CGM)
bool classifyReturnType(const CGCXXABI &CXXABI, CGFunctionInfo &FI, const ABIInfo &Info)
Address EmitVAArgInstr(CodeGenFunction &CGF, Address VAListAddr, QualType Ty, const ABIArgInfo &AI)
The JSON file list parser is used to communicate input to InstallAPI.
U cast(CodeGen::Address addr)