X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=lib%2FSupport%2FSourceMgr.cpp;h=e4e01be0380291848330485f04318340d4799ac3;hb=71e5ea88604161e2e1effe20486ab3bcb363645f;hp=5fa987bc3dfd36c611f21e8255b719189d229afe;hpb=eb034f4af3f84106828c9ca11b0b003c1c86fb49;p=oota-llvm.git diff --git a/lib/Support/SourceMgr.cpp b/lib/Support/SourceMgr.cpp index 5fa987bc3df..e4e01be0380 100644 --- a/lib/Support/SourceMgr.cpp +++ b/lib/Support/SourceMgr.cpp @@ -121,7 +121,7 @@ SourceMgr::getLineAndColumn(SMLoc Loc, int BufferID) const { Cache.LineNoOfQuery = LineNo; size_t NewlineOffs = StringRef(BufStart, Ptr-BufStart).find_last_of("\n\r"); - if (NewlineOffs == StringRef::npos) NewlineOffs = ~0ULL; + if (NewlineOffs == StringRef::npos) NewlineOffs = ~(size_t)0; return std::make_pair(LineNo, Ptr-BufStart-NewlineOffs); } @@ -243,8 +243,8 @@ SMDiagnostic::SMDiagnostic(const SourceMgr &sm, SMLoc L, const std::string &FN, void SMDiagnostic::print(const char *ProgName, raw_ostream &S, bool ShowColors) const { - // Display colors only if OS goes to a tty. - ShowColors &= S.is_displayed(); + // Display colors only if OS supports colors. + ShowColors &= S.has_colors(); if (ShowColors) S.changeColor(raw_ostream::SAVEDCOLOR, true); @@ -358,5 +358,3 @@ void SMDiagnostic::print(const char *ProgName, raw_ostream &S, S << '\n'; } - -