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 | 189f80dc253664627253b2d2cb07d0714feb12ba (patch) | |
tree | 724dc40bd2df104662e57d7058fe907f321fbde1 /lib/CodeGen/AsmPrinter.cpp | |
parent | b42abebe36f1dfbd0c779fd1471618c42ed3fec5 (diff) |
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
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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 |