diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-17 06:22:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-17 06:22:33 +0000 |
commit | d32480d3db582186355d575db0421dd2823080b6 (patch) | |
tree | d0eec11f7cf221334aba2016cb3c39c5b6d2710f /clang/Driver/HTMLPrint.cpp | |
parent | d250ef911f62cb317596ba0aef9e3d75ca056d36 (diff) | |
download | bcm5719-llvm-d32480d3db582186355d575db0421dd2823080b6.tar.gz bcm5719-llvm-d32480d3db582186355d575db0421dd2823080b6.zip |
this massive patch introduces a simple new abstraction: it makes
"FileID" a concept that is now enforced by the compiler's type checker
instead of yet-another-random-unsigned floating around.
This is an important distinction from the "FileID" currently tracked by
SourceLocation. *That* FileID may refer to the start of a file or to a
chunk within it. The new FileID *only* refers to the file (and its
#include stack and eventually #line data), it cannot refer to a chunk.
FileID is a completely opaque datatype to all clients, only SourceManager
is allowed to poke and prod it.
llvm-svn: 62407
Diffstat (limited to 'clang/Driver/HTMLPrint.cpp')
-rw-r--r-- | clang/Driver/HTMLPrint.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/Driver/HTMLPrint.cpp b/clang/Driver/HTMLPrint.cpp index 0956c2bca58..b2bb29c9eb3 100644 --- a/clang/Driver/HTMLPrint.cpp +++ b/clang/Driver/HTMLPrint.cpp @@ -60,19 +60,19 @@ HTMLPrinter::~HTMLPrinter() { return; // Format the file. - unsigned FileID = R.getSourceMgr().getMainFileID(); - const FileEntry* Entry = R.getSourceMgr().getFileEntryForID(FileID); + FileID FID = R.getSourceMgr().getMainFileID(); + const FileEntry* Entry = R.getSourceMgr().getFileEntryForID(FID); - html::AddLineNumbers(R, FileID); - html::AddHeaderFooterInternalBuiltinCSS(R, FileID, Entry->getName()); + html::AddLineNumbers(R, FID); + html::AddHeaderFooterInternalBuiltinCSS(R, FID, Entry->getName()); // If we have a preprocessor, relex the file and syntax highlight. // We might not have a preprocessor if we come from a deserialized AST file, // for example. - if (PP) html::SyntaxHighlight(R, FileID, *PP); - if (PPF) html::HighlightMacros(R, FileID, *PP); - html::EscapeText(R, FileID, false, true); + if (PP) html::SyntaxHighlight(R, FID, *PP); + if (PPF) html::HighlightMacros(R, FID, *PP); + html::EscapeText(R, FID, false, true); // Open the output. FILE *OutputFILE; @@ -87,7 +87,7 @@ HTMLPrinter::~HTMLPrinter() { } // Emit the HTML. - const RewriteBuffer &RewriteBuf = R.getEditBuffer(FileID); + const RewriteBuffer &RewriteBuf = R.getEditBuffer(FID); char *Buffer = (char*)malloc(RewriteBuf.size()); std::copy(RewriteBuf.begin(), RewriteBuf.end(), Buffer); fwrite(Buffer, 1, RewriteBuf.size(), OutputFILE); |