Delete some dead and non-obvious code.

llvm-svn: 89729
This commit is contained in:
Dan Gohman 2009-11-24 01:48:15 +00:00
parent 11c5d09a35
commit 7c41aa00c0
2 changed files with 0 additions and 55 deletions

View File

@ -346,10 +346,6 @@ Init *BitsInit::convertInitializerBitRange(const std::vector<unsigned> &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<BitInit*>(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<VarBitInit*>(getBit(0));
if (FirstBit == 0) return true;
TypedInit *Var = FirstBit->getVariable();
// Check to make sure the types are compatible.
BitsRecTy *Ty = dynamic_cast<BitsRecTy*>(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<VarBitInit*>(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<UnsetInit*>(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.
//

View File

@ -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;
};