Skip to content

Commit 255986e

Browse files
committed
[Driver] BuildOffloadingActions: Stabilize iteration order
Otherwise hip-phases.hip could fail when llvm::hash_value(StringRef) changes.
1 parent a2cd846 commit 255986e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4595,6 +4595,7 @@ Action *Driver::BuildOffloadingActions(Compilation &C,
45954595
for (const ToolChain *TC : ToolChains)
45964596
for (StringRef Arch : getOffloadArchs(C, Args, Kind, TC))
45974597
TCAndArchs.push_back(std::make_pair(TC, Arch));
4598+
llvm::sort(TCAndArchs, llvm::less_second());
45984599

45994600
for (unsigned I = 0, E = TCAndArchs.size(); I != E; ++I)
46004601
DeviceActions.push_back(C.MakeAction<InputAction>(*InputArg, InputType));

0 commit comments

Comments
 (0)