[Mlir-commits] [mlir] 485e6db - Revert "Adding GDB PrettyPrinter for mlir::Identifier."

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Sep 3 02:50:15 PDT 2020


Author: OCHyams
Date: 2020-09-03T08:28:15+01:00
New Revision: 485e6db8729383345da9796218d99843449057ac

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

LOG: Revert "Adding GDB PrettyPrinter for mlir::Identifier."

This reverts commit 9e9e6e698d8ef5dc5b7576058f2022aab2534a52.

This commit is causing builds that include the 'debuginfo-tests' project to
fail.

Apple has a public bot which shows the failure:
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/23667/console

Added: 
    

Modified: 
    debuginfo-tests/CMakeLists.txt
    debuginfo-tests/lit.cfg.py
    debuginfo-tests/lit.site.cfg.py.in

Removed: 
    debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp
    debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.gdb
    mlir/utils/gdb-scripts/prettyprinters.py


################################################################################
diff  --git a/debuginfo-tests/CMakeLists.txt b/debuginfo-tests/CMakeLists.txt
index 3750f2e0b026..d3ac0a4aad90 100644
--- a/debuginfo-tests/CMakeLists.txt
+++ b/debuginfo-tests/CMakeLists.txt
@@ -9,12 +9,6 @@ add_llvm_executable(check-gdb-llvm-support
 )
 target_link_libraries(check-gdb-llvm-support PRIVATE LLVMSupport)
 
-add_llvm_executable(check-gdb-mlir-support
-        llvm-prettyprinters/gdb/mlir-support.cpp
-)
-target_include_directories(check-gdb-mlir-support PRIVATE ${LLVM_EXTERNAL_MLIR_SOURCE_DIR}/include)
-target_link_libraries(check-gdb-mlir-support PRIVATE MLIRIR)
-
 set(DEBUGINFO_TESTS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 set(DEBUGINFO_TESTS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
 
@@ -25,7 +19,6 @@ set(DEBUGINFO_TEST_DEPS
   llvm-config
   llvm-objdump
   check-gdb-llvm-support
-  check-gdb-mlir-support
   not
   )
 

diff  --git a/debuginfo-tests/lit.cfg.py b/debuginfo-tests/lit.cfg.py
index ba09b1f4cfae..4c45b723d2e9 100644
--- a/debuginfo-tests/lit.cfg.py
+++ b/debuginfo-tests/lit.cfg.py
@@ -46,7 +46,6 @@
         config.debuginfo_tests_src_root, 'llgdb-tests', 'test_debuginfo.pl')),
     ToolSubst("%llvm_src_root", config.llvm_src_root),
     ToolSubst("%llvm_tools_dir", config.llvm_tools_dir),
-    ToolSubst("%mlir_src_root", config.mlir_src_root),
 ]
 
 def get_required_attr(config, attr_name):

diff  --git a/debuginfo-tests/lit.site.cfg.py.in b/debuginfo-tests/lit.site.cfg.py.in
index 4ed49b83bc35..d5893f577aed 100644
--- a/debuginfo-tests/lit.site.cfg.py.in
+++ b/debuginfo-tests/lit.site.cfg.py.in
@@ -20,8 +20,6 @@ config.target_triple = "@TARGET_TRIPLE@"
 config.host_arch = "@HOST_ARCH@"
 config.is_msvc = lit.util.pythonize_bool("@MSVC@")
 
-config.mlir_src_root = "@MLIR_SOURCE_DIR@"
-
 config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
 
 config.python3_executable = "@Python3_EXECUTABLE@"

diff  --git a/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp b/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp
deleted file mode 100644
index d38fc3d03ad3..000000000000
--- a/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-#include "mlir/IR/Identifier.h"
-#include "mlir/IR/MLIRContext.h"
-
-mlir::MLIRContext Context;
-
-auto Identifier = mlir::Identifier::get("foo", &Context);
-
-int main() { return 0; }

diff  --git a/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.gdb b/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.gdb
deleted file mode 100644
index cca435e640e0..000000000000
--- a/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.gdb
+++ /dev/null
@@ -1,8 +0,0 @@
-# RUN: gdb -q -batch -n -iex 'source %mlir_src_root/utils/gdb-scripts/prettyprinters.py' -x %s %llvm_tools_dir/check-gdb-mlir-support | FileCheck %s --dump-input=fail
-# REQUIRES: debug-info
-
-break main
-run
-
-# CHECK: "foo"
-p Identifier

diff  --git a/mlir/utils/gdb-scripts/prettyprinters.py b/mlir/utils/gdb-scripts/prettyprinters.py
deleted file mode 100644
index 5ea20aca83d8..000000000000
--- a/mlir/utils/gdb-scripts/prettyprinters.py
+++ /dev/null
@@ -1,22 +0,0 @@
-"""GDB pretty printers for MLIR types."""
-
-import gdb.printing
-
-class IdentifierPrinter:
-  """Prints an mlir::Identifier instance."""
-
-  def __init__(self, val):
-    self.entry = val['entry']
-
-  def to_string(self):
-    ptr = (self.entry + 1).cast(gdb.lookup_type('char').pointer());
-    return ptr.string(length=self.entry['keyLength'])
-
-  def display_hint(self):
-    return 'string'
-
-pp = gdb.printing.RegexpCollectionPrettyPrinter('MLIRSupport')
-
-pp.add_printer('mlir::Identifier', '^mlir::Identifier$', IdentifierPrinter)
-
-gdb.printing.register_pretty_printer(gdb.current_objfile(), pp)


        


More information about the Mlir-commits mailing list