mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add CharSourceRange -- a half-open character range, which will be used in IDE
integration Motivation: libIDE clients should be simple, and they should not have to translate token-based SourceRanges to character locations. This also allows us to remove the dependency of DiagnosticConsumer on the Lexer. Now the DiagnosticEngine translates the diagnostics to CharSourceRanges and passes character-based ranges to the DiagnosticConsumer. Swift SVN r7173
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "swift/Basic/DiagnosticConsumer.h"
|
||||
#include "swift/Parse/Lexer.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
@@ -24,18 +23,6 @@ using namespace swift;
|
||||
|
||||
DiagnosticConsumer::~DiagnosticConsumer() { }
|
||||
|
||||
llvm::SMRange DiagnosticConsumer::getRawRange(SourceManager &SM,
|
||||
DiagnosticInfo::Range R) {
|
||||
SourceLoc End;
|
||||
if (R.IsTokenRange)
|
||||
End = Lexer::getLocForEndOfToken(SM, R.End);
|
||||
else
|
||||
End = R.End;
|
||||
|
||||
return llvm::SMRange(getRawLoc(R.Start), getRawLoc(End));
|
||||
}
|
||||
|
||||
|
||||
void NullDiagnosticConsumer::handleDiagnostic(SourceManager &SM,
|
||||
SourceLoc Loc,
|
||||
DiagnosticKind Kind,
|
||||
|
||||
Reference in New Issue
Block a user