Add a routine for emitting .file directives, for setting up

file numbers to use with .loc directives.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42272 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2007-09-24 20:58:13 +00:00
parent b42abebe36
commit 189f80dc25
2 changed files with 14 additions and 0 deletions

View File

@ -248,6 +248,9 @@ namespace llvm {
/// @verbatim (Eg. '\t') @endverbatim
void EmitString(const std::string &String) const;
/// EmitFile - Emit a .file directive.
void EmitFile(unsigned Number, const std::string &Name) const;
//===------------------------------------------------------------------===//
/// EmitAlignment - Emit an alignment directive to the specified power of

View File

@ -618,6 +618,17 @@ void AsmPrinter::EmitString(const std::string &String) const {
}
/// EmitFile - Emit a .file directive.
void AsmPrinter::EmitFile(unsigned Number, const std::string &Name) const {
O << "\t.file\t" << Number << " \"";
for (unsigned i = 0, N = Name.size(); i < N; ++i) {
unsigned char C = Name[i];
printStringChar(O, C);
}
O << "\"";
}
//===----------------------------------------------------------------------===//
// EmitAlignment - Emit an alignment directive to the specified power of