summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-09-24 20:58:13 +0000
committerDan Gohman <gohman@apple.com>2007-09-24 20:58:13 +0000
commitbd8331da87d3a44d3dde147936d7e02a11f1a690 (patch)
tree1a42a0951c326602eeec33a26734de8b854e0724 /llvm/lib/CodeGen/AsmPrinter.cpp
parent6d5ada23db825cc73f086c73a95b0ef9fb6cf2fa (diff)
downloadbcm5719-llvm-bd8331da87d3a44d3dde147936d7e02a11f1a690.tar.gz
bcm5719-llvm-bd8331da87d3a44d3dde147936d7e02a11f1a690.zip
Add a routine for emitting .file directives, for setting up
file numbers to use with .loc directives. llvm-svn: 42272
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index 6622bcdee66..521386b19fa 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud