diff options
| author | Dan Gohman <gohman@apple.com> | 2007-09-24 20:58:13 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2007-09-24 20:58:13 +0000 |
| commit | bd8331da87d3a44d3dde147936d7e02a11f1a690 (patch) | |
| tree | 1a42a0951c326602eeec33a26734de8b854e0724 /llvm/lib/CodeGen/AsmPrinter.cpp | |
| parent | 6d5ada23db825cc73f086c73a95b0ef9fb6cf2fa (diff) | |
| download | bcm5719-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.cpp | 11 |
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 |

