mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-03 12:18:00 +00:00
* Fix bugs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -108,9 +108,13 @@ bool AssemblyWriter::visitMethod(const Method *M) {
|
|||||||
bool AssemblyWriter::processConstPool(const ConstantPool &CP, bool isMethod) {
|
bool AssemblyWriter::processConstPool(const ConstantPool &CP, bool isMethod) {
|
||||||
// Done printing arguments...
|
// Done printing arguments...
|
||||||
if (isMethod) {
|
if (isMethod) {
|
||||||
if (CP.getParentV()->castMethodAsserting()->getType()->
|
const MethodType *MT = CP.getParentV()->castMethodAsserting()->getType()->
|
||||||
isMethodType()->isVarArg())
|
isMethodType();
|
||||||
Out << ", ..."; // Output varargs portion of signature!
|
if (MT->isVarArg()) {
|
||||||
|
if (MT->getParamTypes().size())
|
||||||
|
Out << ", ";
|
||||||
|
Out << "..."; // Output varargs portion of signature!
|
||||||
|
}
|
||||||
Out << ")\n";
|
Out << ")\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,23 +358,7 @@ void WriteToAssembly(const BasicBlock *BB, ostream &o) {
|
|||||||
|
|
||||||
void WriteToAssembly(const ConstPoolVal *CPV, ostream &o) {
|
void WriteToAssembly(const ConstPoolVal *CPV, ostream &o) {
|
||||||
if (CPV == 0) { o << "<null> constant pool value\n"; return; }
|
if (CPV == 0) { o << "<null> constant pool value\n"; return; }
|
||||||
|
WriteAsOperand(o, CPV, true, true, 0);
|
||||||
SlotCalculator *SlotTable;
|
|
||||||
|
|
||||||
// A Constant pool value may have a parent that is either a method or a
|
|
||||||
// module. Untangle this now...
|
|
||||||
//
|
|
||||||
if (const Method *Meth = CPV->getParentV()->castMethod()) {
|
|
||||||
SlotTable = new SlotCalculator(Meth, true);
|
|
||||||
} else {
|
|
||||||
SlotTable =
|
|
||||||
new SlotCalculator(CPV->getParentV()->castModuleAsserting(), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
AssemblyWriter W(o, *SlotTable);
|
|
||||||
W.write(CPV);
|
|
||||||
|
|
||||||
delete SlotTable;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteToAssembly(const Instruction *I, ostream &o) {
|
void WriteToAssembly(const Instruction *I, ostream &o) {
|
||||||
|
Reference in New Issue
Block a user