[PATCH] D28191: [IR] Don't call assertModuleIsMaterialized in release builds

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 22:37:29 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL291883: [IR] Don't call assertModuleIsMaterialized in release builds (authored by ctopper).

Changed prior to commit:
  https://reviews.llvm.org/D28191?vs=84081&id=84226#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D28191

Files:
  llvm/trunk/include/llvm/IR/Value.h
  llvm/trunk/lib/IR/Value.cpp


Index: llvm/trunk/include/llvm/IR/Value.h
===================================================================
--- llvm/trunk/include/llvm/IR/Value.h
+++ llvm/trunk/include/llvm/IR/Value.h
@@ -294,7 +294,15 @@
   // when using them since you might not get all uses.
   // The methods that don't start with materialized_ assert that modules is
   // fully materialized.
-  void assertModuleIsMaterialized() const;
+  void assertModuleIsMaterializedImpl() const;
+  // This indirection exists so we can keep assertModuleIsMaterializedImpl()
+  // around in release builds of Value.cpp to be linked with other code built
+  // in debug mode. But this avoids calling it in any of the release built code.
+  void assertModuleIsMaterialized() const {
+#ifndef NDEBUG
+    assertModuleIsMaterializedImpl();
+#endif
+  }
 
   bool use_empty() const {
     assertModuleIsMaterialized();
Index: llvm/trunk/lib/IR/Value.cpp
===================================================================
--- llvm/trunk/lib/IR/Value.cpp
+++ llvm/trunk/lib/IR/Value.cpp
@@ -320,7 +320,7 @@
     ST->reinsertValue(this);
 }
 
-void Value::assertModuleIsMaterialized() const {
+void Value::assertModuleIsMaterializedImpl() const {
 #ifndef NDEBUG
   const GlobalValue *GV = dyn_cast<GlobalValue>(this);
   if (!GV)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28191.84226.patch
Type: text/x-patch
Size: 1287 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170113/5ee0497f/attachment.bin>


More information about the llvm-commits mailing list