|
clang 22.0.0git
|
#include "clang/CodeGen/BackendUtil.h"#include "BackendConsumer.h"#include "LinkInModulesPass.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/StringExtras.h"#include "llvm/ADT/StringSwitch.h"#include "llvm/Analysis/GlobalsModRef.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/TargetSubtargetInfo.h"#include "llvm/Config/llvm-config.h"#include "llvm/Frontend/Driver/CodeGenOptions.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/DebugInfo.h"#include "llvm/IR/LLVMRemarkStreamer.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/IRPrinter/IRPrintingPasses.h"#include "llvm/LTO/LTOBackend.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/ProfileData/InstrProfCorrelator.h"#include "llvm/Support/BuryPointer.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Compiler.h"#include "llvm/Support/MemoryBuffer.h"#include "llvm/Support/PrettyStackTrace.h"#include "llvm/Support/Program.h"#include "llvm/Support/TimeProfiler.h"#include "llvm/Support/Timer.h"#include "llvm/Support/ToolOutputFile.h"#include "llvm/Support/VirtualFileSystem.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Target/TargetMachine.h"#include "llvm/Target/TargetOptions.h"#include "llvm/TargetParser/SubtargetFeature.h"#include "llvm/TargetParser/Triple.h"#include "llvm/Transforms/HipStdPar/HipStdPar.h"#include "llvm/Transforms/IPO/EmbedBitcodePass.h"#include "llvm/Transforms/IPO/InferFunctionAttrs.h"#include "llvm/Transforms/IPO/LowerTypeTests.h"#include "llvm/Transforms/IPO/ThinLTOBitcodeWriter.h"#include "llvm/Transforms/InstCombine/InstCombine.h"#include "llvm/Transforms/Instrumentation/AddressSanitizer.h"#include "llvm/Transforms/Instrumentation/AddressSanitizerOptions.h"#include "llvm/Transforms/Instrumentation/AllocToken.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/KCFI.h"#include "llvm/Transforms/Instrumentation/LowerAllowCheckPass.h"#include "llvm/Transforms/Instrumentation/MemProfInstrumentation.h"#include "llvm/Transforms/Instrumentation/MemProfUse.h"#include "llvm/Transforms/Instrumentation/MemorySanitizer.h"#include "llvm/Transforms/Instrumentation/NumericalStabilitySanitizer.h"#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h"#include "llvm/Transforms/Instrumentation/RealtimeSanitizer.h"#include "llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h"#include "llvm/Transforms/Instrumentation/SanitizerCoverage.h"#include "llvm/Transforms/Instrumentation/ThreadSanitizer.h"#include "llvm/Transforms/Instrumentation/TypeSanitizer.h"#include "llvm/Transforms/ObjCARC.h"#include "llvm/Transforms/Scalar/EarlyCSE.h"#include "llvm/Transforms/Scalar/GVN.h"#include "llvm/Transforms/Scalar/JumpThreading.h"#include "llvm/Transforms/Utils/Debugify.h"#include "llvm/Transforms/Utils/ModuleUtils.h"#include <limits>#include <memory>#include <optional>#include "llvm/Support/Extension.def"Go to the source code of this file.
Namespaces | |
| namespace | llvm |
| Diagnostic wrappers for TextAPI types for error reporting. | |
| namespace | clang |
| The JSON file list parser is used to communicate input to InstallAPI. | |
Macros | |
| #define | HANDLE_EXTENSION(Ext) |
| #define | HANDLE_EXTENSION(Ext) |
Functions | |
| static cl::opt< bool > | llvm::ClSanitizeOnOptimizerEarlyEP ("sanitizer-early-opt-ep", cl::Optional, cl::desc("Insert sanitizers on OptimizerEarlyEP.")) |
| static cl::opt< PGOOptions::ColdFuncOpt > | llvm::ClPGOColdFuncAttr ("pgo-cold-func-opt", cl::init(PGOOptions::ColdFuncOpt::Default), cl::Hidden, cl::desc("Function attribute to apply to cold functions as determined by PGO"), cl::values(clEnumValN(PGOOptions::ColdFuncOpt::Default, "default", "Default (no attribute)"), clEnumValN(PGOOptions::ColdFuncOpt::OptSize, "optsize", "Mark cold functions with optsize."), clEnumValN(PGOOptions::ColdFuncOpt::MinSize, "minsize", "Mark cold functions with minsize."), clEnumValN(PGOOptions::ColdFuncOpt::OptNone, "optnone", "Mark cold functions with optnone."))) |
| static std::string | getProfileGenName (const CodeGenOptions &CodeGenOpts) |
| static AllocTokenOptions | getAllocTokenOptions (const LangOptions &LangOpts, const CodeGenOptions &CGOpts) |
| static SanitizerCoverageOptions | getSancovOptsFromCGOpts (const CodeGenOptions &CGOpts) |
| static SanitizerBinaryMetadataOptions | getSanitizerBinaryMetadataOptions (const CodeGenOptions &CGOpts) |
| static bool | asanUseGlobalsGC (const Triple &T, const CodeGenOptions &CGOpts) |
| static std::optional< llvm::CodeModel::Model > | getCodeModel (const CodeGenOptions &CodeGenOpts) |
| static CodeGenFileType | getCodeGenFileType (BackendAction Action) |
| static bool | actionRequiresCodeGen (BackendAction Action) |
| static std::string | flattenClangCommandLine (ArrayRef< std::string > Args, StringRef MainFilename) |
| static bool | initTargetOptions (const CompilerInstance &CI, DiagnosticsEngine &Diags, llvm::TargetOptions &Options) |
| static std::optional< GCOVOptions > | getGCOVOptions (const CodeGenOptions &CodeGenOpts, const LangOptions &LangOpts) |
| static std::optional< InstrProfOptions > | getInstrProfOptions (const CodeGenOptions &CodeGenOpts, const LangOptions &LangOpts) |
| static void | setCommandLineOpts (const CodeGenOptions &CodeGenOpts, vfs::FileSystem &VFS) |
| static OptimizationLevel | mapToLevel (const CodeGenOptions &Opts) |
| static void | addKCFIPass (const Triple &TargetTriple, const LangOptions &LangOpts, PassBuilder &PB) |
| static void | addSanitizers (const Triple &TargetTriple, const CodeGenOptions &CodeGenOpts, const LangOptions &LangOpts, PassBuilder &PB) |
| static void | addAllocTokenPass (const Triple &TargetTriple, const CodeGenOptions &CodeGenOpts, const LangOptions &LangOpts, PassBuilder &PB) |
| static void | runThinLTOBackend (CompilerInstance &CI, ModuleSummaryIndex *CombinedIndex, llvm::Module *M, std::unique_ptr< raw_pwrite_stream > OS, std::string SampleProfile, std::string ProfileRemapping, BackendAction Action) |
Variables | |
| LLVM_ABI cl::opt< InstrProfCorrelator::ProfCorrelatorKind > | llvm::ProfileCorrelate |
| llvm::cl::opt< bool > | clang::ClSanitizeGuardChecks |
| #define HANDLE_EXTENSION | ( | Ext | ) |
Definition at line 99 of file BackendUtil.cpp.
| #define HANDLE_EXTENSION | ( | Ext | ) |
Definition at line 99 of file BackendUtil.cpp.
|
static |
Definition at line 335 of file BackendUtil.cpp.
References clang::Backend_EmitBC, clang::Backend_EmitLL, and clang::Backend_EmitNothing.
|
static |
Definition at line 845 of file BackendUtil.cpp.
References getAllocTokenOptions(), clang::SanitizerSet::has(), and clang::LangOptions::Sanitize.
|
static |
Definition at line 683 of file BackendUtil.cpp.
References clang::SanitizerSet::has(), and clang::LangOptions::Sanitize.
|
static |
Definition at line 709 of file BackendUtil.cpp.
References clang::CodeGenOptions::AllowRuntimeCheckSkipHotCutoff, asanUseGlobalsGC(), llvm::ClSanitizeOnOptimizerEarlyEP(), clang::SanitizerMaskCutoffs::getAllScaled(), getSancovOptsFromCGOpts(), getSanitizerBinaryMetadataOptions(), clang::SanitizerSet::has(), clang::CodeGenOptions::hasSanitizeBinaryMetadata(), clang::CodeGenOptions::hasSanitizeCoverage(), clang::LangOptions::NoSanitizeFiles, clang::LangOptions::Sanitize, clang::CodeGenOptions::SanitizeCoverageAllowlistFiles, clang::CodeGenOptions::SanitizeCoverageIgnorelistFiles, clang::CodeGenOptions::SanitizeMetadataIgnorelistFiles, clang::CodeGenOptions::SanitizeRecover, and clang::CodeGenOptions::SanitizeSkipHotCutoffs.
|
static |
|
static |
Definition at line 340 of file BackendUtil.cpp.
References contains().
Referenced by initTargetOptions().
|
static |
Definition at line 237 of file BackendUtil.cpp.
References clang::LangOptions::AllocTokenMax, and clang::LangOptions::AllocTokenMode.
Referenced by addAllocTokenPass().
|
static |
Definition at line 324 of file BackendUtil.cpp.
References clang::Backend_EmitAssembly, clang::Backend_EmitMCNull, and clang::Backend_EmitObj.
Referenced by runThinLTOBackend().
|
static |
Definition at line 309 of file BackendUtil.cpp.
References clang::CodeGenOptions::CodeModel, and clang::Default.
Referenced by runThinLTOBackend().
|
static |
|
static |
Definition at line 562 of file BackendUtil.cpp.
References clang::CodeGenOptions::hasProfileClangInstr(), and clang::CodeGenOptions::InstrProfileOutput.
|
static |
Definition at line 132 of file BackendUtil.cpp.
References clang::FileName, and clang::CodeGenOptions::InstrProfileOutput.
Referenced by runThinLTOBackend().
|
static |
Definition at line 249 of file BackendUtil.cpp.
Referenced by addSanitizers().
|
static |
Definition at line 274 of file BackendUtil.cpp.
Referenced by addSanitizers().
|
static |
Definition at line 373 of file BackendUtil.cpp.
References clang::TargetOptions::ABI, clang::CodeGenOptions::Always, clang::frontend::Angled, clang::CodeGenOptions::Argv0, clang::CodeGenOptions::AsSecureLogFile, clang::CodeGenOptions::Auto, clang::CodeGenOptions::BBSections, clang::CodeGenOptions::BinutilsVersion, clang::CodeGenOptions::CommandLineArgs, clang::TargetOptions::EABIVersion, flattenClangCommandLine(), clang::CodeGenOptions::FloatABI, clang::LangOptionsBase::FPM_Fast, clang::LangOptionsBase::FPM_FastHonorPragmas, clang::LangOptionsBase::FPM_Off, clang::LangOptionsBase::FPM_On, clang::CompilerInstance::getCodeGenOpts(), clang::CompilerInstance::getHeaderSearchOpts(), clang::CompilerInstance::getLangOpts(), clang::CompilerInstance::getTargetOpts(), clang::CompilerInstance::getVirtualFileSystem(), clang::CodeGenOptions::hasDWARFExceptions(), clang::CodeGenOptions::hasSEHExceptions(), clang::CodeGenOptions::hasSjLjExceptions(), clang::CodeGenOptions::hasWasmExceptions(), clang::CodeGenOptions::MainFileName, clang::CodeGenOptions::Never, clang::CodeGenOptions::ObjectFilenameForDebug, clang::LangOptionsBase::POSIX, clang::frontend::Quoted, clang::DiagnosticsEngine::Report(), clang::LangOptionsBase::Single, clang::CodeGenOptions::SplitDwarfFile, clang::CodeGenOptions::StackUsageOutput, and clang::frontend::System.
Referenced by runThinLTOBackend().
|
static |
Definition at line 652 of file BackendUtil.cpp.
|
static |
Definition at line 1321 of file BackendUtil.cpp.
References clang::Backend_EmitBC, clang::Backend_EmitLL, clang::Backend_EmitNothing, clang::Error, getCodeGenFileType(), clang::CompilerInstance::getCodeGenOpts(), getCodeModel(), clang::CompilerInstance::getDiagnostics(), getProfileGenName(), clang::CompilerInstance::getTargetOpts(), clang::CompilerInstance::getVirtualFileSystem(), initTargetOptions(), and setCommandLineOpts().
Referenced by clang::emitBackendOutput().
|
static |
Definition at line 575 of file BackendUtil.cpp.
References clang::CodeGenOptions::DebugPass, and clang::CodeGenOptions::LimitFloatPrecision.
Referenced by runThinLTOBackend().