summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-22 07:03:46 +0000
committerChris Lattner <sabre@nondot.org>2008-11-22 07:03:46 +0000
commit1ef202820547499f92bd1963d1b23d9730e5688f (patch)
tree283ef4b38abec4d2855af8c1641450647c424a13 /clang/lib
parent4d5f2e532cd1628cb9a5114d7e9174120282723e (diff)
downloadbcm5719-llvm-1ef202820547499f92bd1963d1b23d9730e5688f.tar.gz
bcm5719-llvm-1ef202820547499f92bd1963d1b23d9730e5688f.zip
Move the Preprocessor::Diag methods inline. This has the interesting
(and carefully calculated) effect of allowing the compiler to reason about the aliasing properties of DiagnosticBuilder object better, allowing the whole thing to be promoted to registers instead of resulting in a ton of stack traffic. While I'm not very concerned about the performance of the Diag() method invocations, I *am* more concerned about their code size and impact on the non-diagnostic code. This patch shrinks the clang executable (in release-asserts mode with gcc-4.2) from 14523980 to 14519816 bytes. This isn't much, but it shrinks the lexer from 38192 to 37776, PPDirectives.o from 31116 to 28868 bytes, etc. llvm-svn: 59862
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 7a5174c82ff..e9894fea4d5 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -114,18 +114,6 @@ Preprocessor::~Preprocessor() {
delete Callbacks;
}
-/// Diag - Forwarding function for diagnostics. This emits a diagnostic at
-/// the specified Token's location, translating the token's start
-/// position in the current buffer into a SourcePosition object for rendering.
-DiagnosticBuilder Preprocessor::Diag(SourceLocation Loc, unsigned DiagID) {
- return Diags.Report(FullSourceLoc(Loc, getSourceManager()), DiagID);
-}
-
-DiagnosticBuilder Preprocessor::Diag(const Token &Tok, unsigned DiagID) {
- return Diags.Report(FullSourceLoc(Tok.getLocation(), getSourceManager()),
- DiagID);
-}
-
void Preprocessor::DumpToken(const Token &Tok, bool DumpFlags) const {
llvm::cerr << tok::getTokenName(Tok.getKind()) << " '"
<< getSpelling(Tok) << "'";
OpenPOWER on IntegriCloud