Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Format/Format.cpp
Show First 20 Lines • Show All 1,569 Lines • ▼ Show 20 Lines | private: | ||||
deriveLocalStyle(const SmallVectorImpl<AnnotatedLine *> &AnnotatedLines) { | deriveLocalStyle(const SmallVectorImpl<AnnotatedLine *> &AnnotatedLines) { | ||||
bool HasBinPackedFunction = false; | bool HasBinPackedFunction = false; | ||||
bool HasOnePerLineFunction = false; | bool HasOnePerLineFunction = false; | ||||
for (unsigned i = 0, e = AnnotatedLines.size(); i != e; ++i) { | for (unsigned i = 0, e = AnnotatedLines.size(); i != e; ++i) { | ||||
if (!AnnotatedLines[i]->First->Next) | if (!AnnotatedLines[i]->First->Next) | ||||
continue; | continue; | ||||
FormatToken *Tok = AnnotatedLines[i]->First->Next; | FormatToken *Tok = AnnotatedLines[i]->First->Next; | ||||
while (Tok->Next) { | while (Tok->Next) { | ||||
if (Tok->PackingKind == PPK_BinPacked) | if (Tok->is(PPK_BinPacked)) | ||||
HasBinPackedFunction = true; | HasBinPackedFunction = true; | ||||
if (Tok->PackingKind == PPK_OnePerLine) | if (Tok->is(PPK_OnePerLine)) | ||||
HasOnePerLineFunction = true; | HasOnePerLineFunction = true; | ||||
Tok = Tok->Next; | Tok = Tok->Next; | ||||
} | } | ||||
} | } | ||||
if (Style.DerivePointerAlignment) | if (Style.DerivePointerAlignment) | ||||
Style.PointerAlignment = countVariableAlignments(AnnotatedLines) <= 0 | Style.PointerAlignment = countVariableAlignments(AnnotatedLines) <= 0 | ||||
? FormatStyle::PAS_Left | ? FormatStyle::PAS_Left | ||||
▲ Show 20 Lines • Show All 1,297 Lines • Show Last 20 Lines |