From 9e763b88b0c194924eed1de00d17f421a9222181 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 24 Nov 2009 01:48:15 +0000 Subject: Delete some dead and non-obvious code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89729 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/Record.cpp | 49 ----------------------------------------------- utils/TableGen/Record.h | 6 ------ 2 files changed, 55 deletions(-) (limited to 'utils') diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp index 3f952b44a9..53f90146a7 100644 --- a/utils/TableGen/Record.cpp +++ b/utils/TableGen/Record.cpp @@ -346,10 +346,6 @@ Init *BitsInit::convertInitializerBitRange(const std::vector &Bits) { } std::string BitsInit::getAsString() const { - //if (!printInHex(OS)) return; - //if (!printAsVariable(OS)) return; - //if (!printAsUnset(OS)) return; - std::string Result = "{ "; for (unsigned i = 0, e = getNumBits(); i != e; ++i) { if (i) Result += ", "; @@ -361,51 +357,6 @@ std::string BitsInit::getAsString() const { return Result + " }"; } -bool BitsInit::printInHex(raw_ostream &OS) const { - // First, attempt to convert the value into an integer value... - int64_t Result = 0; - for (unsigned i = 0, e = getNumBits(); i != e; ++i) - if (BitInit *Bit = dynamic_cast(getBit(i))) { - Result |= Bit->getValue() << i; - } else { - return true; - } - - OS << format("0x%x", Result); - return false; -} - -bool BitsInit::printAsVariable(raw_ostream &OS) const { - // Get the variable that we may be set equal to... - assert(getNumBits() != 0); - VarBitInit *FirstBit = dynamic_cast(getBit(0)); - if (FirstBit == 0) return true; - TypedInit *Var = FirstBit->getVariable(); - - // Check to make sure the types are compatible. - BitsRecTy *Ty = dynamic_cast(FirstBit->getVariable()->getType()); - if (Ty == 0) return true; - if (Ty->getNumBits() != getNumBits()) return true; // Incompatible types! - - // Check to make sure all bits are referring to the right bits in the variable - for (unsigned i = 0, e = getNumBits(); i != e; ++i) { - VarBitInit *Bit = dynamic_cast(getBit(i)); - if (Bit == 0 || Bit->getVariable() != Var || Bit->getBitNum() != i) - return true; - } - - Var->print(OS); - return false; -} - -bool BitsInit::printAsUnset(raw_ostream &OS) const { - for (unsigned i = 0, e = getNumBits(); i != e; ++i) - if (!dynamic_cast(getBit(i))) - return true; - OS << "?"; - return false; -} - // resolveReferences - If there are any field references that refer to fields // that have been filled in, we can propagate the values now. // diff --git a/utils/TableGen/Record.h b/utils/TableGen/Record.h index 4384c42d26..278c349dd6 100644 --- a/utils/TableGen/Record.h +++ b/utils/TableGen/Record.h @@ -611,12 +611,6 @@ public: virtual std::string getAsString() const; virtual Init *resolveReferences(Record &R, const RecordVal *RV); - - // printXX - Print this bitstream with the specified format, returning true if - // it is not possible. - bool printInHex(raw_ostream &OS) const; - bool printAsVariable(raw_ostream &OS) const; - bool printAsUnset(raw_ostream &OS) const; }; -- cgit v1.2.3