[PATCH] D38306: Cleanup some problems with LLVM_ENABLE_DUMP in release builds.

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 10:47:36 PDT 2017


MatzeB added reviewers: thakis, chandlerc, ahatanak.
MatzeB added a comment.

Thanks for working on it. Looks fine to me, but I think the cmake logic needs adjustment.



================
Comment at: CMakeLists.txt:397-401
+if( LLVM_ENABLE_ASSERTIONS )
+	option(LLVM_ENABLE_DUMP "Enable dump functions in release builds" ON)
+else()
+	option(LLVM_ENABLE_DUMP "Enable dump functions in release builds" OFF)
+endif()
----------------
This is fragile, as for any subsequent `cmake` runs the value for LLVM_ENABLE_DUMP is already set in the cmake cache and won't change even if the user modifies `LLVM_ENABLE_ASSERTIONS`.

We rather want cmake code that sets the define if either this option or LLVM_ENABLE_ASSERTIONS is enabled.


================
Comment at: lib/CodeGen/ScoreboardHazardRecognizer.cpp:35
       DAG(SchedDAG) {
+  (void)DebugType;
   // Determine the maximum depth of any itinerary. This determines the depth of
----------------
Is this to silence a warning about that member being unused? Maybe we better put an #ifdef around the member then?


https://reviews.llvm.org/D38306





More information about the llvm-commits mailing list