Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Driver/ToolChain.cpp
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | static const DriverSuffix *FindDriverSuffix(StringRef ProgName, size_t &Pos) { | ||||
} | } | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
/// Normalize the program name from argv[0] by stripping the file extension if | /// Normalize the program name from argv[0] by stripping the file extension if | ||||
/// present and lower-casing the string on Windows. | /// present and lower-casing the string on Windows. | ||||
static std::string normalizeProgramName(llvm::StringRef Argv0) { | static std::string normalizeProgramName(llvm::StringRef Argv0) { | ||||
std::string ProgName = std::string(llvm::sys::path::stem(Argv0)); | std::string ProgName = std::string(llvm::sys::path::stem(Argv0)); | ||||
#ifdef _WIN32 | if (is_style_windows(llvm::sys::path::Style::native)) { | ||||
// Transform to lowercase for case insensitive file systems. | // Transform to lowercase for case insensitive file systems. | ||||
std::transform(ProgName.begin(), ProgName.end(), ProgName.begin(), ::tolower); | std::transform(ProgName.begin(), ProgName.end(), ProgName.begin(), | ||||
#endif | ::tolower); | ||||
} | |||||
return ProgName; | return ProgName; | ||||
} | } | ||||
static const DriverSuffix *parseDriverSuffix(StringRef ProgName, size_t &Pos) { | static const DriverSuffix *parseDriverSuffix(StringRef ProgName, size_t &Pos) { | ||||
// Try to infer frontend type and default target from the program name by | // Try to infer frontend type and default target from the program name by | ||||
// comparing it against DriverSuffixes in order. | // comparing it against DriverSuffixes in order. | ||||
// If there is a match, the function tries to identify a target as prefix. | // If there is a match, the function tries to identify a target as prefix. | ||||
▲ Show 20 Lines • Show All 1,059 Lines • Show Last 20 Lines |