[llvm] r352353 - [opaque pointer types] Remove GraphTraits specialization for Type.

James Y Knight via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 28 05:25:57 PST 2019


Author: jyknight
Date: Mon Jan 28 05:25:57 2019
New Revision: 352353

URL: http://llvm.org/viewvc/llvm-project?rev=352353&view=rev
Log:
[opaque pointer types] Remove GraphTraits specialization for Type.

The only caller has been deleted in r352076, and I'd like to minimize
the amount of code walking Type hierarchies generically, to make it
easier to identify code depending on pointee types.

Modified:
    llvm/trunk/include/llvm/IR/Type.h

Modified: llvm/trunk/include/llvm/IR/Type.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Type.h?rev=352353&r1=352352&r2=352353&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Type.h (original)
+++ llvm/trunk/include/llvm/IR/Type.h Mon Jan 28 05:25:57 2019
@@ -466,28 +466,6 @@ template <> struct isa_impl<PointerType,
   }
 };
 
-//===----------------------------------------------------------------------===//
-// Provide specializations of GraphTraits to be able to treat a type as a
-// graph of sub types.
-
-template <> struct GraphTraits<Type *> {
-  using NodeRef = Type *;
-  using ChildIteratorType = Type::subtype_iterator;
-
-  static NodeRef getEntryNode(Type *T) { return T; }
-  static ChildIteratorType child_begin(NodeRef N) { return N->subtype_begin(); }
-  static ChildIteratorType child_end(NodeRef N) { return N->subtype_end(); }
-};
-
-template <> struct GraphTraits<const Type*> {
-  using NodeRef = const Type *;
-  using ChildIteratorType = Type::subtype_iterator;
-
-  static NodeRef getEntryNode(NodeRef T) { return T; }
-  static ChildIteratorType child_begin(NodeRef N) { return N->subtype_begin(); }
-  static ChildIteratorType child_end(NodeRef N) { return N->subtype_end(); }
-};
-
 // Create wrappers for C Binding types (see CBindingWrapping.h).
 DEFINE_ISA_CONVERSION_FUNCTIONS(Type, LLVMTypeRef)
 




More information about the llvm-commits mailing list