diff options
author | Chris Lattner <sabre@nondot.org> | 2002-12-02 17:43:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-12-02 17:43:43 +0000 |
commit | 9833493bae15d9b84cb1c5dc26a2d7bcc8aefebd (patch) | |
tree | a86ae653dc32e8f6104c6ccf7d53477aa4b7f66a /support | |
parent | f1e37d9d037bb5f7beb688822beddd2340cd871e (diff) | |
download | external_llvm-9833493bae15d9b84cb1c5dc26a2d7bcc8aefebd.zip external_llvm-9833493bae15d9b84cb1c5dc26a2d7bcc8aefebd.tar.gz external_llvm-9833493bae15d9b84cb1c5dc26a2d7bcc8aefebd.tar.bz2 |
Adjustments due to new FieldInit stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4852 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'support')
-rw-r--r-- | support/tools/TableGen/TableGen.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/support/tools/TableGen/TableGen.cpp b/support/tools/TableGen/TableGen.cpp index a66ffe6..6f330ea 100644 --- a/support/tools/TableGen/TableGen.cpp +++ b/support/tools/TableGen/TableGen.cpp @@ -236,7 +236,7 @@ static void PrintValue(Record *I, unsigned char *Ptr, const RecordVal &Val) { unsigned Offset = 0; for (unsigned f = 0, e = Vals.size(); f != e; ++f) if (Vals[f].getPrefix()) { - BitsInit *FieldInit = (BitsInit*)Vals[f].getValue(); + BitsInit *FieldInitializer = (BitsInit*)Vals[f].getValue(); if (&Vals[f] == &Val) { // Read the bits directly now... for (unsigned i = 0, e = BI->getNumBits(); i != e; ++i) @@ -246,13 +246,19 @@ static void PrintValue(Record *I, unsigned char *Ptr, const RecordVal &Val) { // Scan through the field looking for bit initializers of the current // variable... - for (unsigned i = 0, e = FieldInit->getNumBits(); i != e; ++i) + for (unsigned i = 0, e = FieldInitializer->getNumBits(); i != e; ++i) if (VarBitInit *VBI = - dynamic_cast<VarBitInit*>(FieldInit->getBit(i))) { - if (VBI->getVariable()->getName() == Val.getName()) - Value |= getMemoryBit(Ptr, Offset+i) << VBI->getBitNum(); + dynamic_cast<VarBitInit*>(FieldInitializer->getBit(i))) { + TypedInit *TI = VBI->getVariable(); + if (VarInit *VI = dynamic_cast<VarInit*>(TI)) { + if (VI->getName() == Val.getName()) + Value |= getMemoryBit(Ptr, Offset+i) << VBI->getBitNum(); + } else if (FieldInit *FI = dynamic_cast<FieldInit*>(TI)) { + // FIXME: implement this! + std::cerr << "FIELD INIT not implemented yet!\n"; + } } - Offset += FieldInit->getNumBits(); + Offset += FieldInitializer->getNumBits(); } std::cout << "0x" << std::hex << Value << std::dec; |