aboutsummaryrefslogtreecommitdiff
path: root/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-12-12 22:39:36 +0000
committerTed Kremenek <kremenek@apple.com>2007-12-12 22:39:36 +0000
commit9c728dc4d8da89c73fcae74c9e72d7a83ffd7b6d (patch)
treee89a3acd2ddb4a993e1d6bac53c05628b24f4f2b /Lex/Preprocessor.cpp
parent5e71124dabe8017f17ce8996e4161a202694e3e6 (diff)
TargetInfo no longer includes a reference to SourceManager.
Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation. Added many utility methods to FullSourceLoc to provide shorthand for: FullLoc.getManager().someMethod(FullLoc.getLocation()); instead we have: FullLoc.someMethod(); Modified TextDiagnostics (and related classes) to use this short-hand. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44957 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Lex/Preprocessor.cpp')
-rw-r--r--Lex/Preprocessor.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/Lex/Preprocessor.cpp b/Lex/Preprocessor.cpp
index 51d8e5d410..fb4628be71 100644
--- a/Lex/Preprocessor.cpp
+++ b/Lex/Preprocessor.cpp
@@ -120,12 +120,12 @@ PPCallbacks::~PPCallbacks() {
/// the specified Token's location, translating the token's start
/// position in the current buffer into a SourcePosition object for rendering.
void Preprocessor::Diag(SourceLocation Loc, unsigned DiagID) {
- Diags.Report(Loc, DiagID, SourceMgr);
+ Diags.Report(getFullLoc(Loc), DiagID);
}
void Preprocessor::Diag(SourceLocation Loc, unsigned DiagID,
const std::string &Msg) {
- Diags.Report(Loc, DiagID, SourceMgr, &Msg, 1);
+ Diags.Report(getFullLoc(Loc), DiagID, &Msg, 1);
}
void Preprocessor::DumpToken(const Token &Tok, bool DumpFlags) const {
@@ -791,7 +791,7 @@ bool Preprocessor::HandleMacroExpandedIdentifier(Token &Identifier,
// If this is the first use of a target-specific macro, warn about it.
if (MI->isTargetSpecific()) {
MI->setIsTargetSpecific(false); // Don't warn on second use.
- getTargetInfo().DiagnoseNonPortability(Identifier.getLocation(),
+ getTargetInfo().DiagnoseNonPortability(getFullLoc(Identifier.getLocation()),
diag::port_target_macro_use);
}
@@ -1227,7 +1227,7 @@ void Preprocessor::HandleIdentifier(Token &Identifier) {
// This diagnosic is only emitted when macro expansion is enabled, because
// the macro would not have been expanded for the other target either.
II.setIsOtherTargetMacro(false); // Don't warn on second use.
- getTargetInfo().DiagnoseNonPortability(Identifier.getLocation(),
+ getTargetInfo().DiagnoseNonPortability(getFullLoc(Identifier.getLocation()),
diag::port_target_macro_use);
}
@@ -2337,15 +2337,17 @@ void Preprocessor::HandleIfdefDirective(Token &Result, bool isIfndef,
// If this is the first use of a target-specific macro, warn about it.
if (MI->isTargetSpecific()) {
MI->setIsTargetSpecific(false); // Don't warn on second use.
- getTargetInfo().DiagnoseNonPortability(MacroNameTok.getLocation(),
- diag::port_target_macro_use);
+ getTargetInfo().DiagnoseNonPortability(
+ getFullLoc(MacroNameTok.getLocation()),
+ diag::port_target_macro_use);
}
} else {
// Use of a target-specific macro for some other target? If so, warn.
if (MII->isOtherTargetMacro()) {
MII->setIsOtherTargetMacro(false); // Don't warn on second use.
- getTargetInfo().DiagnoseNonPortability(MacroNameTok.getLocation(),
- diag::port_target_macro_use);
+ getTargetInfo().DiagnoseNonPortability(
+ getFullLoc(MacroNameTok.getLocation()),
+ diag::port_target_macro_use);
}
}