diff options
author | Jeff Cohen <jeffc@jolt-lang.org> | 2006-05-02 03:46:13 +0000 |
---|---|---|
committer | Jeff Cohen <jeffc@jolt-lang.org> | 2006-05-02 03:46:13 +0000 |
commit | c6a057b04db506152c98355b51ba15d82a15b90a (patch) | |
tree | 829766c8d882654aada56935b4135f38e8571f2d /lib | |
parent | 4f1ea1e9d9d5e35d5c49068a5fc010c296fd3085 (diff) | |
download | external_llvm-c6a057b04db506152c98355b51ba15d82a15b90a.zip external_llvm-c6a057b04db506152c98355b51ba15d82a15b90a.tar.gz external_llvm-c6a057b04db506152c98355b51ba15d82a15b90a.tar.bz2 |
De-virtualize EmitZeroes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28046 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 10 | ||||
-rwxr-xr-x | lib/Target/X86/X86IntelAsmPrinter.cpp | 9 | ||||
-rwxr-xr-x | lib/Target/X86/X86IntelAsmPrinter.h | 1 |
3 files changed, 9 insertions, 11 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 9e94f7a..aad0232 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -37,6 +37,7 @@ AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm) InlineAsmStart("#APP\n\t"), InlineAsmEnd("\t#NO_APP\n"), ZeroDirective("\t.zero\t"), + ZeroDirectiveSuffix(0), AsciiDirective("\t.ascii\t"), AscizDirective("\t.asciz\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 { if (NumZeros) { - if (ZeroDirective) - O << ZeroDirective << NumZeros << "\n"; - else { + if (ZeroDirective) { + O << ZeroDirective << NumZeros; + if (ZeroDirectiveSuffix) + O << ZeroDirectiveSuffix; + O << "\n"; + } else { for (; NumZeros; --NumZeros) O << Data8bitsDirective << "0\n"; } diff --git a/lib/Target/X86/X86IntelAsmPrinter.cpp b/lib/Target/X86/X86IntelAsmPrinter.cpp index 112f496..900f67e 100755 --- a/lib/Target/X86/X86IntelAsmPrinter.cpp +++ b/lib/Target/X86/X86IntelAsmPrinter.cpp @@ -28,7 +28,8 @@ X86IntelAsmPrinter::X86IntelAsmPrinter(std::ostream &O, X86TargetMachine &TM) GlobalPrefix = "_"; PrivateGlobalPrefix = "$"; AlignDirective = "\talign\t"; - ZeroDirective = 0; + ZeroDirective = "\tdb\t"; + ZeroDirectiveSuffix = " dup(0)"; AsciiDirective = "\tdb\t"; AscizDirective = 0; 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 { unsigned NumElts = CVA->getNumOperands(); if (NumElts) { diff --git a/lib/Target/X86/X86IntelAsmPrinter.h b/lib/Target/X86/X86IntelAsmPrinter.h index 7c81923..34a7110 100755 --- a/lib/Target/X86/X86IntelAsmPrinter.h +++ b/lib/Target/X86/X86IntelAsmPrinter.h @@ -93,7 +93,6 @@ struct X86IntelAsmPrinter : public X86SharedAsmPrinter { bool doFinalization(Module &M); virtual void SwitchSection(const char *NewSection, const GlobalValue *GV); - virtual void EmitZeros(uint64_t NumZeros) const; virtual void EmitString(const ConstantArray *CVA) const; }; |