[flang-commits] [flang] bfe4c5c - [flang] Fix a warning

Kazu Hirata via flang-commits flang-commits at lists.llvm.org
Tue Dec 13 17:37:02 PST 2022


Author: Kazu Hirata
Date: 2022-12-13T17:36:56-08:00
New Revision: bfe4c5cc0bb0518c0ad137c0ee715e9f9e839a93

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

LOG: [flang] Fix a warning

This patch fixes:

  flang/lib/Lower/PFTBuilder.cpp:1042:6: error: function 'dumpScope'
  is not needed and will not be emitted
  [-Werror,-Wunneeded-internal-declaration]

Added: 
    

Modified: 
    flang/lib/Lower/PFTBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/PFTBuilder.cpp b/flang/lib/Lower/PFTBuilder.cpp
index e0737fdf18af7..57e396dc74a5b 100644
--- a/flang/lib/Lower/PFTBuilder.cpp
+++ b/flang/lib/Lower/PFTBuilder.cpp
@@ -64,7 +64,9 @@ struct UnwrapStmt<parser::UnlabeledStatement<A>> {
   std::optional<parser::Label> label;
 };
 
+#ifndef NDEBUG
 void dumpScope(const semantics::Scope *scope, int depth = -1);
+#endif
 
 /// The instantiation of a parse tree visitor (Pre and Post) is extremely
 /// expensive in terms of compile and link time.  So one goal here is to
@@ -1037,6 +1039,7 @@ class PFTBuilder {
   lower::pft::Evaluation *lastLexicalEvaluation{};
 };
 
+#ifndef NDEBUG
 /// Dump all program scopes and symbols with addresses to disambiguate names.
 /// This is static, unchanging front end information, so dump it only once.
 void dumpScope(const semantics::Scope *scope, int depth) {
@@ -1075,6 +1078,7 @@ void dumpScope(const semantics::Scope *scope, int depth) {
       LLVM_DEBUG(llvm::dbgs() << w + "  " << &*sym << "   " << *sym << "\n");
   }
 }
+#endif // NDEBUG
 
 class PFTDumper {
 public:


        


More information about the flang-commits mailing list