forked from OSchip/llvm-project
Add a routine for emitting .file directives, for setting up
file numbers to use with .loc directives. llvm-svn: 42272
This commit is contained in:
parent
6d5ada23db
commit
bd8331da87
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue