mirror of
https://github.com/intel/llvm.git
synced 2026-01-24 08:30:34 +08:00
[flang] Attempt to silence new GCC warnings
Restructure three code sites that are now eliciting new warnings from the latest GCC compiler. One of these looks like a legitimate problem with a reference to an expression temporary. Fixes https://github.com/llvm/llvm-project/issues/64200. Differential Revision: https://reviews.llvm.org/D156750
This commit is contained in:
@@ -1693,11 +1693,12 @@ public:
|
||||
|
||||
bool canLoadActualArgumentBeforeLoop(unsigned argIdx) const {
|
||||
using PassBy = Fortran::lower::CallerInterface::PassEntityBy;
|
||||
assert(argIdx < caller.getPassedArguments().size() && "bad argument index");
|
||||
const auto &passedArgs{caller.getPassedArguments()};
|
||||
assert(argIdx < passedArgs.size() && "bad argument index");
|
||||
// If the actual argument does not need to be passed via an address,
|
||||
// or will be passed in the address of a temporary copy, it can be loaded
|
||||
// before the elemental loop nest.
|
||||
const auto &arg = caller.getPassedArguments()[argIdx];
|
||||
const auto &arg{passedArgs[argIdx]};
|
||||
return arg.passBy == PassBy::Value ||
|
||||
arg.passBy == PassBy::BaseAddressValueAttribute;
|
||||
}
|
||||
|
||||
@@ -2662,8 +2662,8 @@ checkForSymbolMatch(const Fortran::parser::AssignmentStmt &assignmentStmt) {
|
||||
const auto &expr{std::get<Fortran::parser::Expr>(assignmentStmt.t)};
|
||||
const auto *e{Fortran::semantics::GetExpr(expr)};
|
||||
const auto *v{Fortran::semantics::GetExpr(var)};
|
||||
const Fortran::semantics::Symbol &varSymbol =
|
||||
Fortran::evaluate::GetSymbolVector(*v).front();
|
||||
auto varSyms{Fortran::evaluate::GetSymbolVector(*v)};
|
||||
const Fortran::semantics::Symbol &varSymbol{*varSyms.front()};
|
||||
for (const Fortran::semantics::Symbol &symbol :
|
||||
Fortran::evaluate::GetSymbolVector(*e))
|
||||
if (varSymbol == symbol)
|
||||
|
||||
@@ -202,7 +202,8 @@ static SomeExpr SaveDerivedPointerTarget(Scope &scope, SourceName name,
|
||||
if (x.empty()) {
|
||||
return SomeExpr{evaluate::NullPointer{}};
|
||||
} else {
|
||||
const auto &derivedType{x.front().GetType().GetDerivedTypeSpec()};
|
||||
auto dyType{x.front().GetType()};
|
||||
const auto &derivedType{dyType.GetDerivedTypeSpec()};
|
||||
ObjectEntityDetails object;
|
||||
DeclTypeSpec typeSpec{DeclTypeSpec::TypeDerived, derivedType};
|
||||
if (const DeclTypeSpec * spec{scope.FindType(typeSpec)}) {
|
||||
|
||||
Reference in New Issue
Block a user