aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/llvm/CodeGen/AsmPrinter.h3
-rw-r--r--lib/CodeGen/AsmPrinter.cpp11
2 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h
index 4a312a7..0ca7cfc 100644
--- a/include/llvm/CodeGen/AsmPrinter.h
+++ b/include/llvm/CodeGen/AsmPrinter.h
@@ -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
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp
index 6622bcd..521386b 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