mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-26 23:32:58 +00:00
* Use Classname and ClassPrefix instead of hard-coded V9 values
* Simplify code and shorten lines by not recomputing values git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15582 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0f5702237b
commit
eb178c146a
@ -23,8 +23,9 @@ void CodeEmitterGen::run(std::ostream &o) {
|
|||||||
|
|
||||||
EmitSourceFileHeader("Machine Code Emitter", o);
|
EmitSourceFileHeader("Machine Code Emitter", o);
|
||||||
|
|
||||||
std::string Namespace = "V9::";
|
std::string Namespace = Insts[0]->getValueAsString("Namespace") + "::";
|
||||||
std::string ClassName = "SparcV9CodeEmitter::";
|
std::string ClassName = Insts[0]->getValueAsString("ClassPrefix") +
|
||||||
|
"CodeEmitter::";
|
||||||
|
|
||||||
//const std::string &Namespace = Inst->getValue("Namespace")->getName();
|
//const std::string &Namespace = Inst->getValue("Namespace")->getName();
|
||||||
o << "unsigned " << ClassName
|
o << "unsigned " << ClassName
|
||||||
@ -177,14 +178,12 @@ void CodeEmitterGen::run(std::ostream &o) {
|
|||||||
// Scan through the field looking for bit initializers of the current
|
// Scan through the field looking for bit initializers of the current
|
||||||
// variable...
|
// variable...
|
||||||
for (int i = FieldInitializer->getNumBits()-1; i >= 0; --i) {
|
for (int i = FieldInitializer->getNumBits()-1; i >= 0; --i) {
|
||||||
if (BitInit *BI = dynamic_cast<BitInit*>(FieldInitializer->getBit(i)))
|
Init *I = FieldInitializer->getBit(i);
|
||||||
{
|
if (BitInit *BI = dynamic_cast<BitInit*>(I)) {
|
||||||
DEBUG(o << " // bit init: f: " << f << ", i: " << i << "\n");
|
DEBUG(o << " // bit init: f: " << f << ", i: " << i << "\n");
|
||||||
} else if (UnsetInit *UI =
|
} else if (UnsetInit *UI = dynamic_cast<UnsetInit*>(I)) {
|
||||||
dynamic_cast<UnsetInit*>(FieldInitializer->getBit(i))) {
|
|
||||||
DEBUG(o << " // unset init: f: " << f << ", i: " << i << "\n");
|
DEBUG(o << " // unset init: f: " << f << ", i: " << i << "\n");
|
||||||
} else if (VarBitInit *VBI =
|
} else if (VarBitInit *VBI = dynamic_cast<VarBitInit*>(I)) {
|
||||||
dynamic_cast<VarBitInit*>(FieldInitializer->getBit(i))) {
|
|
||||||
TypedInit *TI = VBI->getVariable();
|
TypedInit *TI = VBI->getVariable();
|
||||||
if (VarInit *VI = dynamic_cast<VarInit*>(TI)) {
|
if (VarInit *VI = dynamic_cast<VarInit*>(TI)) {
|
||||||
// If the bits of the field are laid out consecutively in the
|
// If the bits of the field are laid out consecutively in the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user