Skip to content

[AMDGPU] Fix flang build after #97633 #98231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2024
Merged

Conversation

rampitec
Copy link
Collaborator

@rampitec rampitec commented Jul 9, 2024

No description provided.

@llvmbot llvmbot added flang:driver flang Flang issues not falling into any other category labels Jul 9, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 9, 2024

@llvm/pr-subscribers-flang-driver

Author: Stanislav Mekhanoshin (rampitec)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/98231.diff

1 Files Affected:

  • (modified) flang/lib/Frontend/CompilerInstance.cpp (+4-4)
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();
   }
 

@rampitec
Copy link
Collaborator Author

rampitec commented Jul 9, 2024

Fixes this build error after recent commit: https://lab.llvm.org/buildbot/#/builders/157/builds/2114

Sorry, forgot about flang.

@rampitec rampitec requested a review from shiltian July 9, 2024 21:53
@rampitec rampitec merged commit 9739df2 into llvm:main Jul 9, 2024
7 of 9 checks passed
@rampitec rampitec deleted the fix-flang-build branch July 9, 2024 21:53
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:driver flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants