Don't clean out the type plane of the constant pool... this is a hack. FIXME
authorChris Lattner <sabre@nondot.org>
Mon, 9 Jul 2001 19:38:52 +0000 (19:38 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 9 Jul 2001 19:38:52 +0000 (19:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/DCE.cpp

index fa2c9c7221516e3e9b2bccc7599c9caa225723d2..f1582d3346b0802bf40a2fb4e17e9b9d9972ed30 100644 (file)
@@ -37,7 +37,12 @@ using namespace cfg;
 
 struct ConstPoolDCE { 
   enum { EndOffs = 0 };
-  static bool isDCEable(const Value *) { return true; } 
+  static bool isDCEable(const ConstPoolVal *CPV) {
+    // TODO: The bytecode writer requires that all used types are in the
+    // constant pool for the current method.  This is messy and is really
+    // irritating. FIXME
+    return CPV->getType() != Type::TypeTy;  // Don't DCE Type plane constants!
+  }
 };
 
 struct BasicBlockDCE {