[flang-commits] [flang] 9739df2 - [AMDGPU] Fix flang build after #97633 (#98231)

via flang-commits flang-commits at lists.llvm.org
Tue Jul 9 14:53:24 PDT 2024


Author: Stanislav Mekhanoshin
Date: 2024-07-09T14:53:21-07:00
New Revision: 9739df2c8948c265955a2907ce00f4225dced5d1

URL: https://github.com/llvm/llvm-project/commit/9739df2c8948c265955a2907ce00f4225dced5d1
DIFF: https://github.com/llvm/llvm-project/commit/9739df2c8948c265955a2907ce00f4225dced5d1.diff

LOG: [AMDGPU] Fix flang build after #97633 (#98231)

Added: 
    

Modified: 
    flang/lib/Frontend/CompilerInstance.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Frontend/CompilerInstance.cpp b/flang/lib/Frontend/CompilerInstance.cpp
index 27c36b7f84d89..d37430e0e5773 100644
--- a/flang/lib/Frontend/CompilerInstance.cpp
+++ b/flang/lib/Frontend/CompilerInstance.cpp
@@ -212,7 +212,6 @@ getExplicitAndImplicitAMDGPUTargetFeatures(clang::DiagnosticsEngine &diags,
                                            const llvm::Triple triple) {
   llvm::StringRef cpu = targetOpts.cpu;
   llvm::StringMap<bool> implicitFeaturesMap;
-  std::string errorMsg;
   // Get the set of implicit target features
   llvm::AMDGPU::fillAMDGPUFeatureMap(cpu, triple, implicitFeaturesMap);
 
@@ -222,11 +221,12 @@ getExplicitAndImplicitAMDGPUTargetFeatures(clang::DiagnosticsEngine &diags,
     implicitFeaturesMap[userKeyString] = (userFeature[0] == '+');
   }
 
-  if (!llvm::AMDGPU::insertWaveSizeFeature(cpu, triple, implicitFeaturesMap,
-                                           errorMsg)) {
+  auto HasError =
+      llvm::AMDGPU::insertWaveSizeFeature(cpu, triple, implicitFeaturesMap);
+  if (HasError.first) {
     unsigned diagID = diags.getCustomDiagID(clang::DiagnosticsEngine::Error,
                                             "Unsupported feature ID: %0");
-    diags.Report(diagID) << errorMsg.data();
+    diags.Report(diagID) << HasError.second;
     return std::string();
   }
 


        


More information about the flang-commits mailing list