[llvm] fda901a - [Clang] Fix building with Clang < 3.9.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 20 15:05:11 PDT 2020


Could you update the comment to specify the exact version that was
problematic? So it's easier to tell if this version is no longer
supported & the code can be updated.

On Fri, Jul 17, 2020 at 12:34 PM Michael Spencer via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
>
> Author: Michael Spencer
> Date: 2020-07-17T13:33:15-06:00
> New Revision: fda901a987ddd7a59599c3dcaa6c9a18d959a9b3
>
> URL: https://github.com/llvm/llvm-project/commit/fda901a987ddd7a59599c3dcaa6c9a18d959a9b3
> DIFF: https://github.com/llvm/llvm-project/commit/fda901a987ddd7a59599c3dcaa6c9a18d959a9b3.diff
>
> LOG: [Clang] Fix building with Clang < 3.9.
>
> This is a workaround for a bug in older versions of Clang when. The
> constructor that is supposed to allow for Derived to Base conversion
> does not work. Remove this if we drop support for such configurations.
>
> Added:
>
>
> Modified:
>     llvm/utils/TableGen/OptParserEmitter.cpp
>
> Removed:
>
>
>
> ################################################################################
> diff  --git a/llvm/utils/TableGen/OptParserEmitter.cpp b/llvm/utils/TableGen/OptParserEmitter.cpp
> index 251533a8d154..34699b55e274 100644
> --- a/llvm/utils/TableGen/OptParserEmitter.cpp
> +++ b/llvm/utils/TableGen/OptParserEmitter.cpp
> @@ -110,7 +110,11 @@ class MarshallingFlagInfo final : public MarshallingKindInfo {
>    static std::unique_ptr<MarshallingKindInfo> create(const Record &R) {
>      std::unique_ptr<MarshallingFlagInfo> Ret(new MarshallingFlagInfo(R));
>      Ret->IsPositive = R.getValueAsBit("IsPositive");
> -    return Ret;
> +    // FIXME: This is a workaround for a bug in older versions of libstdc++ when
> +    //   compiled with Clang. The constructor that is supposed to allow for
> +    //   Derived to Base conversion does not work. Remove this if we drop
> +    //   support for such configurations.
> +    return std::unique_ptr<MarshallingKindInfo>(Ret.release());
>    }
>
>  private:
> @@ -204,7 +208,11 @@ struct SimpleEnumValueTable {
>               "values");
>      }
>
> -    return Ret;
> +    // FIXME: This is a workaround for a bug in older versions of libstdc++ when
> +    //   compiled with Clang. The constructor that is supposed to allow for
> +    //   Derived to Base conversion does not work. Remove this if we drop
> +    //   support for such configurations.
> +    return std::unique_ptr<MarshallingKindInfo>(Ret.release());
>    }
>
>  private:
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list