clang  6.0.0svn
Functions
BackendUtil.cpp File Reference
#include "clang/CodeGen/BackendUtil.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/TargetOptions.h"
#include "clang/Frontend/CodeGenOptions.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/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/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/Verifier.h"
#include "llvm/LTO/LTOBackend.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/SubtargetFeature.h"
#include "llvm/Passes/PassBuilder.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Target/TargetSubtargetInfo.h"
#include "llvm/Transforms/Coroutines.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/IPO/AlwaysInliner.h"
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
#include "llvm/Transforms/IPO/ThinLTOBitcodeWriter.h"
#include "llvm/Transforms/Instrumentation.h"
#include "llvm/Transforms/ObjCARC.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Scalar/GVN.h"
#include "llvm/Transforms/Utils/NameAnonGlobals.h"
#include "llvm/Transforms/Utils/SymbolRewriter.h"
#include <memory>

Go to the source code of this file.

Functions

static void addObjCARCAPElimPass (const PassManagerBuilder &Builder, PassManagerBase &PM)
 
static void addObjCARCExpandPass (const PassManagerBuilder &Builder, PassManagerBase &PM)
 
static void addObjCARCOptPass (const PassManagerBuilder &Builder, PassManagerBase &PM)
 
static void addAddDiscriminatorsPass (const PassManagerBuilder &Builder, legacy::PassManagerBase &PM)
 
static void addBoundsCheckingPass (const PassManagerBuilder &Builder, legacy::PassManagerBase &PM)
 
static void addSanitizerCoveragePass (const PassManagerBuilder &Builder, legacy::PassManagerBase &PM)
 
static bool asanUseGlobalsGC (const Triple &T, const CodeGenOptions &CGOpts)
 
static void addAddressSanitizerPasses (const PassManagerBuilder &Builder, legacy::PassManagerBase &PM)
 
static void addKernelAddressSanitizerPasses (const PassManagerBuilder &Builder, legacy::PassManagerBase &PM)
 
static void addMemorySanitizerPass (const PassManagerBuilder &Builder, legacy::PassManagerBase &PM)
 
static void addThreadSanitizerPass (const PassManagerBuilder &Builder, legacy::PassManagerBase &PM)
 
static void addDataFlowSanitizerPass (const PassManagerBuilder &Builder, legacy::PassManagerBase &PM)
 
static void addEfficiencySanitizerPass (const PassManagerBuilder &Builder, legacy::PassManagerBase &PM)
 
static TargetLibraryInfoImpl * createTLII (llvm::Triple &TargetTriple, const CodeGenOptions &CodeGenOpts)
 
static void addSymbolRewriterPass (const CodeGenOptions &Opts, legacy::PassManager *MPM)
 
static CodeGenOpt::Level getCGOptLevel (const CodeGenOptions &CodeGenOpts)
 
static Optional< llvm::CodeModel::Model > getCodeModel (const CodeGenOptions &CodeGenOpts)
 
static llvm::Reloc::Model getRelocModel (const CodeGenOptions &CodeGenOpts)
 
static TargetMachine::CodeGenFileType getCodeGenFileType (BackendAction Action)
 
static void initTargetOptions (llvm::TargetOptions &Options, const CodeGenOptions &CodeGenOpts, const clang::TargetOptions &TargetOpts, const LangOptions &LangOpts, const HeaderSearchOptions &HSOpts)
 
static void setCommandLineOpts (const CodeGenOptions &CodeGenOpts)
 
static PassBuilder::OptimizationLevel mapToLevel (const CodeGenOptions &Opts)
 
static void runThinLTOBackend (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, BackendAction Action)
 
static const char * getSectionNameForBitcode (const Triple &T)
 
static const char * getSectionNameForCommandline (const Triple &T)
 

Function Documentation

◆ addAddDiscriminatorsPass()

static void addAddDiscriminatorsPass ( const PassManagerBuilder &  Builder,
legacy::PassManagerBase &  PM 
)
static

Definition at line 164 of file BackendUtil.cpp.

◆ addAddressSanitizerPasses()

static void addAddressSanitizerPasses ( const PassManagerBuilder &  Builder,
legacy::PassManagerBase &  PM 
)
static

Definition at line 215 of file BackendUtil.cpp.

◆ addBoundsCheckingPass()

