[llvm-commits] [llvm] r171749 - in /llvm/trunk: include/llvm/IR/TypeFinder.h include/llvm/TypeFinder.h lib/IR/AsmWriter.cpp lib/IR/TypeFinder.cpp lib/Linker/LinkModules.cpp lib/Transforms/IPO/StripSymbols.cpp lib/Transforms/Utils/MetaRenamer.cpp

Chandler Carruth chandlerc at gmail.com
Mon Jan 7 07:43:52 PST 2013


Author: chandlerc
Date: Mon Jan  7 09:43:51 2013
New Revision: 171749

URL: http://llvm.org/viewvc/llvm-project?rev=171749&view=rev
Log:
Move TypeFinder.h into the IR tree, it clearly belongs with the IR library.

Added:
    llvm/trunk/include/llvm/IR/TypeFinder.h
      - copied, changed from r171747, llvm/trunk/include/llvm/TypeFinder.h
Removed:
    llvm/trunk/include/llvm/TypeFinder.h
Modified:
    llvm/trunk/lib/IR/AsmWriter.cpp
    llvm/trunk/lib/IR/TypeFinder.cpp
    llvm/trunk/lib/Linker/LinkModules.cpp
    llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp
    llvm/trunk/lib/Transforms/Utils/MetaRenamer.cpp

Copied: llvm/trunk/include/llvm/IR/TypeFinder.h (from r171747, llvm/trunk/include/llvm/TypeFinder.h)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/TypeFinder.h?p2=llvm/trunk/include/llvm/IR/TypeFinder.h&p1=llvm/trunk/include/llvm/TypeFinder.h&r1=171747&r2=171749&rev=171749&view=diff
==============================================================================
--- llvm/trunk/include/llvm/TypeFinder.h (original)
+++ llvm/trunk/include/llvm/IR/TypeFinder.h Mon Jan  7 09:43:51 2013
@@ -1,4 +1,4 @@
-//===-- llvm/TypeFinder.h - Class for finding used struct types -*- C++ -*-===//
+//===-- llvm/IR/TypeFinder.h - Class to find used struct types --*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -11,8 +11,8 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef LLVM_TYPEFINDER_H
-#define LLVM_TYPEFINDER_H
+#ifndef LLVM_IR_TYPEFINDER_H
+#define LLVM_IR_TYPEFINDER_H
 
 #include "llvm/ADT/DenseSet.h"
 #include <vector>

Removed: llvm/trunk/include/llvm/TypeFinder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/TypeFinder.h?rev=171748&view=auto
==============================================================================
--- llvm/trunk/include/llvm/TypeFinder.h (original)
+++ llvm/trunk/include/llvm/TypeFinder.h (removed)
@@ -1,78 +0,0 @@
-//===-- llvm/TypeFinder.h - Class for finding used struct types -*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file contains the declaration of the TypeFinder class. 
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_TYPEFINDER_H
-#define LLVM_TYPEFINDER_H
-
-#include "llvm/ADT/DenseSet.h"
-#include <vector>
-
-namespace llvm {
-
-class MDNode;
-class Module;
-class StructType;
-class Type;
-class Value;
-
-/// TypeFinder - Walk over a module, identifying all of the types that are
-/// used by the module.
-class TypeFinder {
-  // To avoid walking constant expressions multiple times and other IR
-  // objects, we keep several helper maps.
-  DenseSet<const Value*> VisitedConstants;
-  DenseSet<Type*> VisitedTypes;
-
-  std::vector<StructType*> StructTypes;
-  bool OnlyNamed;
-
-public:
-  TypeFinder() : OnlyNamed(false) {}
-
-  void run(const Module &M, bool onlyNamed);
-  void clear();
-
-  typedef std::vector<StructType*>::iterator iterator;
-  typedef std::vector<StructType*>::const_iterator const_iterator;
-
-  iterator begin() { return StructTypes.begin(); }
-  iterator end() { return StructTypes.end(); }
-
-  const_iterator begin() const { return StructTypes.begin(); }
-  const_iterator end() const { return StructTypes.end(); }
-
-  bool empty() const { return StructTypes.empty(); }
-  size_t size() const { return StructTypes.size(); }
-  iterator erase(iterator I, iterator E) { return StructTypes.erase(I, E); }
-
-  StructType *&operator[](unsigned Idx) { return StructTypes[Idx]; }
-
-private:
-  /// incorporateType - This method adds the type to the list of used
-  /// structures if it's not in there already.
-  void incorporateType(Type *Ty);
-
-  /// incorporateValue - This method is used to walk operand lists finding types
-  /// hiding in constant expressions and other operands that won't be walked in
-  /// other ways.  GlobalValues, basic blocks, instructions, and inst operands
-  /// are all explicitly enumerated.
-  void incorporateValue(const Value *V);
-
-  /// incorporateMDNode - This method is used to walk the operands of an MDNode
-  /// to find types hiding within.
-  void incorporateMDNode(const MDNode *V);
-};
-
-} // end llvm namespace
-
-#endif

