10#include "TargetInfo.h"
31void M68kTargetCodeGenInfo::setTargetAttributes(
33 if (
const auto *FD = dyn_cast_or_null<FunctionDecl>(
D)) {
34 if (
const auto *attr = FD->getAttr<M68kInterruptAttr>()) {
36 llvm::Function *F = cast<llvm::Function>(GV);
39 F->setCallingConv(llvm::CallingConv::M68k_INTR);
42 F->addFnAttr(llvm::Attribute::NoInline);
45 unsigned Num =
attr->getNumber() / 2;
46 llvm::GlobalAlias::create(llvm::Function::ExternalLinkage,
47 "__isr_" + Twine(Num), F);
52std::unique_ptr<TargetCodeGenInfo>
54 return std::make_unique<M68kTargetCodeGenInfo>(CGM.
getTypes());
This class organizes the cross-function state that is used while generating LLVM code.
CodeGenTypes & getTypes()
This class organizes the cross-module state that is used while lowering AST types to LLVM types.
DefaultABIInfo - The default implementation for ABI specific details.
TargetCodeGenInfo - This class organizes various target-specific codegeneration issues,...
virtual void setTargetAttributes(const Decl *D, llvm::GlobalValue *GV, CodeGen::CodeGenModule &M) const
setTargetAttributes - Provides a convenient hook to handle extra target-specific attributes for the g...
Decl - This represents one declaration (or definition), e.g.
std::unique_ptr< TargetCodeGenInfo > createM68kTargetCodeGenInfo(CodeGenModule &CGM)
const internal::VariadicAllOfMatcher< Attr > attr
Matches attributes.
The JSON file list parser is used to communicate input to InstallAPI.