static void addBoundsCheckingPass ( const PassManagerBuilder &  Builder,
legacy::PassManagerBase &  PM 
)
static

Definition at line 169 of file BackendUtil.cpp.

◆ addDataFlowSanitizerPass()

static void addDataFlowSanitizerPass ( const PassManagerBuilder &  Builder,
legacy::PassManagerBase &  PM 
)
static

Definition at line 266 of file BackendUtil.cpp.

◆ addEfficiencySanitizerPass()

static void addEfficiencySanitizerPass ( const PassManagerBuilder &  Builder,
legacy::PassManagerBase &  PM 
)
static

Definition at line 274 of file BackendUtil.cpp.

◆ addKernelAddressSanitizerPasses()

static void addKernelAddressSanitizerPasses ( const PassManagerBuilder &  Builder,
legacy::PassManagerBase &  PM 
)
static

Definition at line 230 of file BackendUtil.cpp.

◆ addMemorySanitizerPass()

static void addMemorySanitizerPass ( const PassManagerBuilder &  Builder,
legacy::PassManagerBase &  PM 
)
static

Definition at line 239 of file BackendUtil.cpp.

◆ addObjCARCAPElimPass()

static void addObjCARCAPElimPass ( const PassManagerBuilder &  Builder,
PassManagerBase &  PM 
)
static

Definition at line 149 of file BackendUtil.cpp.

◆ addObjCARCExpandPass()

static void addObjCARCExpandPass ( const PassManagerBuilder &  Builder,
PassManagerBase &  PM 
)
static

Definition at line 154 of file BackendUtil.cpp.

◆ addObjCARCOptPass()

static void addObjCARCOptPass ( const PassManagerBuilder &  Builder,
PassManagerBase &  PM 
)
static

Definition at line 159 of file BackendUtil.cpp.

◆ addSanitizerCoveragePass()

static void addSanitizerCoveragePass ( const PassManagerBuilder &  Builder,
legacy::PassManagerBase &  PM 
)
static

Definition at line 174 of file BackendUtil.cpp.

◆ addSymbolRewriterPass()

static void addSymbolRewriterPass ( const CodeGenOptions Opts,
legacy::PassManager *  MPM 
)
static

Definition at line 313 of file BackendUtil.cpp.

References clang::CodeGenOptions::RewriteMapFiles.

◆ addThreadSanitizerPass()

static void addThreadSanitizerPass ( const PassManagerBuilder &  Builder,
legacy::PassManagerBase &  PM 
)
static

Definition at line 261 of file BackendUtil.cpp.

◆ asanUseGlobalsGC()

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

Definition at line 201 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 324 of file BackendUtil.cpp.

References clang::Default, and clang::None.

Referenced by setCommandLineOpts().

◆ getCodeGenFileType()

static TargetMachine::CodeGenFileType getCodeGenFileType ( BackendAction  Action)
static

Definition at line 369 of file BackendUtil.cpp.

◆ getCodeModel()

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

Definition at line 340 of file BackendUtil.cpp.

References clang::CodeGenOptions::CodeModel, and clang::None.

Referenced by setCommandLineOpts().

◆ getRelocModel()

static llvm::Reloc::Model getRelocModel ( const CodeGenOptions CodeGenOpts)
static

Definition at line 354 of file BackendUtil.cpp.

References clang::CodeGenOptions::RelocationModel.

Referenced by setCommandLineOpts().

◆ getSectionNameForBitcode()

static const char* getSectionNameForBitcode ( const Triple &  T)
static

Definition at line 1160 of file BackendUtil.cpp.

Referenced by clang::EmbedBitcode().

◆ getSectionNameForCommandline()

static const char* getSectionNameForCommandline ( const Triple &  T)
static

Definition at line 1173 of file BackendUtil.cpp.

Referenced by clang::EmbedBitcode().

◆ initTargetOptions()

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

Definition at line 380 of file BackendUtil.cpp.

◆ mapToLevel()

static PassBuilder::OptimizationLevel mapToLevel ( const CodeGenOptions Opts)
static

◆ runThinLTOBackend()

static void runThinLTOBackend ( 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,
BackendAction  Action 
)
static

Definition at line 1004 of file BackendUtil.cpp.

References setCommandLineOpts().

◆ setCommandLineOpts()

static void setCommandLineOpts ( const CodeGenOptions CodeGenOpts)
static