diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-05-01 14:34:11 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-05-01 14:34:11 +0000 |
commit | 556ab5ee900848b027d4a880c1c7a165fb8082f5 (patch) | |
tree | 5b9d6cb362a5c2b189a19883a972f96aeb8c4ae3 /clang/lib | |
parent | 4ad81df8186aa87b863488d2354afd1468d4475e (diff) | |
download | bcm5719-llvm-556ab5ee900848b027d4a880c1c7a165fb8082f5.tar.gz bcm5719-llvm-556ab5ee900848b027d4a880c1c7a165fb8082f5.zip |
Make some helper functions static.
llvm-svn: 155914
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Frontend/TextDiagnostic.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/Frontend/TextDiagnostic.cpp b/clang/lib/Frontend/TextDiagnostic.cpp index b86ecf823e7..bed82e0f0bc 100644 --- a/clang/lib/Frontend/TextDiagnostic.cpp +++ b/clang/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<i) { if (SourceLine[--i]=='\t') @@ -69,7 +69,7 @@ int bytesSincePreviousTabOrLineBegin(StringRef SourceLine, size_t i) { /// \param TabStop used to expand tabs /// \return pair(printable text, 'true' iff original text was printable) /// -std::pair<SmallString<16>,bool> +static std::pair<SmallString<16>, 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<int> &out) { +static void byteToColumn(StringRef SourceLine, unsigned TabStop, + SmallVectorImpl<int> &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<int> &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; |