For "USE, INTRINSIC", search only for intrinsic modules; for "USE, NON_INTRINSIC", do not recognize intrinsic modules. Allow modules of both kinds with the same name to be used in the same source file (but not in the same scoping unit, a constraint of the standard that is now enforced). The symbol table's scope tree now has a single instance of a scope with a new kind, IntrinsicModules, whose children are the USE'd intrinsic modules (explicit or not). This separate "top-level" scope is a child of the single global scope and it allows both intrinsic and non-intrinsic modules of the same name to exist in the symbol table. Intrinsic modules' scopes' symbols now have the INTRINSIC attribute set. The search path directories need to make a distinction between regular directories and the one(s) that point(s) to intrinsic modules. I allow for multiple intrinsic module directories in the second search path, although only one is needed today. Differential Revision: https://reviews.llvm.org/D118631
37 lines
946 B
C++
37 lines
946 B
C++
//===-- lib/Semantics/resolve-names.h ---------------------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef FORTRAN_SEMANTICS_RESOLVE_NAMES_H_
|
|
#define FORTRAN_SEMANTICS_RESOLVE_NAMES_H_
|
|
|
|
#include <iosfwd>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace llvm {
|
|
class raw_ostream;
|
|
}
|
|
|
|
namespace Fortran::parser {
|
|
struct Program;
|
|
}
|
|
|
|
namespace Fortran::semantics {
|
|
|
|
class Scope;
|
|
class SemanticsContext;
|
|
class Symbol;
|
|
|
|
bool ResolveNames(SemanticsContext &, const parser::Program &, Scope &top);
|
|
void ResolveSpecificationParts(SemanticsContext &, const Symbol &);
|
|
void DumpSymbols(llvm::raw_ostream &);
|
|
|
|
} // namespace Fortran::semantics
|
|
|
|
#endif // FORTRAN_SEMANTICS_RESOLVE_NAMES_H_
|