[llvm] 3c503ba - [FunctionImport] Fix build with old mingw (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 15 06:48:08 PDT 2021


Author: Nikita Popov
Date: 2021-08-15T15:47:59+02:00
New Revision: 3c503ba06af40f0621b722fc6027fbd8c693c254

URL: https://github.com/llvm/llvm-project/commit/3c503ba06af40f0621b722fc6027fbd8c693c254
DIFF: https://github.com/llvm/llvm-project/commit/3c503ba06af40f0621b722fc6027fbd8c693c254.diff

LOG: [FunctionImport] Fix build with old mingw (NFC)

std::errc::operation_not_supported is not universally supported.
Make use of LLVM's errc interoperability header, which lists
known-good errc values.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/FunctionImport.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp
index 2f6cf0ca7087a..4535b75e2c482 100644
--- a/llvm/lib/Transforms/IPO/FunctionImport.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp
@@ -39,6 +39,7 @@
 #include "llvm/Support/Casting.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/Errc.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/FileSystem.h"
@@ -496,7 +497,7 @@ static void computeImportForFunction(
                             VI.name().str() + " due to " +
                             getFailureName(Reason);
           auto Error = make_error<StringError>(
-              Msg, std::make_error_code(std::errc::operation_not_supported));
+              Msg, make_error_code(errc::not_supported));
           logAllUnhandledErrors(std::move(Error), errs(),
                                 "Error importing module: ");
           break;


        


More information about the llvm-commits mailing list