10 #include "TargetInfo.h"
12 using namespace clang;
25 void setTargetAttributes(
const Decl *D, llvm::GlobalValue *GV,
31 void 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;
47 "__isr_" + Twine(Num), F);
52 std::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,...
Decl - This represents one declaration (or definition), e.g.
std::unique_ptr< TargetCodeGenInfo > createM68kTargetCodeGenInfo(CodeGenModule &CGM)
const internal::VariadicAllOfMatcher< Attr > attr
Matches attributes.
std::unique_ptr< DiagnosticConsumer > create(StringRef OutputFile, DiagnosticOptions *Diags, bool MergeChildRecords=false)
Returns a DiagnosticConsumer that serializes diagnostics to a bitcode file.
The JSON file list parser is used to communicate input to InstallAPI.