[Mlir-commits] [mlir] 0c553cc - [MLIR] Add forgotten directory Support to unittests cmake

Arjun P llvmlistbot at llvm.org
Sat Dec 25 12:52:08 PST 2021


Author: Arjun P
Date: 2021-12-26T02:22:00+05:30
New Revision: 0c553cc1af2e4c14100df6cf4a6fc91987e778e6

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

LOG: [MLIR] Add forgotten directory Support to unittests cmake

The Support directory was removed from the unittests cmake when the directory
was removed in 204c3b551626a925dfdc3822a6f240bdc8ef5d3a. Subsequent commits
added the directory back but seem to have missed adding it back to the cmake.

This patch also removes MLIRSupportIndentedStream from the list of linked
libraries to avoid an ODR violation (it's already part of MLIRSupport which
is also being linked here). Otherwise ASAN complains:

```
=================================================================
==102592==ERROR: AddressSanitizer: odr-violation (0x7fbdf214eee0):
  [1] size=120 'vtable for mlir::raw_indented_ostream' /home/arjun/llvm-project/mlir/lib/Support/IndentedOstream.cpp
  [2] size=120 'vtable for mlir::raw_indented_ostream' /home/arjun/llvm-project/mlir/lib/Support/IndentedOstream.cpp
These globals were registered at these points:
  [1]:
    #0 0x28a71d in __asan_register_globals (/home/arjun/llvm-project/build/tools/mlir/unittests/Support/MLIRSupportTests+0x28a71d)
    #1 0x7fbdf214a61b in asan.module_ctor (/home/arjun/llvm-project/build/lib/libMLIRSupportIndentedOstream.so.14git+0x661b)

  [2]:
    #0 0x28a71d in __asan_register_globals (/home/arjun/llvm-project/build/tools/mlir/unittests/Support/MLIRSupportTests+0x28a71d)
    #1 0x7fbdf2061c4b in asan.module_ctor (/home/arjun/llvm-project/build/lib/libMLIRSupport.so.14git+0x11bc4b)

==102592==HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_odr_violation=0
SUMMARY AddressSanitizer: odr-violation: global 'vtable for mlir::raw_indented_ostream' at /home/arjun/llvm-project/mlir/lib/Support/IndentedOstream.cpp
==102592==ABORTING
```

Reviewed By: jpienaar

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

Added: 
    

Modified: 
    mlir/include/mlir/Support/DebugAction.h
    mlir/unittests/CMakeLists.txt
    mlir/unittests/Support/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Support/DebugAction.h b/mlir/include/mlir/Support/DebugAction.h
index 227d213b0ddac..4dc04476b583e 100644
--- a/mlir/include/mlir/Support/DebugAction.h
+++ b/mlir/include/mlir/Support/DebugAction.h
@@ -205,8 +205,7 @@ template <typename... ParameterTs> class DebugAction {
 
     /// Provide classof to allow casting between handler types.
     static bool classof(const DebugActionManager::HandlerBase *handler) {
-      return handler->getHandlerID() ==
-             TypeID::get<DebugAction<ParameterTs...>::Handler>();
+      return handler->getHandlerID() == TypeID::get<Handler>();
     }
   };
 

diff  --git a/mlir/unittests/CMakeLists.txt b/mlir/unittests/CMakeLists.txt
index 21506862a302c..2798c443cf98d 100644
--- a/mlir/unittests/CMakeLists.txt
+++ b/mlir/unittests/CMakeLists.txt
@@ -11,6 +11,7 @@ add_subdirectory(ExecutionEngine)
 add_subdirectory(Interfaces)
 add_subdirectory(IR)
 add_subdirectory(Pass)
+add_subdirectory(Support)
 add_subdirectory(Rewrite)
 add_subdirectory(TableGen)
 add_subdirectory(Transforms)

diff  --git a/mlir/unittests/Support/CMakeLists.txt b/mlir/unittests/Support/CMakeLists.txt
index 6616a793ec12f..fd1e66205c071 100644
--- a/mlir/unittests/Support/CMakeLists.txt
+++ b/mlir/unittests/Support/CMakeLists.txt
@@ -7,4 +7,4 @@ add_mlir_unittest(MLIRSupportTests
 )
 
 target_link_libraries(MLIRSupportTests
-  PRIVATE MLIRSupportIndentedOstream MLIRSupport)
+  PRIVATE MLIRSupport)


        


More information about the Mlir-commits mailing list