[llvm] 1a93285 - Fix -Wstring-compare warnings in new OpenMP code
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 26 10:47:18 PDT 2020
Johannes - is this code missing some test coverage that would have
demonstrated the bug in the code before Reid's fix here?
On Fri, Feb 14, 2020 at 3:24 PM Reid Kleckner via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
>
> Author: Reid Kleckner
> Date: 2020-02-14T15:23:49-08:00
> New Revision: 1a93285c686a4ad6e4311f55898cb116ca51b5b0
>
> URL:
> https://github.com/llvm/llvm-project/commit/1a93285c686a4ad6e4311f55898cb116ca51b5b0
> DIFF:
> https://github.com/llvm/llvm-project/commit/1a93285c686a4ad6e4311f55898cb116ca51b5b0.diff
>
> LOG: Fix -Wstring-compare warnings in new OpenMP code
>
> Added:
>
>
> Modified:
> llvm/lib/Frontend/OpenMP/OMPContext.cpp
>
> Removed:
>
>
>
>
> ################################################################################
> diff --git a/llvm/lib/Frontend/OpenMP/OMPContext.cpp
> b/llvm/lib/Frontend/OpenMP/OMPContext.cpp
> index f4c4bdfad0b6..244448c41012 100644
> --- a/llvm/lib/Frontend/OpenMP/OMPContext.cpp
> +++ b/llvm/lib/Frontend/OpenMP/OMPContext.cpp
> @@ -411,7 +411,7 @@ bool
> llvm::omp::isValidTraitPropertyForTraitSetAndSelector(
> std::string llvm::omp::listOpenMPContextTraitSets() {
> std::string S;
> #define OMP_TRAIT_SET(Enum, Str)
> \
> - if (Str != "invalid")
> \
> + if (StringRef(Str) != "invalid")
> \
> S.append("'").append(Str).append("'").append(" ");
> #include "llvm/Frontend/OpenMP/OMPKinds.def"
> S.pop_back();
> @@ -421,7 +421,7 @@ std::string llvm::omp::listOpenMPContextTraitSets() {
> std::string llvm::omp::listOpenMPContextTraitSelectors(TraitSet Set) {
> std::string S;
> #define OMP_TRAIT_SELECTOR(Enum, TraitSetEnum, Str, ReqProp)
> \
> - if (TraitSet::TraitSetEnum == Set && Str != "Invalid")
> \
> + if (TraitSet::TraitSetEnum == Set && StringRef(Str) != "Invalid")
> \
> S.append("'").append(Str).append("'").append(" ");
> #include "llvm/Frontend/OpenMP/OMPKinds.def"
> S.pop_back();
> @@ -434,7 +434,8 @@ llvm::omp::listOpenMPContextTraitProperties(TraitSet
> Set,
> std::string S;
> #define OMP_TRAIT_PROPERTY(Enum, TraitSetEnum, TraitSelectorEnum, Str)
> \
> if (TraitSet::TraitSetEnum == Set &&
> \
> - TraitSelector::TraitSelectorEnum == Selector && Str != "invalid")
> \
> + TraitSelector::TraitSelectorEnum == Selector &&
> \
> + StringRef(Str) != "invalid")
> \
> S.append("'").append(Str).append("'").append(" ");
> #include "llvm/Frontend/OpenMP/OMPKinds.def"
> S.pop_back();
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200326/a8fa6e63/attachment.html>
More information about the llvm-commits
mailing list