-# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
+# Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# limitations under the License.
add_library(FortranCommon
+ default-kinds.cc
idioms.cc
)
-// Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
+// Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// limitations under the License.
#include "default-kinds.h"
-#include "../common/idioms.h"
+#include "idioms.h"
-namespace Fortran::semantics {
+namespace Fortran::common {
IntrinsicTypeDefaultKinds::IntrinsicTypeDefaultKinds() {
#if __x86_64__
-// Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
+// Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef FORTRAN_DEFAULT_KINDS_H_
-#define FORTRAN_DEFAULT_KINDS_H_
+#ifndef FORTRAN_COMMON_DEFAULT_KINDS_H_
+#define FORTRAN_COMMON_DEFAULT_KINDS_H_
#include "../common/fortran.h"
// Represent the default values of the kind parameters of the
// various intrinsic types. These can be configured by means of
// the compiler command line.
-namespace Fortran::semantics {
-
-using Fortran::common::TypeCategory;
+namespace Fortran::common {
class IntrinsicTypeDefaultKinds {
public:
int defaultLogicalKind_{defaultIntegerKind_};
};
}
-#endif // FORTRAN_DEFAULT_KINDS_H_
+#endif // FORTRAN_COMMON_DEFAULT_KINDS_H_
#include "../common/enum-set.h"
#include "../common/fortran.h"
#include "../common/idioms.h"
-#include "../semantics/default-kinds.h"
#include <algorithm>
#include <map>
#include <ostream>
TypePattern result;
Rank rank{Rank::elemental};
std::optional<SpecificCall> Match(const CallCharacteristics &,
- const semantics::IntrinsicTypeDefaultKinds &, ActualArguments &,
+ const common::IntrinsicTypeDefaultKinds &, ActualArguments &,
parser::ContextualMessages &messages) const;
std::ostream &Dump(std::ostream &) const;
};
// procedure reference.
std::optional<SpecificCall> IntrinsicInterface::Match(
const CallCharacteristics &call,
- const semantics::IntrinsicTypeDefaultKinds &defaults,
+ const common::IntrinsicTypeDefaultKinds &defaults,
ActualArguments &arguments, parser::ContextualMessages &messages) const {
// Attempt to construct a 1-1 correspondence between the dummy arguments in
// a particular intrinsic procedure's generic interface and the actual
}
struct IntrinsicProcTable::Implementation {
- explicit Implementation(const semantics::IntrinsicTypeDefaultKinds &dfts)
+ explicit Implementation(const common::IntrinsicTypeDefaultKinds &dfts)
: defaults{dfts} {
for (const IntrinsicInterface &f : genericIntrinsicFunction) {
genericFuncs.insert(std::make_pair(std::string{f.name}, &f));
std::optional<SpecificCall> Probe(const CallCharacteristics &,
ActualArguments &, parser::ContextualMessages *) const;
- semantics::IntrinsicTypeDefaultKinds defaults;
+ common::IntrinsicTypeDefaultKinds defaults;
std::multimap<std::string, const IntrinsicInterface *> genericFuncs;
std::multimap<std::string, const SpecificIntrinsicInterface *> specificFuncs;
std::ostream &Dump(std::ostream &) const;
}
IntrinsicProcTable IntrinsicProcTable::Configure(
- const semantics::IntrinsicTypeDefaultKinds &defaults) {
+ const common::IntrinsicTypeDefaultKinds &defaults) {
IntrinsicProcTable result;
result.impl_ = new IntrinsicProcTable::Implementation(defaults);
return result;
-// Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
+// Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
#define FORTRAN_EVALUATE_INTRINSICS_H_
#include "call.h"
+#include "../common/default-kinds.h"
#include "../parser/char-block.h"
#include "../parser/message.h"
-#include "../semantics/default-kinds.h"
#include <optional>
#include <ostream>
public:
~IntrinsicProcTable();
static IntrinsicProcTable Configure(
- const semantics::IntrinsicTypeDefaultKinds &);
+ const common::IntrinsicTypeDefaultKinds &);
// Probe the intrinsics for a match against a specific call.
// On success, the actual arguments are transferred to the result
-# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
+# Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
attr.cc
canonicalize-do.cc
check-do-concurrent.cc
- default-kinds.cc
expression.cc
mod-file.cc
resolve-labels.cc
-// Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
+// Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
#define FORTRAN_SEMANTICS_MOD_FILE_H_
#include "attr.h"
-#include "default-kinds.h"
#include "resolve-names.h"
#include "../parser/message.h"
#include <set>
#include "resolve-names.h"
#include "attr.h"
-#include "default-kinds.h"
#include "expression.h"
#include "mod-file.h"
#include "rewrite-parse-tree.h"
#include "semantics.h"
#include "symbol.h"
#include "type.h"
+#include "../common/default-kinds.h"
#include "../common/fortran.h"
#include "../common/indirection.h"
#include "../evaluate/common.h"
#include "assignment.h"
#include "canonicalize-do.h"
#include "check-do-concurrent.h"
-#include "default-kinds.h"
#include "expression.h"
#include "mod-file.h"
#include "resolve-labels.h"
#include "rewrite-parse-tree.h"
#include "scope.h"
#include "symbol.h"
+#include "../common/default-kinds.h"
#include <ostream>
namespace Fortran::semantics {
static void PutIndent(std::ostream &, int indent);
SemanticsContext::SemanticsContext(
- const IntrinsicTypeDefaultKinds &defaultKinds)
+ const common::IntrinsicTypeDefaultKinds &defaultKinds)
: defaultKinds_{defaultKinds},
intrinsics_{evaluate::IntrinsicProcTable::Configure(defaultKinds)},
foldingContext_{evaluate::FoldingContext{
#include <string>
#include <vector>
+namespace Fortran::common {
+class IntrinsicTypeDefaultKinds;
+}
+
namespace Fortran::parser {
struct Program;
class CookedSource;
namespace Fortran::semantics {
-class IntrinsicTypeDefaultKinds;
-
class SemanticsContext {
public:
- SemanticsContext(const IntrinsicTypeDefaultKinds &);
+ SemanticsContext(const common::IntrinsicTypeDefaultKinds &);
- const IntrinsicTypeDefaultKinds &defaultKinds() const {
+ const common::IntrinsicTypeDefaultKinds &defaultKinds() const {
return defaultKinds_;
}
const std::vector<std::string> &searchDirectories() const {
}
private:
- const IntrinsicTypeDefaultKinds &defaultKinds_;
+ const common::IntrinsicTypeDefaultKinds &defaultKinds_;
std::vector<std::string> searchDirectories_;
std::string moduleDirectory_{"."s};
bool warningsAreErrors_{false};
-// Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
+// Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
};
void TestIntrinsics() {
- semantics::IntrinsicTypeDefaultKinds defaults;
+ common::IntrinsicTypeDefaultKinds defaults;
MATCH(4, defaults.GetDefaultKind(TypeCategory::Integer));
MATCH(4, defaults.GetDefaultKind(TypeCategory::Real));
IntrinsicProcTable table{IntrinsicProcTable::Configure(defaults)};
-// Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
+// Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// Temporary Fortran front end driver main program for development scaffolding.
+#include "../../lib/common/default-kinds.h"
#include "../../lib/parser/characters.h"
#include "../../lib/parser/features.h"
#include "../../lib/parser/message.h"
#include "../../lib/parser/parsing.h"
#include "../../lib/parser/provenance.h"
#include "../../lib/parser/unparse.h"
-#include "../../lib/semantics/default-kinds.h"
#include "../../lib/semantics/dump-parse-tree.h"
#include "../../lib/semantics/expression.h"
#include "../../lib/semantics/semantics.h"
options.predefinitions.emplace_back("__F18_MINOR__", "1");
options.predefinitions.emplace_back("__F18_PATCHLEVEL__", "1");
- Fortran::semantics::IntrinsicTypeDefaultKinds defaultKinds;
+ Fortran::common::IntrinsicTypeDefaultKinds defaultKinds;
std::vector<std::string> fortranSources, otherSources, relocatables;
bool anyFiles{false};