clang  15.0.0git
Namespaces | Macros | Functions | Variables
BackendUtil.cpp File Reference
#include "clang/CodeGen/BackendUtil.h"
#include "clang/Basic/CodeGenOptions.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/TargetOptions.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/Frontend/Utils.h"
#include "clang/Lex/HeaderSearchOptions.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/StackSafetyAnalysis.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/Bitcode/BitcodeReader.h"
#include "llvm/Bitcode/BitcodeWriter.h"
#include "llvm/Bitcode/BitcodeWriterPass.h"
#include "llvm/CodeGen/RegAllocRegistry.h"
#include "llvm/CodeGen/SchedulerRegistry.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/IRPrintingPasses.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ModuleSummaryIndex.h"
#include "llvm/IR/PassManager.h"
#include "llvm/IR/Verifier.h"
#include "llvm/LTO/LTOBackend.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/SubtargetFeature.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Object/OffloadBinary.h"
#include "llvm/Passes/PassBuilder.h"
#include "llvm/Passes/PassPlugin.h"
#include "llvm/Passes/StandardInstrumentations.h"
#include "llvm/Support/BuryPointer.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/TimeProfiler.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/ToolOutputFile.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Transforms/Coroutines/CoroCleanup.h"
#include "llvm/Transforms/Coroutines/CoroEarly.h"
#include "llvm/Transforms/Coroutines/CoroElide.h"
#include "llvm/Transforms/Coroutines/CoroSplit.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/IPO/AlwaysInliner.h"
#include "llvm/Transforms/IPO/LowerTypeTests.h"
#include "llvm/Transforms/IPO/ThinLTOBitcodeWriter.h"
#include "llvm/Transforms/InstCombine/InstCombine.h"
#include "llvm/Transforms/Instrumentation.h"
#include "llvm/Transforms/Instrumentation/AddressSanitizer.h"
#include "llvm/Transforms/Instrumentation/AddressSanitizerOptions.h"
#include "llvm/Transforms/Instrumentation/BoundsChecking.h"
#include "llvm/Transforms/Instrumentation/DataFlowSanitizer.h"
#include "llvm/Transforms/Instrumentation/GCOVProfiler.h"
#include "llvm/Transforms/Instrumentation/HWAddressSanitizer.h"
#include "llvm/Transforms/Instrumentation/InstrProfiling.h"
#include "llvm/Transforms/Instrumentation/MemProfiler.h"
#include "llvm/Transforms/Instrumentation/MemorySanitizer.h"
#include "llvm/Transforms/Instrumentation/SanitizerCoverage.h"
#include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"
#include "llvm/Transforms/ObjCARC.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Scalar/EarlyCSE.h"
#include "llvm/Transforms/Scalar/GVN.h"
#include "llvm/Transforms/Scalar/LowerMatrixIntrinsics.h"
#include "llvm/Transforms/Utils.h"
#include "llvm/Transforms/Utils/CanonicalizeAliases.h"
#include "llvm/Transforms/Utils/Debugify.h"
#include "llvm/Transforms/Utils/EntryExitInstrumenter.h"
#include "llvm/Transforms/Utils/ModuleUtils.h"
#include "llvm/Transforms/Utils/NameAnonGlobals.h"
#include "llvm/Transforms/Utils/SymbolRewriter.h"
#include <memory>
#include "llvm/Support/Extension.def"

Go to the source code of this file.

Namespaces

 llvm
 YAML serialization mapping.
 

Macros

#define HANDLE_EXTENSION(Ext)   llvm::PassPluginLibraryInfo get##Ext##PluginInfo();
 
#define HANDLE_EXTENSION(Ext)   get##Ext##PluginInfo().RegisterPassBuilderCallbacks(PB);
 

Functions

static SanitizerCoverageOptions getSancovOptsFromCGOpts (const CodeGenOptions &CGOpts)
 
static bool asanUseGlobalsGC (const Triple &T, const CodeGenOptions &CGOpts)
 
static TargetLibraryInfoImpl * createTLII (llvm::Triple &TargetTriple, const CodeGenOptions &CodeGenOpts)
 
static CodeGenOpt::Level getCGOptLevel (const CodeGenOptions &CodeGenOpts)
 
static Optional< llvm::CodeModel::Model > getCodeModel (const CodeGenOptions &CodeGenOpts)
 
static CodeGenFileType getCodeGenFileType (BackendAction Action)
 
static bool actionRequiresCodeGen (BackendAction Action)
 
static bool initTargetOptions (DiagnosticsEngine &Diags, llvm::TargetOptions &Options, const CodeGenOptions &CodeGenOpts, const clang::TargetOptions &TargetOpts, const LangOptions &LangOpts, const HeaderSearchOptions &HSOpts)
 
static Optional< GCOVOptions > getGCOVOptions (const CodeGenOptions &CodeGenOpts, const LangOptions &LangOpts)
 
