From 189f80dc253664627253b2d2cb07d0714feb12ba Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 24 Sep 2007 20:58:13 +0000 Subject: 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 --- lib/CodeGen/AsmPrinter.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/CodeGen/AsmPrinter.cpp') diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 6622bcdee6..521386b19f 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -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 -- cgit v1.2.3-70-g09d2