Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Frontend/FrontendActions.cpp
Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | |||||
std::unique_ptr<ASTConsumer> | std::unique_ptr<ASTConsumer> | ||||
ASTViewAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { | ASTViewAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { | ||||
return CreateASTViewer(); | return CreateASTViewer(); | ||||
} | } | ||||
std::unique_ptr<ASTConsumer> | std::unique_ptr<ASTConsumer> | ||||
GeneratePCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { | GeneratePCHAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { | ||||
if (CI.getPreprocessorOpts().ScanningMode) | |||||
return std::make_unique<ASTConsumer>(); | |||||
std::string Sysroot; | std::string Sysroot; | ||||
if (!ComputeASTConsumerArguments(CI, /*ref*/ Sysroot)) | if (!ComputeASTConsumerArguments(CI, /*ref*/ Sysroot)) | ||||
return nullptr; | return nullptr; | ||||
std::string OutputFile; | std::string OutputFile; | ||||
std::unique_ptr<raw_pwrite_stream> OS = | std::unique_ptr<raw_pwrite_stream> OS = | ||||
CreateOutputFile(CI, InFile, /*ref*/ OutputFile); | CreateOutputFile(CI, InFile, /*ref*/ OutputFile); | ||||
if (!OS) | if (!OS) | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
bool GeneratePCHAction::BeginSourceFileAction(CompilerInstance &CI) { | bool GeneratePCHAction::BeginSourceFileAction(CompilerInstance &CI) { | ||||
CI.getLangOpts().CompilingPCH = true; | CI.getLangOpts().CompilingPCH = true; | ||||
return true; | return true; | ||||
} | } | ||||
std::unique_ptr<ASTConsumer> | std::unique_ptr<ASTConsumer> | ||||
GenerateModuleAction::CreateASTConsumer(CompilerInstance &CI, | GenerateModuleAction::CreateASTConsumer(CompilerInstance &CI, | ||||
StringRef InFile) { | StringRef InFile) { | ||||
if (CI.getPreprocessorOpts().ScanningMode) | |||||
return std::make_unique<ASTConsumer>(); | |||||
std::unique_ptr<raw_pwrite_stream> OS = CreateOutputFile(CI, InFile); | std::unique_ptr<raw_pwrite_stream> OS = CreateOutputFile(CI, InFile); | ||||
if (!OS) | if (!OS) | ||||
return nullptr; | return nullptr; | ||||
std::string OutputFile = CI.getFrontendOpts().OutputFile; | std::string OutputFile = CI.getFrontendOpts().OutputFile; | ||||
std::string Sysroot; | std::string Sysroot; | ||||
auto Buffer = std::make_shared<PCHBuffer>(); | auto Buffer = std::make_shared<PCHBuffer>(); | ||||
▲ Show 20 Lines • Show All 1,006 Lines • Show Last 20 Lines |