[PATCH] D83917: [flang] Fix a crash when a BOZ literal is used as a relational operator
Tim Keith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 15 16:43:45 PDT 2020
tskeith added inline comments.
================
Comment at: flang/lib/Evaluate/tools.cpp:486
+ std::move(Expr<SomeType>{ConvertToKind<TypeCategory::Integer>(
+ context.GetDefaultKind(TypeCategory::Integer), std::move(*boz))}),
+ std::move(y));
----------------
Evaluate is not supposed to have link-time dependencies on Semantics (I think) so calling GetDefaultKind is bad here. Instead of passing in SemanticsContext, I think you could pass in (a reference to) the common::IntrinsicTypeDefaultKinds that is stored in SemanticsContext.
================
Comment at: flang/lib/Evaluate/tools.cpp:492
+ return Relate(context, messages, opr, std::move(x),
+ std::move(Expr<SomeType>{ConvertToKind<TypeCategory::Integer>(
+ context.GetDefaultKind(TypeCategory::Integer), std::move(*boz))}));
----------------
I get a warning from clang 9 that this call to std::move and the one on line 485 are not needed.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83917/new/
https://reviews.llvm.org/D83917
More information about the llvm-commits
mailing list