DirName != llvm::sys::path::root_path(DirName) &&
llvm::sys::path::is_separator(DirName.back()))
DirName = DirName.substr(0, DirName.size()-1);
+ Optional<std::string> DirNameStr;
if (is_style_windows(llvm::sys::path::Style::native)) {
// Fixing a problem with "clang C:test.c" on Windows.
// Stat("C:") does not recognize "C:" as a valid directory
- std::string DirNameStr;
if (DirName.size() > 1 && DirName.back() == ':' &&
DirName.equals_insensitive(llvm::sys::path::root_name(DirName))) {
DirNameStr = DirName.str() + '.';
- DirName = DirNameStr;
+ DirName = *DirNameStr;
}
}