Changeset View
Changeset View
Standalone View
Standalone View
flang/include/flang/Frontend/CompilerInvocation.h
//===- CompilerInvocation.h - Compiler Invocation Helper Data ---*- C -*-===// | //===- CompilerInvocation.h - Compiler Invocation Helper Data ---*- C -*-===// | ||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
#ifndef LLVM_FLANG_FRONTEND_COMPILERINVOCATION_H | #ifndef LLVM_FLANG_FRONTEND_COMPILERINVOCATION_H | ||||
#define LLVM_FLANG_FRONTEND_COMPILERINVOCATION_H | #define LLVM_FLANG_FRONTEND_COMPILERINVOCATION_H | ||||
#include "flang/Frontend/FrontendOptions.h" | #include "flang/Frontend/FrontendOptions.h" | ||||
#include "flang/Frontend/PreprocessorOptions.h" | #include "flang/Frontend/PreprocessorOptions.h" | ||||
#include "flang/Frontend/TargetOptions.h" | |||||
#include "flang/Parser/parsing.h" | #include "flang/Parser/parsing.h" | ||||
#include "flang/Semantics/semantics.h" | #include "flang/Semantics/semantics.h" | ||||
#include "clang/Basic/Diagnostic.h" | #include "clang/Basic/Diagnostic.h" | ||||
#include "clang/Basic/DiagnosticOptions.h" | #include "clang/Basic/DiagnosticOptions.h" | ||||
#include "llvm/Option/ArgList.h" | #include "llvm/Option/ArgList.h" | ||||
#include <memory> | #include <memory> | ||||
namespace Fortran::frontend { | namespace Fortran::frontend { | ||||
Show All 35 Lines | class CompilerInvocation : public CompilerInvocationBase { | ||||
// options. | // options. | ||||
FrontendOptions frontendOpts_; | FrontendOptions frontendOpts_; | ||||
/// Options for Flang parser | /// Options for Flang parser | ||||
// TODO: Merge with or translate to frontendOpts_. We shouldn't need two sets | // TODO: Merge with or translate to frontendOpts_. We shouldn't need two sets | ||||
// of options. | // of options. | ||||
Fortran::parser::Options parserOpts_; | Fortran::parser::Options parserOpts_; | ||||
/// Options controlling the target. | |||||
Fortran::frontend::TargetOptions targetOpts_; | |||||
// Semantics context | // Semantics context | ||||
std::unique_ptr<Fortran::semantics::SemanticsContext> semanticsContext_; | std::unique_ptr<Fortran::semantics::SemanticsContext> semanticsContext_; | ||||
/// Semantic options | /// Semantic options | ||||
// TODO: Merge with or translate to frontendOpts_. We shouldn't need two sets | // TODO: Merge with or translate to frontendOpts_. We shouldn't need two sets | ||||
// of options. | // of options. | ||||
std::string moduleDir_ = "."; | std::string moduleDir_ = "."; | ||||
Show All 40 Lines | public: | ||||
CompilerInvocation() = default; | CompilerInvocation() = default; | ||||
FrontendOptions &frontendOpts() { return frontendOpts_; } | FrontendOptions &frontendOpts() { return frontendOpts_; } | ||||
const FrontendOptions &frontendOpts() const { return frontendOpts_; } | const FrontendOptions &frontendOpts() const { return frontendOpts_; } | ||||
Fortran::parser::Options &fortranOpts() { return parserOpts_; } | Fortran::parser::Options &fortranOpts() { return parserOpts_; } | ||||
const Fortran::parser::Options &fortranOpts() const { return parserOpts_; } | const Fortran::parser::Options &fortranOpts() const { return parserOpts_; } | ||||
TargetOptions &targetOpts() { return targetOpts_; } | |||||
const TargetOptions &TargetOpts() const { return targetOpts_; } | |||||
Fortran::semantics::SemanticsContext &semanticsContext() { | Fortran::semantics::SemanticsContext &semanticsContext() { | ||||
return *semanticsContext_; | return *semanticsContext_; | ||||
} | } | ||||
const Fortran::semantics::SemanticsContext &semanticsContext() const { | const Fortran::semantics::SemanticsContext &semanticsContext() const { | ||||
return *semanticsContext_; | return *semanticsContext_; | ||||
} | } | ||||
std::string &moduleDir() { return moduleDir_; } | std::string &moduleDir() { return moduleDir_; } | ||||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |