mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 15:40:55 +03:00
Fix error message formatting
This commit is contained in:
parent
06ad20a920
commit
241dc9135f
2 changed files with 28 additions and 58 deletions
|
@ -37,10 +37,9 @@ static bool endsWith(const std::string &str, const std::string &end) {
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static void CreateDirectoryOnDisk(llvm::StringRef fileName) {
|
||||
llvm::StringRef dir(llvm::sys::path::parent_path(fileName));
|
||||
auto dir = llvm::sys::path::parent_path(fileName);
|
||||
if (!dir.empty() && !llvm::sys::fs::exists(dir)) {
|
||||
std::error_code ec = llvm::sys::fs::create_directory(dir);
|
||||
if (ec) {
|
||||
if (auto ec = llvm::sys::fs::create_directory(dir)) {
|
||||
error(Loc(), "failed to create path to file: %s\n%s", dir.data(),
|
||||
ec.message().c_str());
|
||||
fatal();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue