From: Benjamin Kramer Date: Tue, 1 May 2012 14:34:11 +0000 (+0000) Subject: Make some helper functions static. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d1fda0393b50c9c1ea25925725916da3ce13c1e2;p=clang Make some helper functions static. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155914 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/TextDiagnostic.cpp b/lib/Frontend/TextDiagnostic.cpp index b86ecf823e..bed82e0f0b 100644 --- a/lib/Frontend/TextDiagnostic.cpp +++ b/lib/Frontend/TextDiagnostic.cpp @@ -40,7 +40,7 @@ static const enum raw_ostream::Colors savedColor = /// \brief Number of spaces to indent when word-wrapping. const unsigned WordWrapIndentation = 6; -int bytesSincePreviousTabOrLineBegin(StringRef SourceLine, size_t i) { +static int bytesSincePreviousTabOrLineBegin(StringRef SourceLine, size_t i) { int bytes = 0; while (0,bool> +static std::pair, bool> printableTextForNextCharacter(StringRef SourceLine, size_t *i, unsigned TabStop) { assert(i && "i must not be null"); @@ -146,7 +146,7 @@ printableTextForNextCharacter(StringRef SourceLine, size_t *i, return std::make_pair(expandedByte, false); } -void expandTabs(std::string &SourceLine, unsigned TabStop) { +static void expandTabs(std::string &SourceLine, unsigned TabStop) { size_t i = SourceLine.size(); while (i>0) { i--; @@ -181,8 +181,8 @@ void expandTabs(std::string &SourceLine, unsigned TabStop) { /// /// (\u3042 is represented in UTF-8 by three bytes and takes two columns to /// display) -void byteToColumn(StringRef SourceLine, unsigned TabStop, - SmallVectorImpl &out) { +static void byteToColumn(StringRef SourceLine, unsigned TabStop, + SmallVectorImpl &out) { out.clear(); if (SourceLine.empty()) { @@ -215,7 +215,7 @@ void byteToColumn(StringRef SourceLine, unsigned TabStop, /// /// (\u3042 is represented in UTF-8 by three bytes and takes two columns to /// display) -void columnToByte(StringRef SourceLine, unsigned TabStop, +static void columnToByte(StringRef SourceLine, unsigned TabStop, SmallVectorImpl &out) { out.clear(); @@ -934,8 +934,7 @@ void TextDiagnostic::emitSnippetAndCaret( emitParseableFixits(Hints); } -void TextDiagnostic::emitSnippet(StringRef line) -{ +void TextDiagnostic::emitSnippet(StringRef line) { if (line.empty()) return;