Modified: llvm/trunk/lib/IR/AsmWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AsmWriter.cpp?rev=171749&r1=171748&r2=171749&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AsmWriter.cpp (original)
+++ llvm/trunk/lib/IR/AsmWriter.cpp Mon Jan  7 09:43:51 2013
@@ -30,6 +30,7 @@
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Module.h"
 #include "llvm/IR/Operator.h"
+#include "llvm/IR/TypeFinder.h"
 #include "llvm/IR/ValueSymbolTable.h"
 #include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
@@ -37,7 +38,6 @@
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/MathExtras.h"
-#include "llvm/TypeFinder.h"
 #include <algorithm>
 #include <cctype>
 using namespace llvm;

Modified: llvm/trunk/lib/IR/TypeFinder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/TypeFinder.cpp?rev=171749&r1=171748&r2=171749&view=diff
==============================================================================
--- llvm/trunk/lib/IR/TypeFinder.cpp (original)
+++ llvm/trunk/lib/IR/TypeFinder.cpp Mon Jan  7 09:43:51 2013
@@ -11,7 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/TypeFinder.h"
+#include "llvm/IR/TypeFinder.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/IR/BasicBlock.h"
 #include "llvm/IR/DerivedTypes.h"

Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=171749&r1=171748&r2=171749&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Mon Jan  7 09:43:51 2013
@@ -21,12 +21,12 @@
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/Module.h"
+#include "llvm/IR/TypeFinder.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Transforms/Utils/Cloning.h"
 #include "llvm/Transforms/Utils/ValueMapper.h"
-#include "llvm/TypeFinder.h"
 #include <cctype>
 using namespace llvm;
 

Modified: llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp?rev=171749&r1=171748&r2=171749&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/StripSymbols.cpp Mon Jan  7 09:43:51 2013
@@ -28,10 +28,10 @@
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/Module.h"
+#include "llvm/IR/TypeFinder.h"
 #include "llvm/IR/ValueSymbolTable.h"
 #include "llvm/Pass.h"
 #include "llvm/Transforms/Utils/Local.h"
-#include "llvm/TypeFinder.h"
 using namespace llvm;
 
 namespace {

Modified: llvm/trunk/lib/Transforms/Utils/MetaRenamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/MetaRenamer.cpp?rev=171749&r1=171748&r2=171749&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/MetaRenamer.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/MetaRenamer.cpp Mon Jan  7 09:43:51 2013
@@ -20,8 +20,8 @@
 #include "llvm/IR/Function.h"
 #include "llvm/IR/Module.h"
 #include "llvm/IR/Type.h"
+#include "llvm/IR/TypeFinder.h"
 #include "llvm/Pass.h"
-#include "llvm/TypeFinder.h"
 using namespace llvm;
 
 namespace {





More information about the llvm-commits mailing list