forked from OSchip/llvm-project
[flang] Address comments, clean up warnings
Original-commit: flang-compiler/f18@a5eeeb4430 Reviewed-on: https://github.com/flang-compiler/f18/pull/378
This commit is contained in:
parent
70b05522b0
commit
4eade259b3
|
@ -207,20 +207,6 @@ template<TypeCategory CAT>
|
|||
static constexpr Precedence GetPrecedence(const Expr<SomeKind<CAT>> &expr) {
|
||||
return std::visit([](const auto &x) { return GetPrecedence(x); }, expr.u);
|
||||
}
|
||||
static constexpr Precedence GetPrecedence(const Expr<SomeDerived> &expr) {
|
||||
return std::visit(
|
||||
[](const auto &x) { return ToPrecedence<std::decay_t<decltype(x)>>; },
|
||||
expr.u);
|
||||
}
|
||||
static constexpr Precedence GetPrecedence(const BOZLiteralConstant &) {
|
||||
return Precedence::Primary;
|
||||
}
|
||||
static constexpr Precedence GetPrecedence(const NullPointer &) {
|
||||
return Precedence::Primary;
|
||||
}
|
||||
static constexpr Precedence GetPrecedence(const Expr<SomeType> &expr) {
|
||||
return std::visit([](const auto &x) { return GetPrecedence(x); }, expr.u);
|
||||
}
|
||||
|
||||
template<typename T> static bool IsNegatedScalarConstant(const Expr<T> &expr) {
|
||||
static constexpr TypeCategory cat{T::category};
|
||||
|
|
|
@ -98,7 +98,6 @@ private:
|
|||
DoSymbol(*symbol);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
bool ModFileWriter::WriteAll() {
|
||||
|
@ -391,7 +390,6 @@ std::vector<const Symbol *> CollectSymbols(const Scope &scope) {
|
|||
}
|
||||
for (const auto &pair : scope.commonBlocks()) {
|
||||
const Symbol *symbol{pair.second};
|
||||
SourceName name{pair.first};
|
||||
if (symbols.insert(symbol).second) {
|
||||
common.push_back(symbol);
|
||||
}
|
||||
|
|
|
@ -186,8 +186,7 @@ bool Scope::CanImport(const SourceName &name) const {
|
|||
}
|
||||
|
||||
const Scope *Scope::FindScope(parser::CharBlock source) const {
|
||||
return const_cast<const Scope *>(
|
||||
const_cast<Scope *>(this)->FindScope(source));
|
||||
return const_cast<Scope *>(this)->FindScope(source);
|
||||
}
|
||||
|
||||
Scope *Scope::FindScope(parser::CharBlock source) {
|
||||
|
|
|
@ -116,8 +116,7 @@ bool SemanticsContext::AnyFatalError() const {
|
|||
}
|
||||
|
||||
const Scope &SemanticsContext::FindScope(parser::CharBlock source) const {
|
||||
return const_cast<const Scope &>(
|
||||
const_cast<SemanticsContext *>(this)->FindScope(source));
|
||||
return const_cast<SemanticsContext *>(this)->FindScope(source);
|
||||
}
|
||||
|
||||
Scope &SemanticsContext::FindScope(parser::CharBlock source) {
|
||||
|
|
Loading…
Reference in New Issue