================
@@ -1537,8 +1524,17 @@ CheckHeterogeneousArchive(StringRef ArchiveName,
if (CodeObjectFileError)
return CodeObjectFileError;
- auto &&ConflictingArchs = clang::getConflictTargetIDCombination(BundleIds);
- if (ConflictingArchs) {
+ // A single bundle may contain several triples. Pair each target ID with
its
+ // own triple; the conflict check groups by resolved processor, which is
+ // spelling-independent.
+ llvm::SmallVector<clang::TargetIDEntry> Entries;
+ for (StringRef BundleId : BundleIds) {
+ OffloadTargetInfo Info(BundleId, BundlerConfig);
+ Entries.emplace_back(Info.Triple, Info.TargetID);
----------------
yxsamliu wrote:
`TargetIDEntry` stores the `Triple` by reference, but here the reference points
to `Info.Triple` from a loop-local `OffloadTargetInfo`. After each iteration,
`Info` is destroyed, so `Entries` contains dangling references when
`getConflictTargetIDCombination` is called. Could we make `TargetIDEntry` own
the `Triple`, or keep the `OffloadTargetInfo` objects alive until after the
conflict check?
https://github.com/llvm/llvm-project/pull/209845
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits