[clang] 255986e - [Driver] BuildOffloadingActions: Stabilize iteration order
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 20 21:45:45 PDT 2024
Author: Fangrui Song
Date: 2024-06-20T21:45:40-07:00
New Revision: 255986e27fcf9f0b36f7a23fbe030fcca1ba0249
URL: https://github.com/llvm/llvm-project/commit/255986e27fcf9f0b36f7a23fbe030fcca1ba0249
DIFF: https://github.com/llvm/llvm-project/commit/255986e27fcf9f0b36f7a23fbe030fcca1ba0249.diff
LOG: [Driver] BuildOffloadingActions: Stabilize iteration order
Otherwise hip-phases.hip could fail when llvm::hash_value(StringRef)
changes.
Added:
Modified:
clang/lib/Driver/Driver.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 67bf0604acd6e..0298d22203d9d 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -4595,6 +4595,7 @@ Action *Driver::BuildOffloadingActions(Compilation &C,
for (const ToolChain *TC : ToolChains)
for (StringRef Arch : getOffloadArchs(C, Args, Kind, TC))
TCAndArchs.push_back(std::make_pair(TC, Arch));
+ llvm::sort(TCAndArchs, llvm::less_second());
for (unsigned I = 0, E = TCAndArchs.size(); I != E; ++I)
DeviceActions.push_back(C.MakeAction<InputAction>(*InputArg, InputType));
More information about the cfe-commits
mailing list