Changeset View
Changeset View
Standalone View
Standalone View
tools/driver/cc1_main.cpp
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | static void ensureSufficientStack() { | ||||
// We should now have a stack of size at least DesiredStackSize. Ensure | // We should now have a stack of size at least DesiredStackSize. Ensure | ||||
// that we can actually use that much, if necessary. | // that we can actually use that much, if necessary. | ||||
ensureStackAddressSpace(); | ensureStackAddressSpace(); | ||||
} | } | ||||
#else | #else | ||||
static void ensureSufficientStack() {} | static void ensureSufficientStack() {} | ||||
#endif | #endif | ||||
/// print supported cpus of the given target | /// Print supported cpus of the given target. | ||||
int PrintSupportedCPUs(std::string TargetStr) { | static int PrintSupportedCPUs(std::string TargetStr) { | ||||
std::string Error; | std::string Error; | ||||
const llvm::Target *TheTarget = | const llvm::Target *TheTarget = | ||||
llvm::TargetRegistry::lookupTarget(TargetStr, Error); | llvm::TargetRegistry::lookupTarget(TargetStr, Error); | ||||
if (!TheTarget) { | if (!TheTarget) { | ||||
llvm::errs() << Error; | llvm::errs() << Error; | ||||
return 1; | return 1; | ||||
} | } | ||||
Show All 32 Lines | #endif | ||||
TextDiagnosticBuffer *DiagsBuffer = new TextDiagnosticBuffer; | TextDiagnosticBuffer *DiagsBuffer = new TextDiagnosticBuffer; | ||||
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagsBuffer); | DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagsBuffer); | ||||
bool Success = CompilerInvocation::CreateFromArgs( | bool Success = CompilerInvocation::CreateFromArgs( | ||||
Clang->getInvocation(), Argv.begin(), Argv.end(), Diags); | Clang->getInvocation(), Argv.begin(), Argv.end(), Diags); | ||||
if (Clang->getFrontendOpts().TimeTrace) | if (Clang->getFrontendOpts().TimeTrace) | ||||
llvm::timeTraceProfilerInitialize(); | llvm::timeTraceProfilerInitialize(); | ||||
// --print-supported-cpus takes priority over the actual compilation | // --print-supported-cpus takes priority over the actual compilation. | ||||
if (Clang->getFrontendOpts().PrintSupportedCPUs) { | if (Clang->getFrontendOpts().PrintSupportedCPUs) | ||||
return PrintSupportedCPUs(Clang->getTargetOpts().Triple); | return PrintSupportedCPUs(Clang->getTargetOpts().Triple); | ||||
} | |||||
// Infer the builtin include path if unspecified. | // Infer the builtin include path if unspecified. | ||||
if (Clang->getHeaderSearchOpts().UseBuiltinIncludes && | if (Clang->getHeaderSearchOpts().UseBuiltinIncludes && | ||||
Clang->getHeaderSearchOpts().ResourceDir.empty()) | Clang->getHeaderSearchOpts().ResourceDir.empty()) | ||||
Clang->getHeaderSearchOpts().ResourceDir = | Clang->getHeaderSearchOpts().ResourceDir = | ||||
CompilerInvocation::GetResourcesPath(Argv0, MainAddr); | CompilerInvocation::GetResourcesPath(Argv0, MainAddr); | ||||
// Create the actual diagnostics engine. | // Create the actual diagnostics engine. | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |