summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/Support/SourceMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/Support/SourceMgr.cpp')
-rw-r--r--contrib/llvm/lib/Support/SourceMgr.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/llvm/lib/Support/SourceMgr.cpp b/contrib/llvm/lib/Support/SourceMgr.cpp
index 6d44a4d..4cb9b2f 100644
--- a/contrib/llvm/lib/Support/SourceMgr.cpp
+++ b/contrib/llvm/lib/Support/SourceMgr.cpp
@@ -14,6 +14,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Support/SourceMgr.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Locale.h"
#include "llvm/Support/MemoryBuffer.h"
@@ -25,8 +26,8 @@ static const size_t TabStop = 8;
namespace {
struct LineNoCacheTy {
- unsigned LastQueryBufferID;
const char *LastQuery;
+ unsigned LastQueryBufferID;
unsigned LineNoOfQuery;
};
}
@@ -141,7 +142,7 @@ SMDiagnostic SourceMgr::GetMessage(SMLoc Loc, SourceMgr::DiagKind Kind,
// location to pull out the source line.
SmallVector<std::pair<unsigned, unsigned>, 4> ColRanges;
std::pair<unsigned, unsigned> LineAndCol;
- const char *BufferID = "<unknown>";
+ StringRef BufferID = "<unknown>";
std::string LineStr;
if (Loc.isValid()) {
@@ -395,8 +396,7 @@ void SMDiagnostic::print(const char *ProgName, raw_ostream &S, bool ShowColors,
// map like Clang's TextDiagnostic. For now, we'll just handle tabs by
// expanding them later, and bail out rather than show incorrect ranges and
// misaligned fixits for any other odd characters.
- if (std::find_if(LineContents.begin(), LineContents.end(), isNonASCII) !=
- LineContents.end()) {
+ if (find_if(LineContents, isNonASCII) != LineContents.end()) {
printSourceLine(S, LineContents);
return;
}
OpenPOWER on IntegriCloud