[PATCH] D135791: [Clang] Do not crash when an invalid offload architecture is set
Artem Belevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 12 11:09:37 PDT 2022
tra accepted this revision.
tra added inline comments.
================
Comment at: clang/lib/Driver/Driver.cpp:4211
if (IsNVIDIAGpuArch(Arch))
- return Args.MakeArgStringRef(CudaArchToString(Arch));
+ return StringRef(Args.MakeArgStringRef(CudaArchToString(Arch)));
----------------
This can be undone now, too.
================
Comment at: clang/lib/Driver/Driver.cpp:4224
}
- return Args.MakeArgStringRef(getCanonicalTargetID(*Arch, Features));
+ return StringRef(
+ Args.MakeArgStringRef(getCanonicalTargetID(*Arch, Features)));
----------------
ditto.
================
Comment at: clang/lib/Driver/Driver.cpp:4295-4298
+ if (!ArchStr.empty())
+ Archs.erase(ArchStr);
+ else
+ return Archs;
----------------
Nit: we could save one line here:
```
if(ArchStr.empty())
return Archs;
Archs.erase(ArchStr);
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D135791/new/
https://reviews.llvm.org/D135791
More information about the cfe-commits
mailing list