[PATCH] D22223: [LowerTypeTests] Don't rely on doInitialization()

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 11 10:07:48 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL275074: [LowerTypeTests] Don't rely on doInitialization(). (authored by davide).

Changed prior to commit:
  http://reviews.llvm.org/D22223?vs=63524&id=63529#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D22223

Files:
  llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp

Index: llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp
===================================================================
--- llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp
+++ llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp
@@ -253,8 +253,6 @@
   void buildBitSetsFromDisjointSet(ArrayRef<Metadata *> TypeIds,
                                    ArrayRef<GlobalObject *> Globals);
   bool lower();
-
-  bool doInitialization(Module &M) override;
   bool runOnModule(Module &M) override;
 };
 
@@ -266,27 +264,6 @@
 
 ModulePass *llvm::createLowerTypeTestsPass() { return new LowerTypeTests; }
 
-bool LowerTypeTests::doInitialization(Module &Mod) {
-  M = &Mod;
-  const DataLayout &DL = Mod.getDataLayout();
-
-  Triple TargetTriple(M->getTargetTriple());
-  LinkerSubsectionsViaSymbols = TargetTriple.isMacOSX();
-  Arch = TargetTriple.getArch();
-  ObjectFormat = TargetTriple.getObjectFormat();
-
-  Int1Ty = Type::getInt1Ty(M->getContext());
-  Int8Ty = Type::getInt8Ty(M->getContext());
-  Int32Ty = Type::getInt32Ty(M->getContext());
-  Int32PtrTy = PointerType::getUnqual(Int32Ty);
-  Int64Ty = Type::getInt64Ty(M->getContext());
-  IntPtrTy = DL.getIntPtrType(M->getContext(), 0);
-
-  TypeTestCallSites.clear();
-
-  return false;
-}
-
 /// Build a bit set for TypeId using the object layouts in
 /// GlobalLayout.
 BitSetInfo LowerTypeTests::buildBitSet(
@@ -1012,5 +989,21 @@
   if (skipModule(M))
     return false;
 
+  this->M = &M;
+  const DataLayout &DL = M.getDataLayout();
+
+  Triple TargetTriple(M.getTargetTriple());
+  LinkerSubsectionsViaSymbols = TargetTriple.isMacOSX();
+  Arch = TargetTriple.getArch();
+  ObjectFormat = TargetTriple.getObjectFormat();
+
+  Int1Ty = Type::getInt1Ty(M.getContext());
+  Int8Ty = Type::getInt8Ty(M.getContext());
+  Int32Ty = Type::getInt32Ty(M.getContext());
+  Int32PtrTy = PointerType::getUnqual(Int32Ty);
+  Int64Ty = Type::getInt64Ty(M.getContext());
+  IntPtrTy = DL.getIntPtrType(M.getContext(), 0);
+
+  TypeTestCallSites.clear();
   return lower();
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22223.63529.patch
Type: text/x-patch
Size: 2028 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160711/c3e468c3/attachment.bin>


More information about the llvm-commits mailing list