From 85de1c127d7d05966b4589d33718bbb70b961c24 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 6 Jan 2020 16:03:07 -0800 Subject: Fix debug build (#2561) This requires removing some more LLVM code, which was only pulled in a debug build. --- third_party/llvm-project/Path.cpp | 47 +-------------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) (limited to 'third_party/llvm-project/Path.cpp') diff --git a/third_party/llvm-project/Path.cpp b/third_party/llvm-project/Path.cpp index e4d890a98..2b6835a7e 100644 --- a/third_party/llvm-project/Path.cpp +++ b/third_party/llvm-project/Path.cpp @@ -169,52 +169,7 @@ createUniqueEntity(const Twine &Model, int &ResultFD, SmallVectorImpl &ResultPath, bool MakeAbsolute, unsigned Mode, FSEntity Type, sys::fs::OpenFlags Flags = sys::fs::OF_None) { - - // Limit the number of attempts we make, so that we don't infinite loop. E.g. - // "permission denied" could be for a specific file (so we retry with a - // different name) or for the whole directory (retry would always fail). - // Checking which is racy, so we try a number of times, then give up. - std::error_code EC; - for (int Retries = 128; Retries > 0; --Retries) { - sys::fs::createUniquePath(Model, ResultPath, MakeAbsolute); - // Try to open + create the file. - switch (Type) { - case FS_File: { - EC = sys::fs::openFileForReadWrite(Twine(ResultPath.begin()), ResultFD, - sys::fs::CD_CreateNew, Flags, Mode); - if (EC) { - // errc::permission_denied happens on Windows when we try to open a file - // that has been marked for deletion. - if (EC == errc::file_exists || EC == errc::permission_denied) - continue; - return EC; - } - - return std::error_code(); - } - - case FS_Name: { - EC = sys::fs::access(ResultPath.begin(), sys::fs::AccessMode::Exist); - if (EC == errc::no_such_file_or_directory) - return std::error_code(); - if (EC) - return EC; - continue; - } - - case FS_Dir: { - EC = sys::fs::create_directory(ResultPath.begin(), false); - if (EC) { - if (EC == errc::file_exists) - continue; - return EC; - } - return std::error_code(); - } - } - llvm_unreachable("Invalid Type"); - } - return EC; + llvm_unreachable("createUniqueEntity"); // XXX BINARYEN } namespace llvm { -- cgit v1.2.3