clang-format: Handle trailing commas in column layout of braced list.

Before, this was causing errors.

Also exit early in breakProtrudingToken() (before the expensive call to
SourceManager::getSpellingColumnNumber()). This makes formatting huge
(100k+-item) braced lists possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189094 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Format/ContinuationIndenter.cpp b/lib/Format/ContinuationIndenter.cpp
index 8f7bb50..005eec8 100644
--- a/lib/Format/ContinuationIndenter.cpp
+++ b/lib/Format/ContinuationIndenter.cpp
@@ -569,6 +569,9 @@
 unsigned ContinuationIndenter::breakProtrudingToken(const FormatToken &Current,
                                                     LineState &State,
                                                     bool DryRun) {
+  if (!Current.isOneOf(tok::string_literal, tok::comment))
+    return 0;
+
   llvm::OwningPtr<BreakableToken> Token;
   unsigned StartColumn = State.Column - Current.CodePointCount;
   unsigned OriginalStartColumn =