Remove an assertion that uses Type::TypeTy that is never hit and will
authorReid Spencer <rspencer@reidspencer.com>
Thu, 27 May 2004 22:05:50 +0000 (22:05 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Thu, 27 May 2004 22:05:50 +0000 (22:05 +0000)
break when Type::TypeTy goes away. Also remove a dead block of code and
dead comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13861 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AsmParser/llvmAsmParser.y

index dfdb398f44ae56376655a81953aa3672eaaed4ef..27464acfe24d06ddf4e19ccbfb5a22b030e49f72 100644 (file)
@@ -377,7 +377,6 @@ static Value *getValNonImprovising(const Type *Ty, const ValID &D) {
 // real thing.
 //
 static Value *getVal(const Type *Ty, const ValID &D) {
-  assert(Ty != Type::TypeTy && "Should use getTypeVal for types!");
 
   // See if the value has already been defined...
   Value *V = getValNonImprovising(Ty, D);
@@ -519,17 +518,7 @@ static bool setValueName(Value *V, char *NameStr) {
   Value *Existing = ST.lookup(V->getType(), Name);
 
   if (Existing) {    // Inserting a name that is already defined???
-    // There is only one case where this is allowed: when we are refining an
-    // opaque type.  In this case, Existing will be an opaque type.
-    if (const Type *Ty = dyn_cast<Type>(Existing)) {
-      if (const OpaqueType *OpTy = dyn_cast<OpaqueType>(Ty)) {
-       // We ARE replacing an opaque type!
-       ((OpaqueType*)OpTy)->refineAbstractTypeTo(cast<Type>(V));
-       return true;
-      }
-    }
-
-    // Otherwise, we are a simple redefinition of a value, check to see if it
+    // We are a simple redefinition of a value, check to see if it
     // is defined the same as the old one...
     if (const Type *Ty = dyn_cast<Type>(Existing)) {
       if (Ty == cast<Type>(V)) return true;  // Yes, it's equal.