43class CompilerInvocationBase {
50 CompilerInvocationBase();
51 CompilerInvocationBase(
const CompilerInvocationBase &x);
52 ~CompilerInvocationBase();
54 clang::DiagnosticOptions &getDiagnosticOpts() {
57 const clang::DiagnosticOptions &getDiagnosticOpts()
const {
62 const PreprocessorOptions &getPreprocessorOpts()
const {
67class CompilerInvocation :
public CompilerInvocationBase {
71 FrontendOptions frontendOpts;
93 std::string allCompilerInvocOpts;
98 std::string moduleDir =
".";
100 std::string moduleFileSuffix =
".mod";
102 bool debugModuleDir =
false;
103 bool hermeticModuleFileOutput =
false;
112 bool useAnalyzedObjectsForUnparse =
true;
118 size_t maxErrors = 0;
119 bool warnAsErr =
false;
121 bool enableConformanceChecks =
false;
122 bool enableUsageChecks =
false;
123 bool disableWarnings =
false;
132 o <<
"(bad expression)";
135 [](llvm::raw_ostream &o,
140 o <<
"(bad assignment)";
144 x.AsFortran(o <<
"CALL ");
153 CompilerInvocation() =
default;
155 FrontendOptions &getFrontendOpts() {
return frontendOpts; }
156 const FrontendOptions &getFrontendOpts()
const {
return frontendOpts; }
162 const TargetOptions &getTargetOpts()
const {
return targetOpts; }
165 const CodeGenOptions &getCodeGenOpts()
const {
return codeGenOpts; }
176 std::unique_ptr<Fortran::semantics::SemanticsContext>
178 const llvm::TargetMachine &);
180 std::string &getModuleDir() {
return moduleDir; }
181 const std::string &getModuleDir()
const {
return moduleDir; }
183 std::string &getModuleFileSuffix() {
return moduleFileSuffix; }
184 const std::string &getModuleFileSuffix()
const {
return moduleFileSuffix; }
186 bool &getDebugModuleDir() {
return debugModuleDir; }
187 const bool &getDebugModuleDir()
const {
return debugModuleDir; }
189 bool &getHermeticModuleFileOutput() {
return hermeticModuleFileOutput; }
190 const bool &getHermeticModuleFileOutput()
const {
191 return hermeticModuleFileOutput;
193 size_t &getMaxErrors() {
return maxErrors; }
194 const size_t &getMaxErrors()
const {
return maxErrors; }
196 bool &getWarnAsErr() {
return warnAsErr; }
197 const bool &getWarnAsErr()
const {
return warnAsErr; }
199 bool &getUseAnalyzedObjectsForUnparse() {
200 return useAnalyzedObjectsForUnparse;
202 const bool &getUseAnalyzedObjectsForUnparse()
const {
203 return useAnalyzedObjectsForUnparse;
206 bool &getEnableConformanceChecks() {
return enableConformanceChecks; }
207 const bool &getEnableConformanceChecks()
const {
208 return enableConformanceChecks;
211 const char *getArgv0() {
return argv0; }
213 bool &getEnableUsageChecks() {
return enableUsageChecks; }
214 const bool &getEnableUsageChecks()
const {
return enableUsageChecks; }
216 bool &getDisableWarnings() {
return disableWarnings; }
217 const bool &getDisableWarnings()
const {
return disableWarnings; }
233 bool getEnableTimers()
const {
return enableTimers; }
241 clang::DiagnosticsEngine &diags,
242 const char *argv0 =
nullptr);
245 void setEnableConformanceChecks() { enableConformanceChecks =
true; }
248 void setEnableUsageChecks() { enableUsageChecks =
true; }
251 void setDisableWarnings() { disableWarnings =
true; }
256 void setModuleDir(std::string &dir) { moduleDir = dir; }
258 void setModuleFileSuffix(
const char *suffix) {
259 moduleFileSuffix = std::string(suffix);
262 void setDebugModuleDir(
bool flag) { debugModuleDir = flag; }
263 void setHermeticModuleFileOutput(
bool flag) {
264 hermeticModuleFileOutput = flag;
267 void setMaxErrors(
size_t maxErrors) { this->maxErrors = maxErrors; }
268 void setWarnAsErr(
bool flag) { warnAsErr = flag; }
270 void setUseAnalyzedObjectsForUnparse(
bool flag) {
271 useAnalyzedObjectsForUnparse = flag;
static bool createFromArgs(CompilerInvocation &res, llvm::ArrayRef< const char * > commandLineArgs, clang::DiagnosticsEngine &diags, const char *argv0=nullptr)
Definition CompilerInvocation.cpp:1522
std::unique_ptr< Fortran::semantics::SemanticsContext > getSemanticsCtx(Fortran::parser::AllCookedSources &allCookedSources, const llvm::TargetMachine &)
Creates and configures semantics context based on the compilation flags.
Definition CompilerInvocation.cpp:1854