[flang-commits] [flang] 4606f83 - [flang][driver][nfc] Fix capitalisation

Andrzej Warzynski via flang-commits flang-commits at lists.llvm.org
Mon Jan 31 02:37:42 PST 2022


Author: Andrzej Warzynski
Date: 2022-01-31T10:36:18Z
New Revision: 4606f838b2b60ce7d3995adf194eee470bf2395b

URL: https://github.com/llvm/llvm-project/commit/4606f838b2b60ce7d3995adf194eee470bf2395b
DIFF: https://github.com/llvm/llvm-project/commit/4606f838b2b60ce7d3995adf194eee470bf2395b.diff

LOG: [flang][driver][nfc] Fix capitalisation

As pointed out in https://reviews.llvm.org/D93401, some methods in the
Flang driver are named inconsistently. The driver strives to follow
Flang's C++ style [1] and this patch updates these methods accordingly.

[1]
https://github.com/llvm/llvm-project/blob/main/flang/docs/C%2B%2Bstyle.md

Differential Revision: https://reviews.llvm.org/D118381

Added: 
    

Modified: 
    flang/include/flang/Frontend/CompilerInstance.h
    flang/include/flang/Frontend/CompilerInvocation.h
    flang/lib/Frontend/CompilerInstance.cpp
    flang/lib/Frontend/CompilerInvocation.cpp
    flang/lib/Frontend/FrontendAction.cpp

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Frontend/CompilerInstance.h b/flang/include/flang/Frontend/CompilerInstance.h
index 2871fdcadf222..ce1e46cab3147 100644
--- a/flang/include/flang/Frontend/CompilerInstance.h
+++ b/flang/include/flang/Frontend/CompilerInstance.h
@@ -125,7 +125,7 @@ class CompilerInstance {
   Fortran::semantics::Semantics &semantics() { return *semantics_; }
   const Fortran::semantics::Semantics &semantics() const { return *semantics_; }
 
-  void setSemantics(std::unique_ptr<Fortran::semantics::Semantics> semantics) {
+  void SetSemantics(std::unique_ptr<Fortran::semantics::Semantics> semantics) {
     semantics_ = std::move(semantics);
   }
 

diff  --git a/flang/include/flang/Frontend/CompilerInvocation.h b/flang/include/flang/Frontend/CompilerInvocation.h
index 16b069e9a3285..0b59da690c874 100644
--- a/flang/include/flang/Frontend/CompilerInvocation.h
+++ b/flang/include/flang/Frontend/CompilerInvocation.h
@@ -191,18 +191,18 @@ class CompilerInvocation : public CompilerInvocationBase {
   void SetDefaultFortranOpts();
 
   /// Set the default predefinitions.
-  void setDefaultPredefinitions();
+  void SetDefaultPredefinitions();
 
   /// Collect the macro definitions from preprocessorOpts_ and prepare them for
   /// the parser (i.e. copy into parserOpts_)
-  void collectMacroDefinitions();
+  void CollectMacroDefinitions();
 
   /// Set the Fortran options to user-specified values.
   /// These values are found in the preprocessor options.
-  void setFortranOpts();
+  void SetFortranOpts();
 
   /// Set the Semantic Options
-  void setSemanticsOpts(Fortran::parser::AllCookedSources &);
+  void SetSemanticsOpts(Fortran::parser::AllCookedSources &);
 };
 
 } // end namespace Fortran::frontend

diff  --git a/flang/lib/Frontend/CompilerInstance.cpp b/flang/lib/Frontend/CompilerInstance.cpp
index 20a9b58a5a3c1..bae7ea6a77d60 100644
--- a/flang/lib/Frontend/CompilerInstance.cpp
+++ b/flang/lib/Frontend/CompilerInstance.cpp
@@ -142,11 +142,11 @@ bool CompilerInstance::ExecuteAction(FrontendAction &act) {
   // Set some sane defaults for the frontend.
   invoc.SetDefaultFortranOpts();
   // Update the fortran options based on user-based input.
-  invoc.setFortranOpts();
+  invoc.SetFortranOpts();
   // Set the encoding to read all input files in based on user input.
   allSources_->set_encoding(invoc.fortranOpts().encoding);
   // Create the semantics context and set semantic options.
-  invoc.setSemanticsOpts(*this->allCookedSources_);
+  invoc.SetSemanticsOpts(*this->allCookedSources_);
 
   // Run the frontend action `act` for every input file.
   for (const FrontendInputFile &fif : frontendOpts().inputs) {

diff  --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 4525130e5c2e7..2d8c9e386fce8 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -565,7 +565,7 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &res,
   return success;
 }
 
-void CompilerInvocation::collectMacroDefinitions() {
+void CompilerInvocation::CollectMacroDefinitions() {
   auto &ppOpts = this->preprocessorOpts();
 
   for (unsigned i = 0, n = ppOpts.macros.size(); i != n; ++i) {
@@ -607,7 +607,7 @@ void CompilerInvocation::SetDefaultFortranOpts() {
 // TODO: When expanding this method, consider creating a dedicated API for
 // this. Also at some point we will need to 
diff erentiate between 
diff erent
 // targets and add dedicated predefines for each.
-void CompilerInvocation::setDefaultPredefinitions() {
+void CompilerInvocation::SetDefaultPredefinitions() {
   auto &fortranOptions = fortranOpts();
   const auto &frontendOptions = frontendOpts();
 
@@ -631,7 +631,7 @@ void CompilerInvocation::setDefaultPredefinitions() {
   }
 }
 
-void CompilerInvocation::setFortranOpts() {
+void CompilerInvocation::SetFortranOpts() {
   auto &fortranOptions = fortranOpts();
   const auto &frontendOptions = frontendOpts();
   const auto &preprocessorOptions = preprocessorOpts();
@@ -677,7 +677,7 @@ void CompilerInvocation::setFortranOpts() {
   }
 }
 
-void CompilerInvocation::setSemanticsOpts(
+void CompilerInvocation::SetSemanticsOpts(
     Fortran::parser::AllCookedSources &allCookedSources) {
   const auto &fortranOptions = fortranOpts();
 

diff  --git a/flang/lib/Frontend/FrontendAction.cpp b/flang/lib/Frontend/FrontendAction.cpp
index 5285681e2904a..762cbc8fc47b5 100644
--- a/flang/lib/Frontend/FrontendAction.cpp
+++ b/flang/lib/Frontend/FrontendAction.cpp
@@ -79,8 +79,8 @@ bool FrontendAction::BeginSourceFile(
   if ((invoc.preprocessorOpts().macrosFlag == PPMacrosFlag::Include) ||
       (invoc.preprocessorOpts().macrosFlag == PPMacrosFlag::Unknown &&
           currentInput().MustBePreprocessed())) {
-    invoc.setDefaultPredefinitions();
-    invoc.collectMacroDefinitions();
+    invoc.SetDefaultPredefinitions();
+    invoc.CollectMacroDefinitions();
   }
 
   // Decide between fixed and free form (if the user didn't express any
@@ -162,7 +162,7 @@ bool FrontendAction::RunSemanticChecks() {
   assert(parseTree && "Cannot run semantic checks without a parse tree!");
 
   // Prepare semantics
-  ci.setSemantics(std::make_unique<Fortran::semantics::Semantics>(
+  ci.SetSemantics(std::make_unique<Fortran::semantics::Semantics>(
       ci.invocation().semanticsContext(), *parseTree,
       ci.invocation().debugModuleDir()));
   auto &semantics = ci.semantics();


        


More information about the flang-commits mailing list