mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
De-virtualize EmitZeroes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28046 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4f1ea1e9d9
commit
c6a057b04d
@ -101,6 +101,7 @@ namespace llvm {
|
|||||||
/// "\t.zero\t" and "\t.space\t". If this is set to null, the
|
/// "\t.zero\t" and "\t.space\t". If this is set to null, the
|
||||||
/// Data*bitsDirective's will be used to emit zero bytes.
|
/// Data*bitsDirective's will be used to emit zero bytes.
|
||||||
const char *ZeroDirective; // Defaults to "\t.zero\t"
|
const char *ZeroDirective; // Defaults to "\t.zero\t"
|
||||||
|
const char *ZeroDirectiveSuffix; // Defaults to ""
|
||||||
|
|
||||||
/// AsciiDirective - This directive allows emission of an ascii string with
|
/// AsciiDirective - This directive allows emission of an ascii string with
|
||||||
/// the standard C escape characters embedded into it.
|
/// the standard C escape characters embedded into it.
|
||||||
@ -256,7 +257,7 @@ namespace llvm {
|
|||||||
|
|
||||||
/// EmitZeros - Emit a block of zeros.
|
/// EmitZeros - Emit a block of zeros.
|
||||||
///
|
///
|
||||||
virtual void EmitZeros(uint64_t NumZeros) const;
|
void EmitZeros(uint64_t NumZeros) const;
|
||||||
|
|
||||||
/// EmitString - Emit a zero-byte-terminated string constant.
|
/// EmitString - Emit a zero-byte-terminated string constant.
|
||||||
///
|
///
|
||||||
|
@ -37,6 +37,7 @@ AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm)
|
|||||||
InlineAsmStart("#APP\n\t"),
|
InlineAsmStart("#APP\n\t"),
|
||||||
InlineAsmEnd("\t#NO_APP\n"),
|
InlineAsmEnd("\t#NO_APP\n"),
|
||||||
ZeroDirective("\t.zero\t"),
|
ZeroDirective("\t.zero\t"),
|
||||||
|
ZeroDirectiveSuffix(0),
|
||||||
AsciiDirective("\t.ascii\t"),
|
AsciiDirective("\t.ascii\t"),
|
||||||
AscizDirective("\t.asciz\t"),
|
AscizDirective("\t.asciz\t"),
|
||||||
Data8bitsDirective("\t.byte\t"),
|
Data8bitsDirective("\t.byte\t"),
|
||||||
@ -240,9 +241,12 @@ void AsmPrinter::EmitAlignment(unsigned NumBits, const GlobalValue *GV) const {
|
|||||||
///
|
///
|
||||||
void AsmPrinter::EmitZeros(uint64_t NumZeros) const {
|
void AsmPrinter::EmitZeros(uint64_t NumZeros) const {
|
||||||
if (NumZeros) {
|
if (NumZeros) {
|
||||||
if (ZeroDirective)
|
if (ZeroDirective) {
|
||||||
O << ZeroDirective << NumZeros << "\n";
|
O << ZeroDirective << NumZeros;
|
||||||
else {
|
if (ZeroDirectiveSuffix)
|
||||||
|
O << ZeroDirectiveSuffix;
|
||||||
|
O << "\n";
|
||||||
|
} else {
|
||||||
for (; NumZeros; --NumZeros)
|
for (; NumZeros; --NumZeros)
|
||||||
O << Data8bitsDirective << "0\n";
|
O << Data8bitsDirective << "0\n";
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,8 @@ X86IntelAsmPrinter::X86IntelAsmPrinter(std::ostream &O, X86TargetMachine &TM)
|
|||||||
GlobalPrefix = "_";
|
GlobalPrefix = "_";
|
||||||
PrivateGlobalPrefix = "$";
|
PrivateGlobalPrefix = "$";
|
||||||
AlignDirective = "\talign\t";
|
AlignDirective = "\talign\t";
|
||||||
ZeroDirective = 0;
|
ZeroDirective = "\tdb\t";
|
||||||
|
ZeroDirectiveSuffix = " dup(0)";
|
||||||
AsciiDirective = "\tdb\t";
|
AsciiDirective = "\tdb\t";
|
||||||
AscizDirective = 0;
|
AscizDirective = 0;
|
||||||
Data8bitsDirective = "\t.db\t";
|
Data8bitsDirective = "\t.db\t";
|
||||||
@ -472,12 +473,6 @@ void X86IntelAsmPrinter::SwitchSection(const char *NewSection,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void X86IntelAsmPrinter::EmitZeros(uint64_t NumZeros) const {
|
|
||||||
if (NumZeros) {
|
|
||||||
O << "\tdb " << NumZeros << " dup(0)\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void X86IntelAsmPrinter::EmitString(const ConstantArray *CVA) const {
|
void X86IntelAsmPrinter::EmitString(const ConstantArray *CVA) const {
|
||||||
unsigned NumElts = CVA->getNumOperands();
|
unsigned NumElts = CVA->getNumOperands();
|
||||||
if (NumElts) {
|
if (NumElts) {
|
||||||
|
@ -93,7 +93,6 @@ struct X86IntelAsmPrinter : public X86SharedAsmPrinter {
|
|||||||
bool doFinalization(Module &M);
|
bool doFinalization(Module &M);
|
||||||
|
|
||||||
virtual void SwitchSection(const char *NewSection, const GlobalValue *GV);
|
virtual void SwitchSection(const char *NewSection, const GlobalValue *GV);
|
||||||
virtual void EmitZeros(uint64_t NumZeros) const;
|
|
||||||
virtual void EmitString(const ConstantArray *CVA) const;
|
virtual void EmitString(const ConstantArray *CVA) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user