static Optional< InstrProfOptions > getInstrProfOptions (const CodeGenOptions &CodeGenOpts, const LangOptions &LangOpts)
 
static void setCommandLineOpts (const CodeGenOptions &CodeGenOpts)
 
static OptimizationLevel mapToLevel (const CodeGenOptions &Opts)
 
static void addSanitizers (const Triple &TargetTriple, const CodeGenOptions &CodeGenOpts, const LangOptions &LangOpts, PassBuilder &PB)
 
static void runThinLTOBackend (DiagnosticsEngine &Diags, ModuleSummaryIndex *CombinedIndex, Module *M, const HeaderSearchOptions &HeaderOpts, const CodeGenOptions &CGOpts, const clang::TargetOptions &TOpts, const LangOptions &LOpts, std::unique_ptr< raw_pwrite_stream > OS, std::string SampleProfile, std::string ProfileRemapping, BackendAction Action)
 

Variables

cl::opt< boolllvm::DebugInfoCorrelate
 

Macro Definition Documentation

◆ HANDLE_EXTENSION [1/2]

#define HANDLE_EXTENSION (   Ext)    llvm::PassPluginLibraryInfo get##Ext##PluginInfo();

Definition at line 93 of file BackendUtil.cpp.

◆ HANDLE_EXTENSION [2/2]

#define HANDLE_EXTENSION (   Ext)    get##Ext##PluginInfo().RegisterPassBuilderCallbacks(PB);

Definition at line 93 of file BackendUtil.cpp.

Function Documentation

◆ actionRequiresCodeGen()

static bool actionRequiresCodeGen ( BackendAction  Action)
static

◆ addSanitizers()

static void addSanitizers ( const Triple &  TargetTriple,
const CodeGenOptions CodeGenOpts,
const LangOptions LangOpts,
PassBuilder &  PB 
)
static

Definition at line 622 of file BackendUtil.cpp.

◆ asanUseGlobalsGC()

static bool asanUseGlobalsGC ( const Triple &  T,
const CodeGenOptions CGOpts 
)
static

Definition at line 225 of file BackendUtil.cpp.

◆ createTLII()

static TargetLibraryInfoImpl* createTLII ( llvm::Triple &  TargetTriple,
const CodeGenOptions CodeGenOpts 
)
static

◆ getCGOptLevel()

static CodeGenOpt::Level getCGOptLevel ( const CodeGenOptions CodeGenOpts)
static

Definition at line 281 of file BackendUtil.cpp.

References clang::XRayInstrKind::None.

Referenced by runThinLTOBackend().

◆ getCodeGenFileType()

static CodeGenFileType getCodeGenFileType ( BackendAction  Action)
static

◆ getCodeModel()

static Optional<llvm::CodeModel::Model> getCodeModel ( const CodeGenOptions CodeGenOpts)
static

Definition at line 297 of file BackendUtil.cpp.

References clang::CodeGenOptions::CodeModel.

Referenced by runThinLTOBackend().

◆ getGCOVOptions()

static Optional<GCOVOptions> getGCOVOptions ( const CodeGenOptions CodeGenOpts,
const LangOptions LangOpts 
)
static

Definition at line 485 of file BackendUtil.cpp.

◆ getInstrProfOptions()

static Optional<InstrProfOptions> getInstrProfOptions ( const CodeGenOptions CodeGenOpts,
const LangOptions LangOpts 
)
static

Definition at line 503 of file BackendUtil.cpp.

◆ getSancovOptsFromCGOpts()

static SanitizerCoverageOptions getSancovOptsFromCGOpts ( const CodeGenOptions CGOpts)
static

Definition at line 199 of file BackendUtil.cpp.

References Type.

◆ initTargetOptions()

static bool initTargetOptions ( DiagnosticsEngine Diags,
llvm::TargetOptions &  Options,
const CodeGenOptions CodeGenOpts,
const clang::TargetOptions TargetOpts,
const LangOptions LangOpts,
const HeaderSearchOptions HSOpts 
)
static

Definition at line 328 of file BackendUtil.cpp.

Referenced by runThinLTOBackend().

◆ mapToLevel()

static OptimizationLevel mapToLevel ( const CodeGenOptions Opts)
static

Definition at line 591 of file BackendUtil.cpp.

◆ runThinLTOBackend()

static void runThinLTOBackend ( DiagnosticsEngine Diags,
ModuleSummaryIndex *  CombinedIndex,
Module M,
const HeaderSearchOptions HeaderOpts,
const CodeGenOptions CGOpts,
const clang::TargetOptions TOpts,
const LangOptions LOpts,
std::unique_ptr< raw_pwrite_stream >  OS,
std::string  SampleProfile,
std::string  ProfileRemapping,
BackendAction  Action 
)
static

◆ setCommandLineOpts()

static void setCommandLineOpts ( const CodeGenOptions CodeGenOpts)
static