|
reference, declaration → definition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
|
Declarations
tools/clang/lib/Format/BreakableToken.h 34 struct FormatStyle;
References
include/llvm/ADT/Optional.h 39 T value;
60 explicit OptionalStorage(in_place_t, Args &&... args)
61 : value(std::forward<Args>(args)...), hasVal(true) {}
72 T &getValue() LLVM_LVALUE_FUNCTION noexcept {
76 T const &getValue() const LLVM_LVALUE_FUNCTION noexcept {
81 T &&getValue() && noexcept {
87 template <class... Args> void emplace(Args &&... args) {
89 ::new ((void *)std::addressof(value)) T(std::forward<Args>(args)...);
89 ::new ((void *)std::addressof(value)) T(std::forward<Args>(args)...);
97 ::new ((void *)std::addressof(value)) T(y);
131 ::new ((void *)std::addressof(value)) T(std::move(other.value));
216 optional_detail::OptionalStorage<T> Storage;
219 using value_type = T;
224 Optional(const T &y) : Storage(optional_detail::in_place_t{}, y) {}
227 Optional(T &&y) : Storage(optional_detail::in_place_t{}, std::move(y)) {}
230 Optional &operator=(T &&y) {
237 template <typename... ArgTypes> void emplace(ArgTypes &&... Args) {
241 static inline Optional create(const T *y) {
245 Optional &operator=(const T &y) {
253 const T *getPointer() const { return &Storage.getValue(); }
254 T *getPointer() { return &Storage.getValue(); }
255 const T &getValue() const LLVM_LVALUE_FUNCTION { return Storage.getValue(); }
256 T &getValue() LLVM_LVALUE_FUNCTION { return Storage.getValue(); }
260 const T *operator->() const { return getPointer(); }
261 T *operator->() { return getPointer(); }
262 const T &operator*() const LLVM_LVALUE_FUNCTION { return getValue(); }
263 T &operator*() LLVM_LVALUE_FUNCTION { return getValue(); }
266 constexpr T getValueOr(U &&value) const LLVM_LVALUE_FUNCTION {
271 T &&getValue() && { return std::move(Storage.getValue()); }
272 T &&operator*() && { return std::move(Storage.getValue()); }
275 T getValueOr(U &&value) && {
include/llvm/ADT/SmallVector.h 75 AlignedCharArrayUnion<T> FirstEl;
114 using value_type = T;
115 using iterator = T *;
116 using const_iterator = const T *;
121 using reference = T &;
122 using const_reference = const T &;
123 using pointer = T *;
124 using const_pointer = const T *;
179 class SmallVectorTemplateBase : public SmallVectorTemplateCommon<T> {
183 static void destroy_range(T *S, T *E) {
183 static void destroy_range(T *S, T *E) {
211 void push_back(const T &Elt) {
218 void push_back(T &&Elt) {
240 T *NewElts = static_cast<T*>(llvm::safe_malloc(NewCapacity*sizeof(T)));
240 T *NewElts = static_cast<T*>(llvm::safe_malloc(NewCapacity*sizeof(T)));
315 class SmallVectorImpl : public SmallVectorTemplateBase<T> {
316 using SuperClass = SmallVectorTemplateBase<T>;
352 new (&*I) T();
357 void resize(size_type N, const T &NV) {
374 LLVM_NODISCARD T pop_back_val() {
397 void append(size_type NumInputs, const T &Elt) {
405 void append(std::initializer_list<T> IL) {
412 void assign(size_type NumElts, const T &Elt) {
429 void assign(std::initializer_list<T> IL) {
467 iterator insert(iterator I, T &&Elt) {
497 iterator insert(iterator I, const T &Elt) {
526 iterator insert(iterator I, size_type NumToInsert, const T &Elt) {
637 void insert(iterator I, std::initializer_list<T> IL) {
820 AlignedCharArrayUnion<T> InlineElts[N];
837 class SmallVector : public SmallVectorImpl<T>, SmallVectorStorage<T, N> {
837 class SmallVector : public SmallVectorImpl<T>, SmallVectorStorage<T, N> {
846 explicit SmallVector(size_t Size, const T &Value = T())
865 SmallVector(std::initializer_list<T> IL) : SmallVectorImpl<T>(N) {
884 SmallVector(SmallVectorImpl<T> &&RHS) : SmallVectorImpl<T>(N) {
include/llvm/ADT/StringMap.h 129 ValueTy second;
134 StringMapEntryStorage(size_t strLen, InitTy &&... InitVals)
135 : StringMapEntryBase(strLen), second(std::forward<InitTy>(InitVals)...) {}
138 const ValueTy &getValue() const { return second; }
139 ValueTy &getValue() { return second; }
141 void setValue(const ValueTy &V) { second = V; }
158 class StringMapEntry final : public StringMapEntryStorage<ValueTy> {
160 using StringMapEntryStorage<ValueTy>::StringMapEntryStorage;
179 InitTy &&... InitVals) {
192 new (NewItem) StringMapEntry(KeyLength, std::forward<InitTy>(InitVals)...);
204 static StringMapEntry *Create(StringRef Key, InitType &&... InitVal) {
246 using MapEntryTy = StringMapEntry<ValueTy>;
260 StringMap(std::initializer_list<std::pair<StringRef, ValueTy>> List)
330 using mapped_type = ValueTy;
331 using value_type = StringMapEntry<ValueTy>;
334 using const_iterator = StringMapConstIterator<ValueTy>;
335 using iterator = StringMapIterator<ValueTy>;
350 iterator_range<StringMapKeyIterator<ValueTy>> keys() const {
369 ValueTy lookup(StringRef Key) const {
378 ValueTy &operator[](StringRef Key) { return try_emplace(Key).first->second; }
413 std::pair<iterator, bool> insert(std::pair<StringRef, ValueTy> KV) {
432 std::pair<iterator, bool> try_emplace(StringRef Key, ArgsTy &&... Args) {
441 Bucket = MapEntryTy::Create(Key, Allocator, std::forward<ArgsTy>(Args)...);
531 : public StringMapIterBase<StringMapConstIterator<ValueTy>,
532 const StringMapEntry<ValueTy>> {
533 using base = StringMapIterBase<StringMapConstIterator<ValueTy>,
534 const StringMapEntry<ValueTy>>;
542 const StringMapEntry<ValueTy> &operator*() const {
548 class StringMapIterator : public StringMapIterBase<StringMapIterator<ValueTy>,
549 StringMapEntry<ValueTy>> {
551 StringMapIterBase<StringMapIterator<ValueTy>, StringMapEntry<ValueTy>>;
551 StringMapIterBase<StringMapIterator<ValueTy>, StringMapEntry<ValueTy>>;
559 StringMapEntry<ValueTy> &operator*() const {
563 operator StringMapConstIterator<ValueTy>() const {
include/llvm/Support/AlignOf.h 30 T t;
39 template <typename T> union SizerImpl<T> { char arr[sizeof(T)]; };
50 llvm::detail::SizerImpl<T, Ts...>)];
include/llvm/Support/Error.h 437 static const bool isRef = std::is_reference<T>::value;
439 using wrap = std::reference_wrapper<typename std::remove_reference<T>::type>;
444 using storage_type = typename std::conditional<isRef, wrap, T>::type;
445 using value_type = T;
448 using reference = typename std::remove_reference<T>::type &;
449 using const_reference = const typename std::remove_reference<T>::type &;
450 using pointer = typename std::remove_reference<T>::type *;
451 using const_pointer = const typename std::remove_reference<T>::type *;
474 Expected(OtherT &&Val,
475 typename std::enable_if<std::is_convertible<OtherT, T>::value>::type
475 typename std::enable_if<std::is_convertible<OtherT, T>::value>::type
483 new (getStorage()) storage_type(std::forward<OtherT>(Val));
492 Expected(Expected<OtherT> &&Other,
493 typename std::enable_if<std::is_convertible<OtherT, T>::value>::type
493 typename std::enable_if<std::is_convertible<OtherT, T>::value>::type
594 template <class OtherT> void moveConstruct(Expected<OtherT> &&Other) {
607 template <class OtherT> void moveAssign(Expected<OtherT> &&Other) {
include/llvm/Support/YAMLTraits.h 313 using Signature_enumeration = void (*)(class IO&, T&);
322 (sizeof(test<ScalarEnumerationTraits<T>>(nullptr)) == 1);
329 using Signature_bitset = void (*)(class IO&, T&);
337 static bool const value = (sizeof(test<ScalarBitSetTraits<T>>(nullptr)) == 1);
344 using Signature_input = StringRef (*)(StringRef, void*, T&);
345 using Signature_output = void (*)(const T&, void*, raw_ostream&);
357 (sizeof(test<ScalarTraits<T>>(nullptr, nullptr, nullptr)) == 1);
364 using Signature_input = StringRef (*)(StringRef, void *, T &);
365 using Signature_output = void (*)(const T &, void *, raw_ostream &);
375 (sizeof(test<BlockScalarTraits<T>>(nullptr, nullptr)) == 1);
380 using Signature_input = StringRef (*)(StringRef, StringRef, void *, T &);
381 using Signature_output = void (*)(const T &, void *, raw_ostream &,
383 using Signature_mustQuote = QuotingType (*)(const T &, StringRef);
393 (sizeof(test<TaggedScalarTraits<T>>(nullptr, nullptr, nullptr)) == 1);
412 using Signature_mapping = void (*)(class IO &, T &);
419 static bool const value = (sizeof(test<MappingTraits<T>>(nullptr)) == 1);
438 using Signature_validate = StringRef (*)(class IO &, T &);
445 static bool const value = (sizeof(test<MappingTraits<T>>(nullptr)) == 1);
452 using Signature_size = size_t (*)(class IO&, T&);
460 static bool const value = (sizeof(test<SequenceTraits<T>>(nullptr)) == 1);
467 using Signature_input = void (*)(IO &io, StringRef key, T &v);
476 (sizeof(test<CustomMappingTraits<T>>(nullptr)) == 1);
516 using Signature_size = size_t (*)(class IO &, T &);
524 static bool const value = (sizeof(test<DocumentListTraits<T>>(nullptr))==1);
528 using Signature_getKind = NodeKind (*)(const T &);
535 static bool const value = (sizeof(test<PolymorphicTraits<T>>(nullptr)) == 1);
957 void doMapping(IO &io, T &Val, Context &Ctx) {
961 template <typename T> void doMapping(IO &io, T &Val, EmptyContext &Ctx) {
962 MappingTraits<T>::mapping(io, Val);
1078 typename std::enable_if<unvalidatedMappingTraits<T, Context>::value, void>::type
1079 yamlize(IO &io, T &Val, bool, Context &Ctx) {
1080 if (has_FlowTraits<MappingTraits<T>>::value) {
1791 inline typename std::enable_if<has_MappingTraits<T, EmptyContext>::value,
1793 operator<<(Output &yout, T &map) {
include/llvm/Support/type_traits.h 91 T t;
122 static auto get(F*) -> decltype(std::declval<F &>() = std::declval<const F &>(), std::true_type{});
122 static auto get(F*) -> decltype(std::declval<F &>() = std::declval<const F &>(), std::true_type{});
122 static auto get(F*) -> decltype(std::declval<F &>() = std::declval<const F &>(), std::true_type{});
130 static auto get(F*) -> decltype(std::declval<F &>() = std::declval<F &&>(), std::true_type{});
130 static auto get(F*) -> decltype(std::declval<F &>() = std::declval<F &&>(), std::true_type{});
130 static auto get(F*) -> decltype(std::declval<F &>() = std::declval<F &&>(), std::true_type{});
145 std::is_copy_constructible<detail::trivial_helper<T>>::value;
147 !std::is_copy_constructible<T>::value;
151 std::is_move_constructible<detail::trivial_helper<T>>::value;
153 !std::is_move_constructible<T>::value;
157 is_copy_assignable<detail::trivial_helper<T>>::value;
159 !is_copy_assignable<T>::value;
163 is_move_assignable<detail::trivial_helper<T>>::value;
165 !is_move_assignable<T>::value;
169 std::is_destructible<detail::trivial_helper<T>>::value;
tools/clang/include/clang/Format/Format.h 2026 bool operator==(const FormatStyle &R) const {
2133 llvm::Optional<FormatStyle> GetLanguageStyle(LanguageKind Language) const;
2143 typedef std::map<FormatStyle::LanguageKind, FormatStyle> MapType;
2143 typedef std::map<FormatStyle::LanguageKind, FormatStyle> MapType;
2145 llvm::Optional<FormatStyle> Get(FormatStyle::LanguageKind Language) const;
2145 llvm::Optional<FormatStyle> Get(FormatStyle::LanguageKind Language) const;
2152 void Add(FormatStyle Style);
2162 const FormatStyle &MainStyle,
2163 const std::vector<FormatStyle> &ConfigurationStyles);
2168 friend std::error_code parseConfiguration(StringRef Text, FormatStyle *Style);
2173 FormatStyle getLLVMStyle(
2174 FormatStyle::LanguageKind Language = FormatStyle::LanguageKind::LK_Cpp);
2174 FormatStyle::LanguageKind Language = FormatStyle::LanguageKind::LK_Cpp);
2180 FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language);
2180 FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language);
2184 FormatStyle getChromiumStyle(FormatStyle::LanguageKind Language);
2184 FormatStyle getChromiumStyle(FormatStyle::LanguageKind Language);
2188 FormatStyle getMozillaStyle();
2192 FormatStyle getWebKitStyle();
2196 FormatStyle getGNUStyle();
2200 FormatStyle getMicrosoftStyle(FormatStyle::LanguageKind Language);
2200 FormatStyle getMicrosoftStyle(FormatStyle::LanguageKind Language);
2203 FormatStyle getNoStyle();
2211 bool getPredefinedStyle(StringRef Name, FormatStyle::LanguageKind Language,
2212 FormatStyle *Style);
2223 std::error_code parseConfiguration(StringRef Text, FormatStyle *Style);
2226 std::string configurationAsText(const FormatStyle &Style);
2230 tooling::Replacements sortIncludes(const FormatStyle &Style, StringRef Code,
2240 const FormatStyle &Style);
2257 const FormatStyle &Style);
2282 tooling::Replacements reformat(const FormatStyle &Style, StringRef Code,
2290 tooling::Replacements reformat(const FormatStyle &Style, StringRef Code,
2299 tooling::Replacements cleanup(const FormatStyle &Style, StringRef Code,
2307 tooling::Replacements fixNamespaceEndComments(const FormatStyle &Style,
2317 tooling::Replacements sortUsingDeclarations(const FormatStyle &Style,
2325 LangOptions getFormattingLangOpts(const FormatStyle &Style = getLLVMStyle());
2365 llvm::Expected<FormatStyle> getStyle(StringRef StyleName, StringRef FileName,
2372 FormatStyle::LanguageKind guessLanguage(StringRef FileName, StringRef Code);
2375 inline StringRef getLanguageName(FormatStyle::LanguageKind Language) {
2377 case FormatStyle::LK_Cpp:
2379 case FormatStyle::LK_CSharp:
2381 case FormatStyle::LK_ObjC:
2383 case FormatStyle::LK_Java:
2385 case FormatStyle::LK_JavaScript:
2387 case FormatStyle::LK_Proto:
2389 case FormatStyle::LK_TableGen:
2391 case FormatStyle::LK_TextProto:
tools/clang/include/clang/Tooling/Refactoring/AtomicChange.h 149 format::FormatStyle Style = format::getNoStyle();
tools/clang/lib/Format/BreakableToken.cpp 43 const FormatStyle &Style) {
49 if (Style.Language == FormatStyle::LK_TextProto)
68 encoding::Encoding Encoding, const FormatStyle &Style,
100 else if (Style.Language == FormatStyle::LK_JavaScript &&
237 encoding::Encoding Encoding, const FormatStyle &Style)
265 const FormatStyle &Style)
336 encoding::Encoding Encoding, const FormatStyle &Style, bool UseCRLF)
430 if (Style.Language == FormatStyle::LK_JavaScript ||
431 Style.Language == FormatStyle::LK_Java) {
550 if (Style.Language != FormatStyle::LK_Java &&
551 Style.Language != FormatStyle::LK_JavaScript)
725 encoding::Encoding Encoding, const FormatStyle &Style)
767 Style.Language == FormatStyle::LK_TextProto)
tools/clang/lib/Format/BreakableToken.h 235 encoding::Encoding Encoding, const FormatStyle &Style)
242 const FormatStyle &Style;
254 encoding::Encoding Encoding, const FormatStyle &Style);
294 const FormatStyle &Style);
362 const FormatStyle &Style, bool UseCRLF);
441 const FormatStyle &Style);
tools/clang/lib/Format/ContinuationIndenter.cpp 30 static bool shouldIndentWrappedSelectorName(const FormatStyle &Style,
121 const FormatStyle &Style) {
124 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeComma)
126 if (Style.Language == FormatStyle::LK_Proto && Current.is(TT_SelectorName))
131 FormatStyle::BCIS_BeforeComma) &&
133 Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma));
137 const FormatStyle &Style) {
140 return Style.Language == FormatStyle::LK_TextProto ||
141 (Style.Language == FormatStyle::LK_Proto &&
174 getCanonicalRawStringDelimiter(const FormatStyle &Style,
175 FormatStyle::LanguageKind Language) {
184 const FormatStyle &CodeStyle) {
186 llvm::Optional<FormatStyle> LanguageStyle =
189 FormatStyle PredefinedStyle;
207 llvm::Optional<FormatStyle>
215 llvm::Optional<FormatStyle>
224 ContinuationIndenter::ContinuationIndenter(const FormatStyle &Style,
248 if (Style.IndentPPDirectives == FormatStyle::PPDIS_AfterHash &&
264 if (Style.Language == FormatStyle::LK_TextProto) {
313 if (Style.AlwaysBreakAfterReturnType == FormatStyle::RTBS_None)
339 if (Style.Language == FormatStyle::LK_ObjC &&
369 Style.BreakConstructorInitializers == FormatStyle::BCIS_AfterColon
376 (Style.AllowShortFunctionsOnASingleLine != FormatStyle::SFS_All ||
377 Style.BreakConstructorInitializers != FormatStyle::BCIS_BeforeColon ||
405 Style.Language == FormatStyle::LK_JavaScript) &&
467 return Style.AlwaysBreakTemplateDeclarations != FormatStyle::BTDS_No;
479 Style.AlwaysBreakAfterReturnType != FormatStyle::RTBS_None)) ||
567 if (Style.IndentPPDirectives == FormatStyle::PPDIS_AfterHash &&
577 if (Style.UseTab != FormatStyle::UT_Never)
587 if (Style.BreakInheritanceList == FormatStyle::BILS_BeforeComma &&
590 if (Style.BreakInheritanceList == FormatStyle::BILS_AfterColon &&
611 if (Style.AlignAfterOpenBracket == FormatStyle::BAS_AlwaysBreak &&
631 if (Style.AlignAfterOpenBracket != FormatStyle::BAS_DontAlign &&
641 if (Current.is(TT_LambdaArrow) && Style.Language == FormatStyle::LK_Java)
669 Style.BreakBeforeBinaryOperators != FormatStyle::BOS_None) ||
696 FormatStyle::BCIS_AfterColon) {
708 if (Style.BreakBeforeBinaryOperators == FormatStyle::BOS_None)
773 (Style.Language != FormatStyle::LK_JavaScript ||
894 Style.BreakConstructorInitializers == FormatStyle::BCIS_AfterColon;
932 if (Style.Language == FormatStyle::LK_Java &&
937 if (Style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths &&
947 (Style.Language == FormatStyle::LK_Proto ||
948 Style.Language == FormatStyle::LK_TextProto))) &&
980 ((Style.Language == FormatStyle::LK_Proto ||
981 Style.Language == FormatStyle::LK_TextProto) &&
1061 Style.BreakConstructorInitializers == FormatStyle::BCIS_AfterColon)
1064 Style.BreakInheritanceList == FormatStyle::BILS_AfterColon)
1124 Style.BreakConstructorInitializers != FormatStyle::BCIS_AfterColon) {
1132 (Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeComma
1145 Style.BreakConstructorInitializers == FormatStyle::BCIS_AfterColon) {
1259 (Style.Language != FormatStyle::LK_Java && *I > 0)) &&
1260 (Style.AlignAfterOpenBracket != FormatStyle::BAS_DontAlign ||
1275 Style.AlignAfterOpenBracket != FormatStyle::BAS_DontAlign)
1335 Style.Language == FormatStyle::LK_Proto ||
1336 Style.Language == FormatStyle::LK_TextProto ||
1366 (Style.ObjCBinPackProtocolList == FormatStyle::BPS_Auto &&
1368 Style.ObjCBinPackProtocolList == FormatStyle::BPS_Always;
1375 (Style.Language == FormatStyle::LK_JavaScript && EndsInComma) ||
1404 if (Style.Language == FormatStyle::LK_JavaScript && EndsInComma)
1503 const FormatStyle &RawStringStyle, bool DryRun, bool Newline) {
1740 llvm::Optional<FormatStyle>
1766 if (Style.Language == FormatStyle::LK_Java ||
1767 Style.Language == FormatStyle::LK_JavaScript || Style.isCSharp() ||
tools/clang/lib/Format/ContinuationIndenter.h 39 llvm::StringMap<FormatStyle> DelimiterStyle;
40 llvm::StringMap<FormatStyle> EnclosingFunctionStyle;
42 RawStringFormatStyleManager(const FormatStyle &CodeStyle);
44 llvm::Optional<FormatStyle> getDelimiterStyle(StringRef Delimiter) const;
46 llvm::Optional<FormatStyle>
54 ContinuationIndenter(const FormatStyle &Style,
113 const FormatStyle &RawStringStyle,
123 llvm::Optional<FormatStyle> getRawStringStyle(const FormatToken &Current,
191 FormatStyle Style;
tools/clang/lib/Format/Format.cpp 56 static void enumeration(IO &IO, FormatStyle::LanguageKind &Value) {
57 IO.enumCase(Value, "Cpp", FormatStyle::LK_Cpp);
58 IO.enumCase(Value, "Java", FormatStyle::LK_Java);
59 IO.enumCase(Value, "JavaScript", FormatStyle::LK_JavaScript);
60 IO.enumCase(Value, "ObjC", FormatStyle::LK_ObjC);
61 IO.enumCase(Value, "Proto", FormatStyle::LK_Proto);
62 IO.enumCase(Value, "TableGen", FormatStyle::LK_TableGen);
63 IO.enumCase(Value, "TextProto", FormatStyle::LK_TextProto);
64 IO.enumCase(Value, "CSharp", FormatStyle::LK_CSharp);
69 static void enumeration(IO &IO, FormatStyle::LanguageStandard &Value) {
70 IO.enumCase(Value, "c++03", FormatStyle::LS_Cpp03);
71 IO.enumCase(Value, "C++03", FormatStyle::LS_Cpp03); // Legacy alias
72 IO.enumCase(Value, "Cpp03", FormatStyle::LS_Cpp03); // Legacy alias
74 IO.enumCase(Value, "c++11", FormatStyle::LS_Cpp11);
75 IO.enumCase(Value, "C++11", FormatStyle::LS_Cpp11); // Legacy alias
77 IO.enumCase(Value, "c++14", FormatStyle::LS_Cpp14);
78 IO.enumCase(Value, "c++17", FormatStyle::LS_Cpp17);
79 IO.enumCase(Value, "c++20", FormatStyle::LS_Cpp20);
81 IO.enumCase(Value, "Latest", FormatStyle::LS_Latest);
82 IO.enumCase(Value, "Cpp11", FormatStyle::LS_Latest); // Legacy alias
83 IO.enumCase(Value, "Auto", FormatStyle::LS_Auto);
88 static void enumeration(IO &IO, FormatStyle::UseTabStyle &Value) {
89 IO.enumCase(Value, "Never", FormatStyle::UT_Never);
90 IO.enumCase(Value, "false", FormatStyle::UT_Never);
91 IO.enumCase(Value, "Always", FormatStyle::UT_Always);
92 IO.enumCase(Value, "true", FormatStyle::UT_Always);
93 IO.enumCase(Value, "ForIndentation", FormatStyle::UT_ForIndentation);
95 FormatStyle::UT_ForContinuationAndIndentation);
100 static void enumeration(IO &IO, FormatStyle::JavaScriptQuoteStyle &Value) {
101 IO.enumCase(Value, "Leave", FormatStyle::JSQS_Leave);
102 IO.enumCase(Value, "Single", FormatStyle::JSQS_Single);
103 IO.enumCase(Value, "Double", FormatStyle::JSQS_Double);
108 static void enumeration(IO &IO, FormatStyle::ShortBlockStyle &Value) {
109 IO.enumCase(Value, "Never", FormatStyle::SBS_Never);
110 IO.enumCase(Value, "false", FormatStyle::SBS_Never);
111 IO.enumCase(Value, "Always", FormatStyle::SBS_Always);
112 IO.enumCase(Value, "true", FormatStyle::SBS_Always);
113 IO.enumCase(Value, "Empty", FormatStyle::SBS_Empty);
118 static void enumeration(IO &IO, FormatStyle::ShortFunctionStyle &Value) {
119 IO.enumCase(Value, "None", FormatStyle::SFS_None);
120 IO.enumCase(Value, "false", FormatStyle::SFS_None);
121 IO.enumCase(Value, "All", FormatStyle::SFS_All);
122 IO.enumCase(Value, "true", FormatStyle::SFS_All);
123 IO.enumCase(Value, "Inline", FormatStyle::SFS_Inline);
124 IO.enumCase(Value, "InlineOnly", FormatStyle::SFS_InlineOnly);
125 IO.enumCase(Value, "Empty", FormatStyle::SFS_Empty);
130 static void enumeration(IO &IO, FormatStyle::ShortIfStyle &Value) {
131 IO.enumCase(Value, "Never", FormatStyle::SIS_Never);
132 IO.enumCase(Value, "Always", FormatStyle::SIS_Always);
133 IO.enumCase(Value, "WithoutElse", FormatStyle::SIS_WithoutElse);
136 IO.enumCase(Value, "false", FormatStyle::SIS_Never);
137 IO.enumCase(Value, "true", FormatStyle::SIS_WithoutElse);
142 static void enumeration(IO &IO, FormatStyle::ShortLambdaStyle &Value) {
143 IO.enumCase(Value, "None", FormatStyle::SLS_None);
144 IO.enumCase(Value, "false", FormatStyle::SLS_None);
145 IO.enumCase(Value, "Empty", FormatStyle::SLS_Empty);
146 IO.enumCase(Value, "Inline", FormatStyle::SLS_Inline);
147 IO.enumCase(Value, "All", FormatStyle::SLS_All);
148 IO.enumCase(Value, "true", FormatStyle::SLS_All);
153 static void enumeration(IO &IO, FormatStyle::BinPackStyle &Value) {
154 IO.enumCase(Value, "Auto", FormatStyle::BPS_Auto);
155 IO.enumCase(Value, "Always", FormatStyle::BPS_Always);
156 IO.enumCase(Value, "Never", FormatStyle::BPS_Never);
161 static void enumeration(IO &IO, FormatStyle::BinaryOperatorStyle &Value) {
162 IO.enumCase(Value, "All", FormatStyle::BOS_All);
163 IO.enumCase(Value, "true", FormatStyle::BOS_All);
164 IO.enumCase(Value, "None", FormatStyle::BOS_None);
165 IO.enumCase(Value, "false", FormatStyle::BOS_None);
166 IO.enumCase(Value, "NonAssignment", FormatStyle::BOS_NonAssignment);
171 static void enumeration(IO &IO, FormatStyle::BraceBreakingStyle &Value) {
172 IO.enumCase(Value, "Attach", FormatStyle::BS_Attach);
173 IO.enumCase(Value, "Linux", FormatStyle::BS_Linux);
174 IO.enumCase(Value, "Mozilla", FormatStyle::BS_Mozilla);
175 IO.enumCase(Value, "Stroustrup", FormatStyle::BS_Stroustrup);
176 IO.enumCase(Value, "Allman", FormatStyle::BS_Allman);
177 IO.enumCase(Value, "Whitesmiths", FormatStyle::BS_Whitesmiths);
178 IO.enumCase(Value, "GNU", FormatStyle::BS_GNU);
179 IO.enumCase(Value, "WebKit", FormatStyle::BS_WebKit);
180 IO.enumCase(Value, "Custom", FormatStyle::BS_Custom);
189 FormatStyle::BraceWrappingAfterControlStatementStyle &Value) {
190 IO.enumCase(Value, "false", FormatStyle::BWACS_Never);
191 IO.enumCase(Value, "true", FormatStyle::BWACS_Always);
192 IO.enumCase(Value, "Never", FormatStyle::BWACS_Never);
193 IO.enumCase(Value, "MultiLine", FormatStyle::BWACS_MultiLine);
194 IO.enumCase(Value, "Always", FormatStyle::BWACS_Always);
201 enumeration(IO &IO, FormatStyle::BreakConstructorInitializersStyle &Value) {
202 IO.enumCase(Value, "BeforeColon", FormatStyle::BCIS_BeforeColon);
203 IO.enumCase(Value, "BeforeComma", FormatStyle::BCIS_BeforeComma);
204 IO.enumCase(Value, "AfterColon", FormatStyle::BCIS_AfterColon);
211 FormatStyle::BreakInheritanceListStyle &Value) {
212 IO.enumCase(Value, "BeforeColon", FormatStyle::BILS_BeforeColon);
213 IO.enumCase(Value, "BeforeComma", FormatStyle::BILS_BeforeComma);
214 IO.enumCase(Value, "AfterColon", FormatStyle::BILS_AfterColon);
220 static void enumeration(IO &IO, FormatStyle::PPDirectiveIndentStyle &Value) {
221 IO.enumCase(Value, "None", FormatStyle::PPDIS_None);
222 IO.enumCase(Value, "AfterHash", FormatStyle::PPDIS_AfterHash);
223 IO.enumCase(Value, "BeforeHash", FormatStyle::PPDIS_BeforeHash);
229 static void enumeration(IO &IO, FormatStyle::ReturnTypeBreakingStyle &Value) {
230 IO.enumCase(Value, "None", FormatStyle::RTBS_None);
231 IO.enumCase(Value, "All", FormatStyle::RTBS_All);
232 IO.enumCase(Value, "TopLevel", FormatStyle::RTBS_TopLevel);
234 FormatStyle::RTBS_TopLevelDefinitions);
235 IO.enumCase(Value, "AllDefinitions", FormatStyle::RTBS_AllDefinitions);
242 FormatStyle::BreakTemplateDeclarationsStyle &Value) {
243 IO.enumCase(Value, "No", FormatStyle::BTDS_No);
244 IO.enumCase(Value, "MultiLine", FormatStyle::BTDS_MultiLine);
245 IO.enumCase(Value, "Yes", FormatStyle::BTDS_Yes);
248 IO.enumCase(Value, "false", FormatStyle::BTDS_MultiLine);
249 IO.enumCase(Value, "true", FormatStyle::BTDS_Yes);
256 enumeration(IO &IO, FormatStyle::DefinitionReturnTypeBreakingStyle &Value) {
257 IO.enumCase(Value, "None", FormatStyle::DRTBS_None);
258 IO.enumCase(Value, "All", FormatStyle::DRTBS_All);
259 IO.enumCase(Value, "TopLevel", FormatStyle::DRTBS_TopLevel);
262 IO.enumCase(Value, "false", FormatStyle::DRTBS_None);
263 IO.enumCase(Value, "true", FormatStyle::DRTBS_All);
270 FormatStyle::NamespaceIndentationKind &Value) {
271 IO.enumCase(Value, "None", FormatStyle::NI_None);
272 IO.enumCase(Value, "Inner", FormatStyle::NI_Inner);
273 IO.enumCase(Value, "All", FormatStyle::NI_All);
278 static void enumeration(IO &IO, FormatStyle::BracketAlignmentStyle &Value) {
279 IO.enumCase(Value, "Align", FormatStyle::BAS_Align);
280 IO.enumCase(Value, "DontAlign", FormatStyle::BAS_DontAlign);
281 IO.enumCase(Value, "AlwaysBreak", FormatStyle::BAS_AlwaysBreak);
284 IO.enumCase(Value, "true", FormatStyle::BAS_Align);
285 IO.enumCase(Value, "false", FormatStyle::BAS_DontAlign);
292 FormatStyle::EscapedNewlineAlignmentStyle &Value) {
293 IO.enumCase(Value, "DontAlign", FormatStyle::ENAS_DontAlign);
294 IO.enumCase(Value, "Left", FormatStyle::ENAS_Left);
295 IO.enumCase(Value, "Right", FormatStyle::ENAS_Right);
298 IO.enumCase(Value, "true", FormatStyle::ENAS_Left);
299 IO.enumCase(Value, "false", FormatStyle::ENAS_Right);
304 static void enumeration(IO &IO, FormatStyle::PointerAlignmentStyle &Value) {
305 IO.enumCase(Value, "Middle", FormatStyle::PAS_Middle);
306 IO.enumCase(Value, "Left", FormatStyle::PAS_Left);
307 IO.enumCase(Value, "Right", FormatStyle::PAS_Right);
310 IO.enumCase(Value, "true", FormatStyle::PAS_Left);
311 IO.enumCase(Value, "false", FormatStyle::PAS_Right);
318 FormatStyle::SpaceBeforeParensOptions &Value) {
319 IO.enumCase(Value, "Never", FormatStyle::SBPO_Never);
321 FormatStyle::SBPO_ControlStatements);
323 FormatStyle::SBPO_NonEmptyParentheses);
324 IO.enumCase(Value, "Always", FormatStyle::SBPO_Always);
327 IO.enumCase(Value, "false", FormatStyle::SBPO_Never);
328 IO.enumCase(Value, "true", FormatStyle::SBPO_ControlStatements);
333 static void mapping(IO &IO, FormatStyle &Style) {
343 FormatStyle PredefinedStyle;
354 FormatStyle::LanguageKind OldLanguage = Style.Language;
355 FormatStyle::LanguageKind Language =
412 if (Style.AlwaysBreakAfterDefinitionReturnType != FormatStyle::DRTBS_None &&
413 Style.AlwaysBreakAfterReturnType == FormatStyle::RTBS_None) {
414 if (Style.AlwaysBreakAfterDefinitionReturnType == FormatStyle::DRTBS_All)
415 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_AllDefinitions;
417 FormatStyle::DRTBS_TopLevel)
419 FormatStyle::RTBS_TopLevelDefinitions;
440 Style.BreakInheritanceList == FormatStyle::BILS_BeforeColon)
441 Style.BreakInheritanceList = FormatStyle::BILS_BeforeComma;
455 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeColon)
456 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma;
552 static void mapping(IO &IO, FormatStyle::BraceWrappingFlags &Wrapping) {
573 static void mapping(IO &IO, FormatStyle::RawStringFormat &Format) {
588 static size_t size(IO &IO, std::vector<FormatStyle> &Seq) {
591 static FormatStyle &element(IO &IO, std::vector<FormatStyle> &Seq,
591 static FormatStyle &element(IO &IO, std::vector<FormatStyle> &Seq,
595 FormatStyle Template;
596 if (!Seq.empty() && Seq[0].Language == FormatStyle::LK_None) {
600 Template.Language = FormatStyle::LK_None;
642 static FormatStyle expandPresets(const FormatStyle &Style) {
642 static FormatStyle expandPresets(const FormatStyle &Style) {
643 if (Style.BreakBeforeBraces == FormatStyle::BS_Custom)
645 FormatStyle Expanded = Style;
646 Expanded.BraceWrapping = {false, false, FormatStyle::BWACS_Never,
653 case FormatStyle::BS_Linux:
658 case FormatStyle::BS_Mozilla:
668 case FormatStyle::BS_Stroustrup:
673 case FormatStyle::BS_Allman:
676 Expanded.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always;
687 case FormatStyle::BS_Whitesmiths:
690 Expanded.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always;
700 case FormatStyle::BS_GNU:
701 Expanded.BraceWrapping = {true, true, FormatStyle::BWACS_Always,
708 case FormatStyle::BS_WebKit:
717 FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) {
717 FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) {
718 FormatStyle LLVMStyle;
721 LLVMStyle.AlignEscapedNewlines = FormatStyle::ENAS_Right;
722 LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align;
731 LLVMStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All;
732 LLVMStyle.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Never;
734 LLVMStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never;
735 LLVMStyle.AllowShortLambdasOnASingleLine = FormatStyle::SLS_All;
737 LLVMStyle.AlwaysBreakAfterReturnType = FormatStyle::RTBS_None;
738 LLVMStyle.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_None;
740 LLVMStyle.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_MultiLine;
743 LLVMStyle.BreakBeforeBinaryOperators = FormatStyle::BOS_None;
745 LLVMStyle.BreakBeforeBraces = FormatStyle::BS_Attach;
746 LLVMStyle.BraceWrapping = {false, false, FormatStyle::BWACS_Never,
753 LLVMStyle.BreakConstructorInitializers = FormatStyle::BCIS_BeforeColon;
754 LLVMStyle.BreakInheritanceList = FormatStyle::BILS_BeforeColon;
777 LLVMStyle.IndentPPDirectives = FormatStyle::PPDIS_None;
780 LLVMStyle.JavaScriptQuotes = FormatStyle::JSQS_Leave;
785 LLVMStyle.NamespaceIndentation = FormatStyle::NI_None;
786 LLVMStyle.ObjCBinPackProtocolList = FormatStyle::BPS_Auto;
790 LLVMStyle.PointerAlignment = FormatStyle::PAS_Right;
792 LLVMStyle.Standard = FormatStyle::LS_Latest;
793 LLVMStyle.UseTab = FormatStyle::UT_Never;
806 LLVMStyle.SpaceBeforeParens = FormatStyle::SBPO_ControlStatements;
828 if (Language == FormatStyle::LK_TableGen) {
835 FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) {
835 FormatStyle getGoogleStyle(FormatStyle::LanguageKind Language) {
836 if (Language == FormatStyle::LK_TextProto) {
837 FormatStyle GoogleStyle = getGoogleStyle(FormatStyle::LK_Proto);
837 FormatStyle GoogleStyle = getGoogleStyle(FormatStyle::LK_Proto);
838 GoogleStyle.Language = FormatStyle::LK_TextProto;
843 FormatStyle GoogleStyle = getLLVMStyle(Language);
846 GoogleStyle.AlignEscapedNewlines = FormatStyle::ENAS_Left;
848 FormatStyle::SIS_WithoutElse;
851 GoogleStyle.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_Yes;
862 GoogleStyle.ObjCBinPackProtocolList = FormatStyle::BPS_Never;
865 GoogleStyle.PointerAlignment = FormatStyle::PAS_Left;
868 FormatStyle::LK_Cpp,
885 FormatStyle::LK_TextProto,
908 GoogleStyle.Standard = FormatStyle::LS_Auto;
913 if (Language == FormatStyle::LK_Java) {
914 GoogleStyle.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign;
917 GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty;
918 GoogleStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never;
920 GoogleStyle.BreakBeforeBinaryOperators = FormatStyle::BOS_NonAssignment;
924 } else if (Language == FormatStyle::LK_JavaScript) {
925 GoogleStyle.AlignAfterOpenBracket = FormatStyle::BAS_AlwaysBreak;
927 GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty;
934 GoogleStyle.NamespaceIndentation = FormatStyle::NI_All;
936 GoogleStyle.JavaScriptQuotes = FormatStyle::JSQS_Single;
938 } else if (Language == FormatStyle::LK_Proto) {
939 GoogleStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty;
949 } else if (Language == FormatStyle::LK_ObjC) {
962 FormatStyle getChromiumStyle(FormatStyle::LanguageKind Language) {
962 FormatStyle getChromiumStyle(FormatStyle::LanguageKind Language) {
963 FormatStyle ChromiumStyle = getGoogleStyle(Language);
985 if (Language == FormatStyle::LK_Java) {
987 FormatStyle::SIS_WithoutElse;
1006 } else if (Language == FormatStyle::LK_JavaScript) {
1007 ChromiumStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never;
1011 ChromiumStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
1012 ChromiumStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never;
1016 if (Language == FormatStyle::LK_ObjC)
1022 FormatStyle getMozillaStyle() {
1023 FormatStyle MozillaStyle = getLLVMStyle();
1025 MozillaStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
1026 MozillaStyle.AlwaysBreakAfterReturnType = FormatStyle::RTBS_TopLevel;
1028 FormatStyle::DRTBS_TopLevel;
1029 MozillaStyle.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_Yes;
1032 MozillaStyle.BreakBeforeBraces = FormatStyle::BS_Mozilla;
1033 MozillaStyle.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma;
1034 MozillaStyle.BreakInheritanceList = FormatStyle::BILS_BeforeComma;
1043 MozillaStyle.PointerAlignment = FormatStyle::PAS_Left;
1048 FormatStyle getWebKitStyle() {
1049 FormatStyle Style = getLLVMStyle();
1051 Style.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign;
1054 Style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Empty;
1055 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All;
1056 Style.BreakBeforeBraces = FormatStyle::BS_WebKit;
1057 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma;
1062 Style.NamespaceIndentation = FormatStyle::NI_Inner;
1065 Style.PointerAlignment = FormatStyle::PAS_Left;
1071 FormatStyle getGNUStyle() {
1072 FormatStyle Style = getLLVMStyle();
1073 Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_All;
1074 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_AllDefinitions;
1075 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All;
1076 Style.BreakBeforeBraces = FormatStyle::BS_GNU;
1081 Style.SpaceBeforeParens = FormatStyle::SBPO_Always;
1082 Style.Standard = FormatStyle::LS_Cpp03;
1086 FormatStyle getMicrosoftStyle(FormatStyle::LanguageKind Language) {
1086 FormatStyle getMicrosoftStyle(FormatStyle::LanguageKind Language) {
1087 FormatStyle Style = getLLVMStyle(Language);
1091 Style.UseTab = FormatStyle::UT_Never;
1092 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
1094 Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always;
1104 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None;
1106 Style.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never;
1108 Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_None;
1109 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_None;
1113 FormatStyle getNoStyle() {
1114 FormatStyle NoStyle = getLLVMStyle();
1121 bool getPredefinedStyle(StringRef Name, FormatStyle::LanguageKind Language,
1122 FormatStyle *Style) {
1147 std::error_code parseConfiguration(StringRef Text, FormatStyle *Style) {
1149 FormatStyle::LanguageKind Language = Style->Language;
1154 std::vector<FormatStyle> Styles;
1167 if (Styles[i].Language == FormatStyle::LK_None && i != 0)
1182 FormatStyle::FormatStyleSet StyleSet;
1185 if (Styles[i].Language != FormatStyle::LK_None)
1191 if (Styles.empty() || Styles[0].Language != FormatStyle::LK_None)
1193 FormatStyle DefaultStyle = Styles[0];
1201 std::string configurationAsText(const FormatStyle &Style) {
1207 FormatStyle NonConstStyle = expandPresets(Style);
1212 llvm::Optional<FormatStyle>
1213 FormatStyle::FormatStyleSet::Get(FormatStyle::LanguageKind Language) const {
1219 FormatStyle Style = It->second;
1224 void FormatStyle::FormatStyleSet::Add(FormatStyle Style) {
1237 llvm::Optional<FormatStyle>
1238 FormatStyle::GetLanguageStyle(FormatStyle::LanguageKind Language) const {
1246 JavaScriptRequoter(const Environment &Env, const FormatStyle &Style)
1274 (Style.JavaScriptQuotes == FormatStyle::JSQS_Single &&
1276 (Style.JavaScriptQuotes == FormatStyle::JSQS_Double &&
1281 bool IsSingle = Style.JavaScriptQuotes == FormatStyle::JSQS_Single;
1333 Formatter(const Environment &Env, const FormatStyle &Style,
1433 ? FormatStyle::PAS_Left
1434 : FormatStyle::PAS_Right;
1435 if (Style.Standard == FormatStyle::LS_Auto)
1437 ? FormatStyle::LS_Latest
1438 : FormatStyle::LS_Cpp03;
1451 Cleaner(const Environment &Env, const FormatStyle &Style)
1676 ObjCHeaderStyleGuesser(const Environment &Env, const FormatStyle &Style)
1892 static void sortCppIncludes(const FormatStyle &Style,
1979 tooling::Replacements sortCppIncludes(const FormatStyle &Style, StringRef Code,
2053 static unsigned findJavaImportGroup(const FormatStyle &Style,
2073 static void sortJavaImports(const FormatStyle &Style,
2148 tooling::Replacements sortJavaImports(const FormatStyle &Style, StringRef Code,
2210 tooling::Replacements sortIncludes(const FormatStyle &Style, StringRef Code,
2218 if (Style.Language == FormatStyle::LanguageKind::LK_JavaScript &&
2221 if (Style.Language == FormatStyle::LanguageKind::LK_JavaScript)
2223 if (Style.Language == FormatStyle::LanguageKind::LK_Java)
2233 const FormatStyle &Style) {
2251 const FormatStyle &Style) {
2289 const FormatStyle &Style) {
2361 const FormatStyle &Style) {
2377 reformat(const FormatStyle &Style, StringRef Code,
2381 FormatStyle Expanded = expandPresets(Style);
2386 if (Expanded.Language == FormatStyle::LK_JavaScript && isMpegTS(Code))
2394 if (Style.Language == FormatStyle::LK_Cpp) {
2406 if (Style.Language == FormatStyle::LK_JavaScript &&
2407 Style.JavaScriptQuotes != FormatStyle::JSQS_Leave)
2443 tooling::Replacements reformat(const FormatStyle &Style, StringRef Code,
2454 tooling::Replacements cleanup(const FormatStyle &Style, StringRef Code,
2458 if (Style.Language != FormatStyle::LK_Cpp)
2463 tooling::Replacements reformat(const FormatStyle &Style, StringRef Code,
2473 tooling::Replacements fixNamespaceEndComments(const FormatStyle &Style,
2482 tooling::Replacements sortUsingDeclarations(const FormatStyle &Style,
2491 LangOptions getFormattingLangOpts(const FormatStyle &Style) {
2494 FormatStyle::LanguageStandard LexingStd = Style.Standard;
2495 if (LexingStd == FormatStyle::LS_Auto)
2496 LexingStd = FormatStyle::LS_Latest;
2497 if (LexingStd == FormatStyle::LS_Latest)
2498 LexingStd = FormatStyle::LS_Cpp20;
2500 LangOpts.CPlusPlus11 = LexingStd >= FormatStyle::LS_Cpp11;
2501 LangOpts.CPlusPlus14 = LexingStd >= FormatStyle::LS_Cpp14;
2502 LangOpts.CPlusPlus17 = LexingStd >= FormatStyle::LS_Cpp17;
2503 LangOpts.CPlusPlus2a = LexingStd >= FormatStyle::LS_Cpp20;
2526 static FormatStyle::LanguageKind getLanguageByFileName(StringRef FileName) {
2528 return FormatStyle::LK_Java;
2531 return FormatStyle::LK_JavaScript; // (module) JavaScript or TypeScript.
2533 return FormatStyle::LK_ObjC;
2536 return FormatStyle::LK_Proto;
2541 return FormatStyle::LK_TextProto;
2543 return FormatStyle::LK_TableGen;
2545 return FormatStyle::LK_CSharp;
2546 return FormatStyle::LK_Cpp;
2549 FormatStyle::LanguageKind guessLanguage(StringRef FileName, StringRef Code) {
2551 if (GuessedLanguage == FormatStyle::LK_Cpp) {
2561 return FormatStyle::LK_ObjC;
2571 llvm::Expected<FormatStyle> getStyle(StringRef StyleName, StringRef FileName,
2578 FormatStyle Style = getLLVMStyle(guessLanguage(FileName, Code));
2580 FormatStyle FallbackStyle = getNoStyle();
tools/clang/lib/Format/FormatInternal.h 73 reformat(const FormatStyle &Style, StringRef Code,
tools/clang/lib/Format/FormatToken.cpp 171 if (Style.AlignAfterOpenBracket == FormatStyle::BAS_DontAlign)
tools/clang/lib/Format/FormatToken.h 504 bool opensBlockOrBlockTypeList(const FormatStyle &Style) const {
511 (is(tok::less) && (Style.Language == FormatStyle::LK_Proto ||
512 Style.Language == FormatStyle::LK_TextProto));
517 bool isCppStructuredBinding(const FormatStyle &Style) const {
529 bool closesBlockOrBlockTypeList(const FormatStyle &Style) const {
587 TokenRole(const FormatStyle &Style) : Style(Style) {}
620 const FormatStyle &Style;
625 CommaSeparatedList(const FormatStyle &Style)
tools/clang/lib/Format/FormatTokenLexer.cpp 26 unsigned Column, const FormatStyle &Style,
53 if (Style.Language == FormatStyle::LK_JavaScript) {
57 if (Style.Language == FormatStyle::LK_TextProto)
93 if (Style.Language == FormatStyle::LK_JavaScript) {
123 if (Style.Language == FormatStyle::LK_Java) {
706 if ((Style.Language == FormatStyle::LK_JavaScript ||
707 Style.Language == FormatStyle::LK_Java) &&
763 if (Style.Language == FormatStyle::LK_Java &&
768 } else if (Style.Language == FormatStyle::LK_JavaScript &&
839 } else if (Style.Language == FormatStyle::LK_JavaScript &&
845 if ((Style.Language == FormatStyle::LK_JavaScript ||
846 Style.Language == FormatStyle::LK_Proto ||
847 Style.Language == FormatStyle::LK_TextProto) &&
tools/clang/lib/Format/FormatTokenLexer.h 40 const FormatStyle &Style, encoding::Encoding Encoding);
100 const FormatStyle &Style;
tools/clang/lib/Format/NamespaceEndCommentsFixer.cpp 181 const FormatStyle &Style)
tools/clang/lib/Format/NamespaceEndCommentsFixer.h 35 NamespaceEndCommentsFixer(const Environment &Env, const FormatStyle &Style);
tools/clang/lib/Format/SortJavaScriptImports.cpp 121 JavaScriptImportSorter(const Environment &Env, const FormatStyle &Style)
440 tooling::Replacements sortJavaScriptImports(const FormatStyle &Style,
tools/clang/lib/Format/SortJavaScriptImports.h 27 tooling::Replacements sortJavaScriptImports(const FormatStyle &Style,
tools/clang/lib/Format/TokenAnalyzer.cpp 51 TokenAnalyzer::TokenAnalyzer(const Environment &Env, const FormatStyle &Style)
tools/clang/lib/Format/TokenAnalyzer.h 82 TokenAnalyzer(const Environment &Env, const FormatStyle &Style);
96 FormatStyle Style;
tools/clang/lib/Format/TokenAnnotator.cpp 66 AnnotatingParser(const FormatStyle &Style, AnnotatedLine &Line,
105 if (Style.Language == FormatStyle::LK_Java &&
118 if (Style.Language == FormatStyle::LK_TextProto ||
119 (Style.Language == FormatStyle::LK_Proto && Left->Previous &&
128 Style.Language == FormatStyle::LK_Java) {
134 Style.Language != FormatStyle::LK_Proto &&
135 Style.Language != FormatStyle::LK_TextProto))
149 if (Style.Language == FormatStyle::LK_Proto) {
185 } else if (Style.Language == FormatStyle::LK_JavaScript &&
200 } else if (Style.Language == FormatStyle::LK_JavaScript && Left->Previous &&
206 } else if (Style.Language == FormatStyle::LK_JavaScript && Left->Previous &&
492 } else if (Style.Language == FormatStyle::LK_JavaScript && Parent &&
504 } else if (Style.Language == FormatStyle::LK_Proto ||
505 Style.Language == FormatStyle::LK_TextProto) {
556 if (Style.Language == FormatStyle::LK_JavaScript && Parent &&
669 if (Style.Language == FormatStyle::LK_JavaScript && Left->Previous &&
689 Style.Language == FormatStyle::LK_Proto ||
690 Style.Language == FormatStyle::LK_TextProto) {
697 Style.Language == FormatStyle::LK_JavaScript)
701 Style.Language == FormatStyle::LK_JavaScript)
765 if (Style.Language == FormatStyle::LK_JavaScript) {
781 Style.Language == FormatStyle::LK_Proto ||
782 Style.Language == FormatStyle::LK_TextProto) {
784 if (Style.Language == FormatStyle::LK_TextProto) {
842 if (Style.Language == FormatStyle::LK_JavaScript &&
858 if (Style.Language == FormatStyle::LK_JavaScript) {
899 if (Style.Language == FormatStyle::LK_TextProto) {
915 if (Style.Language == FormatStyle::LK_TextProto ||
916 (Style.Language == FormatStyle::LK_Proto && Tok->Previous &&
939 if (Style.Language != FormatStyle::LK_TextProto)
945 if (Style.Language == FormatStyle::LK_TextProto ||
946 Style.Language == FormatStyle::LK_Proto)
965 if (Style.Language == FormatStyle::LK_JavaScript && Tok->Next &&
978 Style.Language == FormatStyle::LK_JavaScript)
1065 if (Style.Language == FormatStyle::LK_JavaScript && IsFirstToken) {
1133 if ((Style.Language == FormatStyle::LK_Java &&
1153 if (Style.Language == FormatStyle::LK_Proto && Line.Level == 0 &&
1167 if (Style.Language == FormatStyle::LK_JavaScript &&
1174 if (Style.Language == FormatStyle::LK_JavaScript) {
1299 !(Style.Language == FormatStyle::LK_JavaScript &&
1331 Contexts.back().IsExpression = Style.Language == FormatStyle::LK_Java;
1358 if (Style.Language == FormatStyle::LK_JavaScript) {
1393 Style.Language == FormatStyle::LK_Java) {
1414 if (Style.Language == FormatStyle::LK_JavaScript &&
1425 Style.Language != FormatStyle::LK_TextProto)) {
1459 Style.Language != FormatStyle::LK_JavaScript &&
1460 Style.Language != FormatStyle::LK_Java) {
1480 else if (Style.Language == FormatStyle::LK_Java && Current.Previous &&
1505 } else if ((Style.Language == FormatStyle::LK_Java ||
1506 Style.Language == FormatStyle::LK_JavaScript) &&
1536 if (Style.Language == FormatStyle::LK_JavaScript &&
1572 if (!Style.isCpp() && Style.Language != FormatStyle::LK_Java)
1617 if (Style.Language == FormatStyle::LK_Java && Tok.Next->is(tok::l_paren))
1677 if (Style.Language == FormatStyle::LK_JavaScript)
1784 const FormatStyle &Style;
1804 ExpressionParser(const FormatStyle &Style, const AdditionalKeywords &Keywords,
1904 ((Style.Language == FormatStyle::LK_Proto ||
1905 Style.Language == FormatStyle::LK_TextProto) &&
1920 if ((Style.Language == FormatStyle::LK_Java ||
1921 Style.Language == FormatStyle::LK_JavaScript) &&
1924 if (Style.Language == FormatStyle::LK_JavaScript &&
1931 if ((Style.Language == FormatStyle::LK_Java ||
1932 Style.Language == FormatStyle::LK_JavaScript) &&
1994 const FormatStyle &Style;
2025 (Style.IndentPPDirectives != FormatStyle::PPDIS_BeforeHash &&
2162 if ((Style.AlwaysBreakAfterReturnType == FormatStyle::RTBS_TopLevel ||
2164 FormatStyle::RTBS_TopLevelDefinitions) &&
2169 case FormatStyle::RTBS_None:
2171 case FormatStyle::RTBS_All:
2172 case FormatStyle::RTBS_TopLevel:
2174 case FormatStyle::RTBS_AllDefinitions:
2175 case FormatStyle::RTBS_TopLevelDefinitions:
2268 if (Style.Language == FormatStyle::LK_ObjC &&
2322 if (Style.Language == FormatStyle::LK_Java) {
2329 } else if (Style.Language == FormatStyle::LK_JavaScript) {
2345 if (Style.Language == FormatStyle::LK_Proto)
2359 (Right.is(tok::period) && Style.Language == FormatStyle::LK_Proto))
2447 Style.AlignAfterOpenBracket != FormatStyle::BAS_DontAlign)
2459 if (Style.AlignAfterOpenBracket == FormatStyle::BAS_DontAlign)
2506 return Style.SpaceBeforeParens == FormatStyle::SBPO_Always ||
2507 (Style.SpaceBeforeParens == FormatStyle::SBPO_NonEmptyParentheses &&
2516 if (Left.is(Keywords.kw_assert) && Style.Language == FormatStyle::LK_Java)
2556 if (Style.Language == FormatStyle::LK_TextProto ||
2557 (Style.Language == FormatStyle::LK_Proto &&
2584 (Style.PointerAlignment != FormatStyle::PAS_Left ||
2591 (Style.PointerAlignment != FormatStyle::PAS_Right &&
2601 (Style.PointerAlignment != FormatStyle::PAS_Right &&
2611 ((Style.Language == FormatStyle::LK_Proto ||
2612 Style.Language == FormatStyle::LK_TextProto) &&
2647 return Style.Language == FormatStyle::LK_JavaScript ||
2654 (Style.SpaceBeforeParens != FormatStyle::SBPO_Never &&
2708 return Style.PointerAlignment != FormatStyle::PAS_Left;
2723 } else if (Style.Language == FormatStyle::LK_Proto ||
2724 Style.Language == FormatStyle::LK_TextProto) {
2756 } else if (Style.Language == FormatStyle::LK_JavaScript) {
2847 } else if (Style.Language == FormatStyle::LK_Java) {
2851 return Style.SpaceBeforeParens != FormatStyle::SBPO_Never;
2929 if (Style.Language == FormatStyle::LK_TextProto ||
2930 (Style.Language == FormatStyle::LK_Proto && Left.is(TT_DictLiteral)))
2933 (Style.Standard < FormatStyle::LS_Cpp11 || Style.SpacesInAngles);
2942 if (Style.Language == FormatStyle::LK_Java && Right.is(tok::coloncolon) &&
2952 Style.Standard < FormatStyle::LS_Cpp11) ||
2962 Style.PointerAlignment != FormatStyle::PAS_Right;
2966 return Style.PointerAlignment != FormatStyle::PAS_Left;
2999 if (Style.Language == FormatStyle::LK_JavaScript) {
3025 return Style.AllowShortFunctionsOnASingleLine == FormatStyle::SFS_None ||
3026 Style.AllowShortFunctionsOnASingleLine == FormatStyle::SFS_Empty ||
3029 FormatStyle::SFS_InlineOnly);
3030 } else if (Style.Language == FormatStyle::LK_Java) {
3034 } else if (Style.Language == FormatStyle::LK_Cpp ||
3035 Style.Language == FormatStyle::LK_ObjC ||
3036 Style.Language == FormatStyle::LK_Proto ||
3037 Style.Language == FormatStyle::LK_TableGen ||
3038 Style.Language == FormatStyle::LK_TextProto) {
3050 (Style.Language == FormatStyle::LK_JavaScript &&
3057 (Style.Language == FormatStyle::LK_JavaScript &&
3080 Style.AlwaysBreakTemplateDeclarations == FormatStyle::BTDS_Yes)
3083 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeComma &&
3087 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeComma &&
3091 if (Style.BreakInheritanceList == FormatStyle::BILS_BeforeComma &&
3102 Right.NestingLevel == 1 && Style.Language == FormatStyle::LK_Proto) {
3116 Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Never)
3122 Style.AllowShortLambdasOnASingleLine == FormatStyle::SLS_Inline)
3125 if (Style.AllowShortLambdasOnASingleLine == FormatStyle::SLS_None ||
3126 Style.AllowShortLambdasOnASingleLine == FormatStyle::SLS_Inline ||
3128 Style.AllowShortLambdasOnASingleLine == FormatStyle::SLS_Empty))
3140 if ((Style.Language == FormatStyle::LK_Java ||
3141 Style.Language == FormatStyle::LK_JavaScript) &&
3177 if ((Style.Language == FormatStyle::LK_Proto ||
3178 Style.Language == FormatStyle::LK_TextProto) &&
3238 if ((Style.Language == FormatStyle::LK_Cpp ||
3239 Style.Language == FormatStyle::LK_ObjC) &&
3267 if (Style.Language == FormatStyle::LK_Java) {
3274 } else if (Style.Language == FormatStyle::LK_JavaScript) {
3312 return Style.BreakBeforeBinaryOperators == FormatStyle::BOS_None;
3314 return Style.BreakBeforeBinaryOperators != FormatStyle::BOS_None;
3357 (Style.PointerAlignment == FormatStyle::PAS_Right &&
3372 Style.BreakConstructorInitializers == FormatStyle::BCIS_AfterColon);
3380 return Style.BreakInheritanceList == FormatStyle::BILS_AfterColon;
3382 return Style.BreakInheritanceList != FormatStyle::BILS_AfterColon;
3391 if (Style.Language == FormatStyle::LK_Proto ||
3392 Style.Language == FormatStyle::LK_TextProto) {
3490 return Style.BreakConstructorInitializers == FormatStyle::BCIS_AfterColon;
3492 return Style.BreakConstructorInitializers != FormatStyle::BCIS_AfterColon;
3494 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeComma)
3497 Style.BreakConstructorInitializers == FormatStyle::BCIS_BeforeComma)
3500 Style.BreakInheritanceList == FormatStyle::BILS_BeforeComma)
3503 Style.BreakInheritanceList == FormatStyle::BILS_BeforeComma)
3509 Style.BreakBeforeBinaryOperators != FormatStyle::BOS_None &&
3510 (Style.BreakBeforeBinaryOperators == FormatStyle::BOS_All ||
3519 Style.BreakBeforeBinaryOperators != FormatStyle::BOS_All &&
3520 (Style.BreakBeforeBinaryOperators == FormatStyle::BOS_None ||
tools/clang/lib/Format/TokenAnnotator.h 159 TokenAnnotator(const FormatStyle &Style, const AdditionalKeywords &Keywords)
192 const FormatStyle &Style;
tools/clang/lib/Format/UnwrappedLineFormatter.cpp 40 LevelIndentTracker(const FormatStyle &Style,
96 if (Style.Language == FormatStyle::LK_Java ||
97 Style.Language == FormatStyle::LK_JavaScript || Style.isCSharp())
120 const FormatStyle &Style;
164 LineJoiner(const FormatStyle &Style, const AdditionalKeywords &Keywords,
254 Style.AllowShortFunctionsOnASingleLine == FormatStyle::SFS_All ||
255 (Style.AllowShortFunctionsOnASingleLine >= FormatStyle::SFS_Empty &&
257 (Style.AllowShortFunctionsOnASingleLine & FormatStyle::SFS_InlineOnly &&
303 return Style.AllowShortBlocksOnASingleLine != FormatStyle::SBS_Never
314 FormatStyle::BWACS_MultiLine) {
326 FormatStyle::BWACS_Always)
336 if (Style.AllowShortBlocksOnASingleLine != FormatStyle::SBS_Never) {
378 (Style.AllowShortFunctionsOnASingleLine >= FormatStyle::SFS_Empty &&
430 FormatStyle::BWACS_Always &&
432 Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Never)
447 if (Style.AllowShortIfStatementsOnASingleLine != FormatStyle::SIS_Always) {
514 if (Style.Language != FormatStyle::LK_Java &&
532 if (Style.AllowShortBlocksOnASingleLine == FormatStyle::SBS_Never)
544 FormatStyle::BWACS_Always &&
555 FormatStyle::BWACS_Always &&
627 FormatStyle::BWACS_MultiLine)
641 if (Style.AllowShortBlocksOnASingleLine != FormatStyle::SBS_Never ||
698 const FormatStyle &Style;
729 const FormatStyle &Style,
820 const FormatStyle &Style;
829 const FormatStyle &Style,
856 WhitespaceManager *Whitespaces, const FormatStyle &Style,
880 const FormatStyle &Style,
1118 (Style.Language != FormatStyle::LK_JavaScript ||
1227 if (Style.BreakBeforeBraces == FormatStyle::BS_Whitesmiths) {
1233 if (Style.IndentPPDirectives != FormatStyle::PPDIS_BeforeHash &&
tools/clang/lib/Format/UnwrappedLineFormatter.h 32 const FormatStyle &Style,
67 const FormatStyle &Style;
tools/clang/lib/Format/UnwrappedLineParser.cpp 174 const FormatStyle &Style, unsigned &LineLevel)
224 UnwrappedLineParser::UnwrappedLineParser(const FormatStyle &Style,
233 IncludeGuard(Style.IndentPPDirectives == FormatStyle::PPDIS_None
240 IncludeGuard = Style.IndentPPDirectives == FormatStyle::PPDIS_None
302 !Line->InPPDirective && Style.Language != FormatStyle::LK_JavaScript;
305 if (Style.Language == FormatStyle::LK_TextProto)
319 if (Style.Language == FormatStyle::LK_TextProto &&
372 if (Style.Language == FormatStyle::LK_JavaScript &&
415 if (Style.Language == FormatStyle::LK_JavaScript && PrevTok) {
440 if (Style.Language == FormatStyle::LK_Proto) {
457 (Style.Language == FormatStyle::LK_JavaScript &&
630 static bool ShouldBreakBeforeBrace(const FormatStyle &Style,
647 bool SkipIndent = (Style.Language == FormatStyle::LK_JavaScript &&
800 Style.IndentPPDirectives != FormatStyle::PPDIS_None)
832 if (Style.IndentPPDirectives != FormatStyle::PPDIS_None)
849 if (Style.IndentPPDirectives != FormatStyle::PPDIS_None)
975 if (Style.Language == FormatStyle::LK_TableGen &&
1007 if (Style.Language == FormatStyle::LK_Java ||
1008 Style.Language == FormatStyle::LK_JavaScript || Style.isCSharp())
1024 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration)
1030 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration)
1041 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration)
1067 if (Style.Language == FormatStyle::LK_JavaScript) {
1093 if (Style.Language == FormatStyle::LK_JavaScript) {
1097 if (Style.Language == FormatStyle::LK_Proto) {
1142 } else if (Style.Language == FormatStyle::LK_Java &&
1171 FormatStyle::BWACS_Always)
1184 FormatStyle::BWACS_Always)
1231 if (Style.Language == FormatStyle::LK_Java ||
1232 Style.Language == FormatStyle::LK_JavaScript || Style.isCSharp()) {
1242 if (Style.Language == FormatStyle::LK_Java && FormatTok &&
1245 if (Style.Language == FormatStyle::LK_JavaScript && FormatTok &&
1309 if (Style.Language == FormatStyle::LK_JavaScript &&
1316 if ((Style.Language == FormatStyle::LK_JavaScript ||
1317 Style.Language == FormatStyle::LK_Java) &&
1319 if (Style.Language == FormatStyle::LK_JavaScript) {
1348 if (Style.Language == FormatStyle::LK_JavaScript)
1393 } else if (Style.Language == FormatStyle::LK_Proto &&
1587 if (Style.Language == FormatStyle::LK_JavaScript) {
1627 if (Style.Language == FormatStyle::LK_JavaScript) {
1641 if (Style.Language == FormatStyle::LK_Proto) {
1654 if (Style.Language == FormatStyle::LK_JavaScript) {
1681 if (Style.Language == FormatStyle::LK_Java && FormatTok->is(tok::l_brace))
1705 if (Style.Language == FormatStyle::LK_JavaScript)
1711 if (Style.Language == FormatStyle::LK_JavaScript &&
1822 if (Style.Language == FormatStyle::LK_Java && FormatTok->is(tok::l_paren)) {
1847 ((Style.Language == FormatStyle::LK_Java ||
1848 Style.Language == FormatStyle::LK_JavaScript) &&
1896 bool AddLevel = Style.NamespaceIndentation == FormatStyle::NI_All ||
1897 (Style.NamespaceIndentation == FormatStyle::NI_Inner &&
1912 if (Style.Language != FormatStyle::LK_Java)
1939 if (Style.Language == FormatStyle::LK_JavaScript &&
1995 FormatStyle::BWACS_Always)
2057 if (Style.Language == FormatStyle::LK_JavaScript &&
2062 if (Style.Language == FormatStyle::LK_Proto && FormatTok->is(tok::equal))
2090 if (Style.Language == FormatStyle::LK_Java) {
2095 if (Style.Language == FormatStyle::LK_Proto) {
2187 ((Style.Language == FormatStyle::LK_Java ||
2188 Style.Language == FormatStyle::LK_JavaScript) &&
2190 if (Style.Language == FormatStyle::LK_JavaScript &&
2637 if (Style.Language != FormatStyle::LK_JavaScript)
2719 if (Style.IndentPPDirectives == FormatStyle::PPDIS_BeforeHash &&
tools/clang/lib/Format/UnwrappedLineParser.h 77 UnwrappedLineParser(const FormatStyle &Style,
205 const FormatStyle &Style;
tools/clang/lib/Format/UsingDeclarationsSorter.cpp 181 const FormatStyle &Style)
tools/clang/lib/Format/UsingDeclarationsSorter.h 25 UsingDeclarationsSorter(const Environment &Env, const FormatStyle &Style);
tools/clang/lib/Format/WhitespaceManager.cpp 329 static unsigned AlignTokens(const FormatStyle &Style, F &&Matches,
713 if (Style.AlignEscapedNewlines == FormatStyle::ENAS_DontAlign)
716 bool AlignLeft = Style.AlignEscapedNewlines == FormatStyle::ENAS_Left;
814 case FormatStyle::UT_Never:
817 case FormatStyle::UT_Always: {
838 case FormatStyle::UT_ForIndentation:
853 case FormatStyle::UT_ForContinuationAndIndentation:
tools/clang/lib/Format/WhitespaceManager.h 39 WhitespaceManager(const SourceManager &SourceMgr, const FormatStyle &Style,
212 const FormatStyle &Style;
tools/clang/lib/Index/CommentToXML.cpp 592 format::FormatStyle Style = format::getLLVMStyle();
tools/clang/lib/Tooling/Refactoring/AtomicChange.cpp 146 const format::FormatStyle &Style) {
tools/clang/tools/clang-format/ClangFormat.cpp 406 llvm::Expected<FormatStyle> FormatStyle =
493 llvm::Expected<clang::format::FormatStyle> FormatStyle =
tools/clang/tools/extra/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp 105 format::FormatStyle FormatStyle = std::move(*FormatStyleOrError);
tools/clang/tools/extra/clang-include-fixer/IncludeFixer.cpp 403 const clang::format::FormatStyle &Style, bool AddQualifiers) {
tools/clang/tools/extra/clang-include-fixer/IncludeFixer.h 80 const format::FormatStyle &Style = format::getLLVMStyle(),
tools/clang/tools/extra/clangd/ClangdServer.cpp 344 auto Style = getFormatStyleForFile(File, InpAST->Inputs.Contents,
410 format::FormatStyle Style =
476 format::FormatStyle Style =
508 format::FormatStyle Style = getFormatStyleForFile(
tools/clang/tools/extra/clangd/CodeComplete.cpp 1264 auto Style = getFormatStyleForFile(
1349 auto Style = getFormatStyleForFile(FileName, Content, VFS.get());
tools/clang/tools/extra/clangd/Format.cpp 24 void closeBrackets(std::string &Code, const format::FormatStyle &Style) {
247 llvm::StringRef InsertedText, format::FormatStyle Style) {
tools/clang/tools/extra/clangd/Format.h 44 llvm::StringRef InsertedText, format::FormatStyle Style);
tools/clang/tools/extra/clangd/Headers.h 149 const format::FormatStyle &Style, StringRef BuildDir,
tools/clang/tools/extra/clangd/ParsedAST.cpp 315 auto Style = getFormatStyleForFile(Filename, Content, VFS.get());
tools/clang/tools/extra/clangd/SourceCode.cpp 700 format::FormatStyle getFormatStyleForFile(llvm::StringRef File,
715 const format::FormatStyle &Style) {
722 void lex(llvm::StringRef Code, const format::FormatStyle &Style,
740 const format::FormatStyle &Style) {
770 const format::FormatStyle &Style,
895 const format::FormatStyle &Style) {
1050 llvm::Error reformatEdit(Edit &E, const format::FormatStyle &Style) {
1060 const format::FormatStyle &Style) {
tools/clang/tools/extra/clangd/SourceCode.h 199 format::FormatStyle getFormatStyleForFile(llvm::StringRef File,
206 const format::FormatStyle &Style);
229 llvm::Error reformatEdit(Edit &E, const format::FormatStyle &Style);
233 const format::FormatStyle &Style);
263 const format::FormatStyle &Style);
284 const format::FormatStyle &Style);
tools/clang/tools/extra/clangd/XRefs.cpp 883 format::FormatStyle Style,
tools/clang/tools/extra/clangd/XRefs.h 124 format::FormatStyle Style,
tools/clang/tools/extra/clangd/unittests/FormatTests.cpp 29 format::getGoogleStyle(format::FormatStyle::LK_Cpp));
tools/clang/tools/extra/clangd/unittests/SourceCodeTests.cpp 371 auto Style = format::getLLVMStyle();
tools/clang/unittests/Format/CleanupTest.cpp 28 const FormatStyle &Style = getLLVMStyle()) {
39 const FormatStyle &Style = getLLVMStyle()) {
116 FormatStyle Style = getLLVMStyle();
135 FormatStyle Style = getLLVMStyle();
177 const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_JavaScript);
177 const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_JavaScript);
339 FormatStyle Style = getLLVMStyle();
404 Style = format::getGoogleStyle(format::FormatStyle::LanguageKind::LK_Cpp);
441 Style = format::getGoogleStyle(format::FormatStyle::LanguageKind::LK_Cpp);
tools/clang/unittests/Format/FormatTest.cpp 28 FormatStyle getGoogleStyle() { return getGoogleStyle(FormatStyle::LK_Cpp); }
28 FormatStyle getGoogleStyle() { return getGoogleStyle(FormatStyle::LK_Cpp); }
35 const FormatStyle &Style = getLLVMStyle(),
55 FormatStyle getStyleWithColumns(FormatStyle Style, unsigned ColumnLimit) {
55 FormatStyle getStyleWithColumns(FormatStyle Style, unsigned ColumnLimit) {
60 FormatStyle getLLVMStyleWithColumns(unsigned ColumnLimit) {
64 FormatStyle getGoogleStyleWithColumns(unsigned ColumnLimit) {
69 const FormatStyle &Style = getLLVMStyle()) {
73 if (Style.Language == FormatStyle::LK_Cpp) {
76 FormatStyle ObjCStyle = Style;
77 ObjCStyle.Language = FormatStyle::LK_ObjC;
83 const FormatStyle &Style = getLLVMStyle()) {
88 const FormatStyle &Style = getLLVMStyle()) {
104 const FormatStyle &Style = getLLVMStyle()) {
322 FormatStyle LLVMWithNoNamespaceFix = getLLVMStyle();
373 FormatStyle Style = getLLVMStyle();
374 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All;
376 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
452 FormatStyle AllowsMergedIf = getLLVMStyle();
453 AllowsMergedIf.AlignEscapedNewlines = FormatStyle::ENAS_Left;
455 FormatStyle::SIS_WithoutElse;
504 FormatStyle AllowsMergedIf = getLLVMStyle();
505 AllowsMergedIf.AlignEscapedNewlines = FormatStyle::ENAS_Left;
507 FormatStyle::SIS_WithoutElse;
520 AllowsMergedIf.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Always;
539 FormatStyle AllowsMergedLoops = getLLVMStyle();
562 FormatStyle AllowSimpleBracedStatements = getLLVMStyle();
565 FormatStyle::SBS_Always;
568 FormatStyle::SIS_WithoutElse;
571 AllowSimpleBracedStatements.BreakBeforeBraces = FormatStyle::BS_Custom;
619 FormatStyle::SIS_Never;
645 FormatStyle::SIS_WithoutElse;
648 FormatStyle::BWACS_Always;
686 FormatStyle::SIS_Never;
718 FormatStyle Style = getLLVMStyleWithColumns(60);
719 Style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Always;
720 Style.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_WithoutElse;
721 Style.BreakBeforeBraces = FormatStyle::BS_Allman;
910 FormatStyle NoBinPacking = getLLVMStyle();
927 FormatStyle AlignLeft = getLLVMStyle();
928 AlignLeft.PointerAlignment = FormatStyle::PAS_Left;
1167 FormatStyle Style = getLLVMStyle();
1169 Style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Never;
1170 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
1172 Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always;
1226 FormatStyle Style = getLLVMStyle();
1372 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
1374 Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always;
1419 FormatStyle Style = getLLVMStyle();
1446 FormatStyle Style = getLLVMStyle();
1447 Style.BreakBeforeBraces = FormatStyle::BraceBreakingStyle::BS_Custom;
1448 Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_MultiLine;
1730 FormatStyle StyleWithInheritanceBreakBeforeComma = getLLVMStyle();
1732 FormatStyle::BILS_BeforeComma;
1748 FormatStyle StyleWithInheritanceBreakAfterColon = getLLVMStyle();
1750 FormatStyle::BILS_AfterColon;
1898 FormatStyle Style = getLLVMStyle();
1909 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
1983 FormatStyle LLVMWithNoNamespaceFix = getLLVMStyle();
2076 FormatStyle Style = getLLVMStyle();
2077 Style.NamespaceIndentation = FormatStyle::NI_All;
2092 Style.NamespaceIndentation = FormatStyle::NI_Inner;
2109 FormatStyle Style = getLLVMStyle();
2123 Style.NamespaceIndentation = FormatStyle::NI_All;
2141 Style.NamespaceIndentation = FormatStyle::NI_Inner;
2162 Style.NamespaceIndentation = FormatStyle::NI_None;
2216 FormatStyle Style = getLLVMStyle();
2307 Style.NamespaceIndentation = FormatStyle::NI_All;
2328 Style.NamespaceIndentation = FormatStyle::NI_Inner;
2364 FormatStyle Style = getLLVMStyle();
2365 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
2493 FormatStyle Style = getLLVMStyle();
2494 for (auto BraceStyle : {FormatStyle::BS_Attach, FormatStyle::BS_Mozilla,
2494 for (auto BraceStyle : {FormatStyle::BS_Attach, FormatStyle::BS_Mozilla,
2495 FormatStyle::BS_WebKit}) {
2504 Style.BreakBeforeBraces = FormatStyle::BS_Stroustrup;
2526 Style.BreakBeforeBraces = FormatStyle::BS_Allman;
2536 Style.BreakBeforeBraces = FormatStyle::BS_Whitesmiths;
2546 Style.BreakBeforeBraces = FormatStyle::BS_GNU;
2556 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
2825 FormatStyle Style = getLLVMStyle();
2826 Style.SpaceBeforeParens = FormatStyle::SBPO_Never;
2828 Style.SpaceBeforeParens = FormatStyle::SBPO_Always;
2939 getChromiumStyle(FormatStyle::LK_Cpp));
3067 FormatStyle Style = getLLVMStyle();
3068 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
3069 Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always;
3150 FormatStyle Style = getLLVMStyle();
3151 Style.IndentPPDirectives = FormatStyle::PPDIS_None;
3165 Style.IndentPPDirectives = FormatStyle::PPDIS_AfterHash;
3396 FormatStyle Tabbed = Style;
3397 Tabbed.UseTab = FormatStyle::UT_Always;
3423 Style.IndentPPDirectives = FormatStyle::PPDIS_BeforeHash;
3532 FormatStyle Narrow = getLLVMStyleWithColumns(11);
3540 FormatStyle AlignLeft = getLLVMStyle();
3541 AlignLeft.AlignEscapedNewlines = FormatStyle::ENAS_Left;
3565 FormatStyle DontAlign = getLLVMStyle();
3566 DontAlign.AlignEscapedNewlines = FormatStyle::ENAS_DontAlign;
3696 FormatStyle SingleLine = getLLVMStyle();
3697 SingleLine.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_WithoutElse;
3823 FormatStyle Style = getGoogleStyle();
3863 FormatStyle Style = getLLVMStyle();
3866 Style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Empty;
3871 FormatStyle Style = getLLVMStyle();
4010 FormatStyle OnePerLine = getLLVMStyle();
4080 FormatStyle Style = getLLVMStyle();
4081 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All;
4149 Style.UseTab = FormatStyle::UT_Always;
4150 Style.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign;
4171 FormatStyle Style = getLLVMStyle();
4177 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_NonAssignment;
4198 Style.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign;
4207 FormatStyle Style = getLLVMStyle();
4208 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_NonAssignment;
4216 FormatStyle Style = getLLVMStyle();
4217 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_NonAssignment;
4252 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_None;
4328 FormatStyle OnePerLine = getLLVMStyle();
4379 FormatStyle Style = getLLVMStyle();
4380 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma;
4392 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma;
4405 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeColon;
4417 Style.BreakConstructorInitializers = FormatStyle::BCIS_AfterColon;
4433 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma;
4459 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeColon;
4485 Style.BreakConstructorInitializers = FormatStyle::BCIS_AfterColon;
4512 FormatStyle Style = getLLVMStyle();
4564 FormatStyle Style = getLLVMStyle();
4565 Style.BreakConstructorInitializers = FormatStyle::BCIS_AfterColon;
4640 FormatStyle OnePerLine = Style;
4706 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None;
4717 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All;
4727 Style.BreakInheritanceList = FormatStyle::BILS_BeforeColon;
4733 Style.BreakInheritanceList = FormatStyle::BILS_BeforeComma;
4739 Style.BreakInheritanceList = FormatStyle::BILS_AfterColon;
4818 FormatStyle OnePerLine = getLLVMStyle();
4935 FormatStyle Style = getLLVMStyle();
4936 Style.PointerAlignment = FormatStyle::PAS_Left;
4983 FormatStyle Style = getGoogleStyle();
5029 Style.BreakBeforeBraces = FormatStyle::BS_Allman;
5036 Style.BreakBeforeBraces = FormatStyle::BS_Whitesmiths;
5186 FormatStyle NoBinPacking = getGoogleStyle();
5218 FormatStyle NoBinPacking = getGoogleStyle();
5283 FormatStyle Style = getLLVMStyleWithColumns(15);
5511 FormatStyle Style = getLLVMStyle();
5574 FormatStyle Style = getLLVMStyle();
5575 Style.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign;
5603 Style.AlignAfterOpenBracket = FormatStyle::BAS_AlwaysBreak;
5644 FormatStyle Style = getLLVMStyleWithColumns(40);
5648 Style.AlignAfterOpenBracket = FormatStyle::BAS_Align;
5653 Style.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign;
5658 Style.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign;
5756 FormatStyle NoBinPacking = getLLVMStyle();
5804 FormatStyle Style = getLLVMStyle();
5928 FormatStyle Style = getGoogleStyle();
5929 Style.PointerAlignment = FormatStyle::PAS_Left;
6009 FormatStyle Style = getLLVMStyle();
6011 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_None;
6023 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_All;
6042 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_TopLevelDefinitions;
6056 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_TopLevel;
6071 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_AllDefinitions;
6124 Style.BreakBeforeBraces = FormatStyle::BS_Stroustrup;
6199 FormatStyle NoBreak = getLLVMStyle();
6201 FormatStyle Break = getLLVMStyle();
6513 FormatStyle NoBinPacking = getLLVMStyle();
6602 FormatStyle AlwaysBreak = getLLVMStyle();
6603 AlwaysBreak.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_Yes;
6622 FormatStyle NeverBreak = getLLVMStyle();
6623 NeverBreak.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_No;
6653 FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp);
6653 FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp);
6704 FormatStyle Style = getLLVMStyle();
6705 Style.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign;
6706 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_None;
6713 Style.AlignAfterOpenBracket = FormatStyle::BAS_DontAlign;
6714 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All;
6721 Style.AlignAfterOpenBracket = FormatStyle::BAS_AlwaysBreak;
6722 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_None;
6731 Style.AlignAfterOpenBracket = FormatStyle::BAS_AlwaysBreak;
6732 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All;
6806 verifyFormat("A<A<int>> a;", getChromiumStyle(FormatStyle::LK_Cpp));
6812 FormatStyle Style = getLLVMStyle();
6885 FormatStyle Style = getLLVMStyle();
6886 Style.PointerAlignment = FormatStyle::PAS_Left;
7006 FormatStyle AlignLeft = getLLVMStyle();
7007 AlignLeft.PointerAlignment = FormatStyle::PAS_Left;
7021 FormatStyle Spaces = getLLVMStyle();
7036 FormatStyle BreakTemplate = getLLVMStyle();
7037 BreakTemplate.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_Yes;
7069 FormatStyle AlignLeftBreakTemplate = getLLVMStyle();
7071 FormatStyle::BTDS_Yes;
7072 AlignLeftBreakTemplate.PointerAlignment = FormatStyle::PAS_Left;
7246 FormatStyle Left = getLLVMStyle();
7247 Left.PointerAlignment = FormatStyle::PAS_Left;
7367 FormatStyle PointerMiddle = getLLVMStyle();
7368 PointerMiddle.PointerAlignment = FormatStyle::PAS_Middle;
7397 FormatStyle AfterType = getLLVMStyle();
7398 AfterType.AlwaysBreakAfterReturnType = FormatStyle::RTBS_AllDefinitions;
7429 FormatStyle MultiLineFunctions = getLLVMStyle();
7430 MultiLineFunctions.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None;
7442 FormatStyle PointersLeft = getLLVMStyle();
7443 PointersLeft.PointerAlignment = FormatStyle::PAS_Left;
7702 FormatStyle Indented = getLLVMStyle();
7808 FormatStyle NoColumnLimit = getLLVMStyleWithColumns(0);
7854 FormatStyle Style = getLLVMStyle();
7869 FormatStyle NoBinPacking = getLLVMStyle();
7950 FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp);
7950 FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp);
8066 FormatStyle AvoidBreakingFirstArgument = getLLVMStyle();
8100 FormatStyle NoBinPacking = getLLVMStyle();
8136 NoBinPacking.AlignAfterOpenBracket = FormatStyle::BAS_AlwaysBreak;
8185 FormatStyle ExtraSpaces = getLLVMStyle();
8257 FormatStyle SpaceBeforeBrace = getLLVMStyle();
8262 FormatStyle SpaceBetweenBraces = getLLVMStyle();
8447 FormatStyle DoNotMerge = getLLVMStyle();
8448 DoNotMerge.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None;
8493 FormatStyle NoColumnLimit = getLLVMStyle();
8505 FormatStyle DoNotMergeNoColumnLimit = NoColumnLimit;
8507 FormatStyle::SFS_None;
8538 FormatStyle MergeEmptyOnly = getLLVMStyle();
8539 MergeEmptyOnly.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty;
8557 MergeEmptyOnly.BreakBeforeBraces = FormatStyle::BS_Custom;
8567 FormatStyle MergeInlineOnly = getLLVMStyle();
8568 MergeInlineOnly.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
8586 MergeInlineOnly.BreakBeforeBraces = FormatStyle::BS_Custom;
8607 FormatStyle MergeInlineOnly = getLLVMStyle();
8609 FormatStyle::SFS_InlineOnly;
8629 MergeInlineOnly.BreakBeforeBraces = FormatStyle::BS_Custom;
8653 FormatStyle Style = getLLVMStyle();
8654 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None;
8655 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
8674 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty;
8685 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
8707 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All;
8720 FormatStyle Style = getLLVMStyle();
8721 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All;
8731 FormatStyle Style = getLLVMStyle();
8732 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
8757 FormatStyle Style = getLLVMStyle();
8758 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
8784 FormatStyle Style = getLLVMStyle();
8785 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
8807 FormatStyle Style = getLLVMStyle();
8808 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
8835 FormatStyle Style = getLLVMStyle();
8866 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
8993 FormatStyle AllowsMergedIf = getGoogleStyle();
8995 FormatStyle::SIS_WithoutElse;
9001 FormatStyle ShortMergedIf = AllowsMergedIf;
9139 FormatStyle Style = getLLVMStyle();
9318 FormatStyle Style = getLLVMStyleWithColumns(12);
9322 FormatStyle AlignLeft = getLLVMStyleWithColumns(12);
9323 AlignLeft.AlignEscapedNewlines = FormatStyle::ENAS_Left;
9338 FormatStyle NoEmptyLines = getLLVMStyleWithColumns(80);
9383 FormatStyle Style = getGoogleStyleWithColumns(15);
9393 FormatStyle Style = getLLVMStyleWithColumns(20);
9507 FormatStyle Style = getLLVMStyleWithColumns(25);
9508 Style.AlignAfterOpenBracket = FormatStyle::BAS_AlwaysBreak;
9587 FormatStyle Style = getLLVMStyle();
9588 Style.Standard = FormatStyle::LS_Cpp03;
9594 FormatStyle Style = getLLVMStyle();
9601 Style.Standard = FormatStyle::LS_Cpp17;
9713 FormatStyle EightIndent = getLLVMStyleWithColumns(18);
9741 FormatStyle Tab = getLLVMStyleWithColumns(42);
9743 Tab.UseTab = FormatStyle::UT_Always;
9744 Tab.AlignEscapedNewlines = FormatStyle::ENAS_Left;
9819 Tab.UseTab = FormatStyle::UT_ForIndentation;
9923 Tab.UseTab = FormatStyle::UT_Never;
9967 Tab.UseTab = FormatStyle::UT_ForContinuationAndIndentation;
10193 FormatStyle Tab = getLLVMStyleWithColumns(42);
10195 Tab.UseTab = FormatStyle::UT_Never;
10213 Tab.UseTab = FormatStyle::UT_ForIndentation;
10230 Tab.UseTab = FormatStyle::UT_ForContinuationAndIndentation;
10247 Tab.UseTab = FormatStyle::UT_Always;
10299 FormatStyle NoSpace = getLLVMStyle();
10300 NoSpace.SpaceBeforeParens = FormatStyle::SBPO_Never;
10335 FormatStyle Space = getLLVMStyle();
10336 Space.SpaceBeforeParens = FormatStyle::SBPO_Always;
10384 FormatStyle SomeSpace = getLLVMStyle();
10385 SomeSpace.SpaceBeforeParens = FormatStyle::SBPO_NonEmptyParentheses;
10439 FormatStyle Spaces = getLLVMStyle();
10450 FormatStyle Spaces = getLLVMStyle();
10560 FormatStyle Spaces = getLLVMStyle();
10582 FormatStyle Spaces = getLLVMStyle();
10603 FormatStyle CtorInitializerStyle = getLLVMStyleWithColumns(30);
10620 FormatStyle::BCIS_AfterColon;
10626 FormatStyle::BCIS_BeforeComma;
10632 FormatStyle::BCIS_BeforeColon;
10643 FormatStyle InheritanceStyle = getLLVMStyleWithColumns(30);
10659 InheritanceStyle.BreakInheritanceList = FormatStyle::BILS_AfterColon;
10665 InheritanceStyle.BreakInheritanceList = FormatStyle::BILS_BeforeComma;
10671 InheritanceStyle.BreakInheritanceList = FormatStyle::BILS_BeforeColon;
10683 FormatStyle ForLoopStyle = getLLVMStyle();
10700 FormatStyle NoSpaceStyle = getLLVMStyle();
10721 FormatStyle Style = getLLVMStyle();
10816 FormatStyle Alignment = getLLVMStyle();
10895 Alignment.AlignEscapedNewlines = FormatStyle::ENAS_DontAlign;
10902 Alignment.AlignEscapedNewlines = FormatStyle::ENAS_Left;
10909 Alignment.AlignEscapedNewlines = FormatStyle::ENAS_Right;
10952 Alignment.BreakBeforeBinaryOperators = FormatStyle::BOS_All;
10958 Alignment.BreakBeforeBinaryOperators = FormatStyle::BOS_None;
11006 FormatStyle Alignment = getLLVMStyle();
11177 Alignment.AlignEscapedNewlines = FormatStyle::ENAS_DontAlign;
11184 Alignment.AlignEscapedNewlines = FormatStyle::ENAS_Left;
11191 Alignment.AlignEscapedNewlines = FormatStyle::ENAS_Right;
11232 Alignment.BreakBeforeBinaryOperators = FormatStyle::BOS_All;
11238 Alignment.BreakBeforeBinaryOperators = FormatStyle::BOS_None;
11325 Alignment.PointerAlignment = FormatStyle::PAS_Middle;
11332 Alignment.PointerAlignment = FormatStyle::PAS_Right;
11343 FormatStyle Style = getMozillaStyle();
11351 FormatStyle LinuxBraceStyle = getLLVMStyle();
11352 LinuxBraceStyle.BreakBeforeBraces = FormatStyle::BS_Linux;
11392 FormatStyle MozillaBraceStyle = getLLVMStyle();
11393 MozillaBraceStyle.BreakBeforeBraces = FormatStyle::BS_Mozilla;
11437 FormatStyle StroustrupBraceStyle = getLLVMStyle();
11438 StroustrupBraceStyle.BreakBeforeBraces = FormatStyle::BS_Stroustrup;
11499 FormatStyle AllmanBraceStyle = getLLVMStyle();
11500 AllmanBraceStyle.BreakBeforeBraces = FormatStyle::BS_Allman;
11681 FormatStyle BreakBeforeBraceShortIfs = AllmanBraceStyle;
11683 FormatStyle::SIS_WithoutElse;
11735 FormatStyle WhitesmithsBraceStyle = getLLVMStyle();
11736 WhitesmithsBraceStyle.BreakBeforeBraces = FormatStyle::BS_Whitesmiths;
11740 FormatStyle::SFS_Empty;
11741 WhitesmithsBraceStyle.AllowShortLambdasOnASingleLine = FormatStyle::SLS_None;
11954 FormatStyle BreakBeforeBraceShortIfs = WhitesmithsBraceStyle;
11956 FormatStyle::SIS_Always;
11982 FormatStyle GNUBraceStyle = getLLVMStyle();
11983 GNUBraceStyle.BreakBeforeBraces = FormatStyle::BS_GNU;
12106 FormatStyle WebKitBraceStyle = getLLVMStyle();
12107 WebKitBraceStyle.BreakBeforeBraces = FormatStyle::BS_WebKit;
12170 FormatStyle Style = getLLVMStyle();
12301 SmallVector<FormatStyle, 3> Styles;
12314 Styles[0] = getGoogleStyle(FormatStyle::LK_JavaScript);
12321 Styles[0] = getChromiumStyle(FormatStyle::LK_Cpp);
12345 SmallVector<FormatStyle, 8> Styles;
12354 Styles[0] = getGoogleStyle(FormatStyle::LK_JavaScript);
12356 Styles[1].Language = FormatStyle::LK_JavaScript;
12360 Styles[2].Language = FormatStyle::LK_JavaScript;
12367 Styles[3].Language = FormatStyle::LK_JavaScript;
12374 Styles[4].Language = FormatStyle::LK_JavaScript;
12415 FormatStyle Style = {};
12416 Style.Language = FormatStyle::LK_Cpp;
12483 FormatStyle Style = {};
12484 Style.Language = FormatStyle::LK_Cpp;
12505 Style.PointerAlignment = FormatStyle::PAS_Middle;
12520 Style.Standard = FormatStyle::LS_Auto;
12534 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All;
12547 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeColon;
12558 Style.BreakInheritanceList = FormatStyle::BILS_BeforeColon;
12569 Style.AlignAfterOpenBracket = FormatStyle::BAS_AlwaysBreak;
12582 Style.AlignEscapedNewlines = FormatStyle::ENAS_Left;
12595 Style.UseTab = FormatStyle::UT_ForIndentation;
12605 Style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Empty;
12618 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
12633 Style.SpaceBeforeParens = FormatStyle::SBPO_Always;
12649 FormatStyle BaseStyle = getLLVMStyle();
12653 Style.BreakBeforeBraces = FormatStyle::BS_Stroustrup;
12672 Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Never;
12691 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_All;
12704 Style.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_Yes;
12716 Style.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_All;
12725 Style.NamespaceIndentation = FormatStyle::NI_All;
12733 Style.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Always;
12784 std::vector<FormatStyle::RawStringFormat> ExpectedRawStringFormats = {
12786 FormatStyle::LK_TextProto,
12793 FormatStyle::LK_Cpp,
12821 FormatStyle Style = {};
12822 Style.Language = FormatStyle::LK_Cpp;
12834 Style.Language = FormatStyle::LK_JavaScript;
12860 Style.Language = FormatStyle::LK_Cpp;
12879 Style.BreakBeforeBraces = FormatStyle::BS_Linux;
12923 FormatStyle Style = {};
12924 Style.Language = FormatStyle::LK_JavaScript;
12944 FormatStyle Style = getLLVMStyle();
12946 FormatStyle ParsedStyle = {};
12947 ParsedStyle.Language = FormatStyle::LK_Cpp;
13079 FormatStyle Style = getLLVMStyle();
13101 Style.AlignAfterOpenBracket = FormatStyle::BAS_AlwaysBreak;
13112 Style.BreakConstructorInitializers = FormatStyle::BCIS_AfterColon;
13120 FormatStyle Style = getLLVMStyle();
13121 Style.BreakConstructorInitializers = FormatStyle::BCIS_BeforeComma;
13151 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None;
13162 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All;
13202 FormatStyle Style = getWebKitStyle();
13611 auto Style = getGoogleStyle();
13719 FormatStyle DoNotMerge = getLLVMStyle();
13720 DoNotMerge.AllowShortLambdasOnASingleLine = FormatStyle::SLS_None;
13729 FormatStyle MergeEmptyOnly = getLLVMStyle();
13730 MergeEmptyOnly.AllowShortLambdasOnASingleLine = FormatStyle::SLS_Empty;
13743 FormatStyle MergeInline = getLLVMStyle();
13744 MergeInline.AllowShortLambdasOnASingleLine = FormatStyle::SLS_Inline;
13769 FormatStyle ShortBlocks = getLLVMStyle();
13770 ShortBlocks.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Always;
13863 FormatStyle FourIndent = getLLVMStyle();
13872 FormatStyle ZeroColumn = getLLVMStyle();
13928 ZeroColumn.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Always;
13931 ZeroColumn.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Never;
13998 FormatStyle TwoIndent = getLLVMStyleWithColumns(15);
14006 FormatStyle SixIndent = getLLVMStyleWithColumns(20);
14016 FormatStyle Style = getLLVMStyle();
14032 FormatStyle Spaces = getLLVMStyle();
14044 Spaces.Standard = FormatStyle::LS_Cpp03;
14051 Spaces.Standard = FormatStyle::LS_Cpp11;
14060 FormatStyle Style = getLLVMStyle();
14242 FormatStyle Style = getLLVMStyle();
14243 Style.Language = FormatStyle::LK_TableGen;
14251 FormatStyle Spaces = getLLVMStyle();
14261 FormatStyle Spaces = getLLVMStyle();
14379 format::FormatStyle Style = format::getLLVMStyle();
14408 format::FormatStyle Style = format::getLLVMStyle();
14427 format::FormatStyle Style = format::getLLVMStyle();
14428 Style.Standard = FormatStyle::LS_Cpp03;
14473 FormatStyle PointerMiddle = getLLVMStyle();
14474 PointerMiddle.PointerAlignment = FormatStyle::PAS_Middle;
14507 format::FormatStyle Spaces = format::getLLVMStyle();
14648 FormatStyle Google = getGoogleStyleWithColumns(0);
14656 FormatStyle Macros = getLLVMStyle();
14669 Macros.PointerAlignment = FormatStyle::PAS_Left;
14676 FormatStyle AlignStyle = getLLVMStyle();
14677 AlignStyle.PointerAlignment = FormatStyle::PAS_Left;
14679 AlignStyle.PointerAlignment = FormatStyle::PAS_Right;
tools/clang/unittests/Format/FormatTestCSharp.cpp 22 unsigned Length, const FormatStyle &Style) {
35 const FormatStyle &Style = getMicrosoftStyle(FormatStyle::LK_CSharp)) {
35 const FormatStyle &Style = getMicrosoftStyle(FormatStyle::LK_CSharp)) {
39 static FormatStyle getStyleWithColumns(unsigned ColumnLimit) {
40 FormatStyle Style = getMicrosoftStyle(FormatStyle::LK_CSharp);
40 FormatStyle Style = getMicrosoftStyle(FormatStyle::LK_CSharp);
47 const FormatStyle &Style = getMicrosoftStyle(FormatStyle::LK_CSharp)) {
47 const FormatStyle &Style = getMicrosoftStyle(FormatStyle::LK_CSharp)) {
150 FormatStyle Style = getGoogleStyle(FormatStyle::LK_CSharp);
150 FormatStyle Style = getGoogleStyle(FormatStyle::LK_CSharp);
151 Style.SpaceBeforeParens = FormatStyle::SBPO_Always;
168 Style.SpaceBeforeParens = FormatStyle::SBPO_Never;
234 FormatStyle Style = getGoogleStyle(FormatStyle::LK_CSharp);
234 FormatStyle Style = getGoogleStyle(FormatStyle::LK_CSharp);
235 Style.SpaceBeforeParens = FormatStyle::SBPO_Always;
244 Style.SpaceBeforeParens = FormatStyle::SBPO_Never;
270 FormatStyle Style = getMicrosoftStyle(FormatStyle::LK_CSharp);
270 FormatStyle Style = getMicrosoftStyle(FormatStyle::LK_CSharp);
271 Style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_None;
322 FormatStyle Style = getGoogleStyle(FormatStyle::LK_CSharp);
322 FormatStyle Style = getGoogleStyle(FormatStyle::LK_CSharp);
323 Style.SpaceBeforeParens = FormatStyle::SBPO_Always;
339 Style.SpaceBeforeParens = FormatStyle::SBPO_Never;
tools/clang/unittests/Format/FormatTestComments.cpp 27 FormatStyle getGoogleStyle() { return getGoogleStyle(FormatStyle::LK_Cpp); }
27 FormatStyle getGoogleStyle() { return getGoogleStyle(FormatStyle::LK_Cpp); }
38 const FormatStyle &Style = getLLVMStyle(),
58 FormatStyle getLLVMStyleWithColumns(unsigned ColumnLimit) {
59 FormatStyle Style = getLLVMStyle();
64 FormatStyle getTextProtoStyleWithColumns(unsigned ColumnLimit) {
65 FormatStyle Style = getGoogleStyle(FormatStyle::FormatStyle::LK_TextProto);
65 FormatStyle Style = getGoogleStyle(FormatStyle::FormatStyle::LK_TextProto);
65 FormatStyle Style = getGoogleStyle(FormatStyle::FormatStyle::LK_TextProto);
71 const FormatStyle &Style = getLLVMStyle()) {
82 const FormatStyle &Style = getLLVMStyle()) {
460 FormatStyle NoBinPacking = getLLVMStyle();
549 FormatStyle Style = getLLVMStyleWithColumns(20);
753 FormatStyle Pragmas = getLLVMStyleWithColumns(30);
2425 FormatStyle NoBinPacking = getLLVMStyle();
3114 FormatStyle Style = getGoogleStyle(FormatStyle::LK_Java);
3114 FormatStyle Style = getGoogleStyle(FormatStyle::LK_Java);
3116 FormatStyle Style20 = getGoogleStyle(FormatStyle::LK_Java);
3116 FormatStyle Style20 = getGoogleStyle(FormatStyle::LK_Java);
3193 FormatStyle JSStyle20 = getGoogleStyle(FormatStyle::LK_JavaScript);
3193 FormatStyle JSStyle20 = getGoogleStyle(FormatStyle::LK_JavaScript);
tools/clang/unittests/Format/FormatTestJS.cpp 22 unsigned Length, const FormatStyle &Style) {
38 const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_JavaScript)) {
38 const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_JavaScript)) {
42 static FormatStyle getGoogleJSStyleWithColumns(unsigned ColumnLimit) {
43 FormatStyle Style = getGoogleStyle(FormatStyle::LK_JavaScript);
43 FormatStyle Style = getGoogleStyle(FormatStyle::LK_JavaScript);
50 const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_JavaScript)) {
50 const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_JavaScript)) {
60 const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_JavaScript)) {
60 const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_JavaScript)) {
279 FormatStyle Style = getGoogleJSStyleWithColumns(80);
284 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_All;
554 getChromiumStyle(FormatStyle::LK_JavaScript));
640 FormatStyle NineCols = getGoogleJSStyleWithColumns(9);
848 FormatStyle Style = getGoogleStyle(FormatStyle::LK_JavaScript);
848 FormatStyle Style = getGoogleStyle(FormatStyle::LK_JavaScript);
849 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
962 FormatStyle Style = getGoogleStyle(FormatStyle::LK_JavaScript);
962 FormatStyle Style = getGoogleStyle(FormatStyle::LK_JavaScript);
963 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
978 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All;
989 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_None;
1011 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Empty;
1019 FormatStyle Style = getGoogleStyle(FormatStyle::LK_JavaScript);
1019 FormatStyle Style = getGoogleStyle(FormatStyle::LK_JavaScript);
1020 Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All;
1569 const FormatStyle &Style = getGoogleJSStyleWithColumns(22);
1666 const FormatStyle &Style = getGoogleJSStyleWithColumns(20);
1776 FormatStyle Style = getGoogleJSStyleWithColumns(80);
2180 FormatStyle DoubleQuotes = getGoogleStyle(FormatStyle::LK_JavaScript);
2180 FormatStyle DoubleQuotes = getGoogleStyle(FormatStyle::LK_JavaScript);
2181 DoubleQuotes.JavaScriptQuotes = FormatStyle::JSQS_Double;
2188 FormatStyle LeaveQuotes = getGoogleStyle(FormatStyle::LK_JavaScript);
2188 FormatStyle LeaveQuotes = getGoogleStyle(FormatStyle::LK_JavaScript);
2189 LeaveQuotes.JavaScriptQuotes = FormatStyle::JSQS_Leave;
2247 FormatStyle FourSpaces = getGoogleJSStyleWithColumns(15);
tools/clang/unittests/Format/FormatTestJava.cpp 22 unsigned Length, const FormatStyle &Style) {
35 const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_Java)) {
35 const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_Java)) {
39 static FormatStyle getStyleWithColumns(unsigned ColumnLimit) {
40 FormatStyle Style = getGoogleStyle(FormatStyle::LK_Java);
40 FormatStyle Style = getGoogleStyle(FormatStyle::LK_Java);
47 const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_Java)) {
47 const FormatStyle &Style = getGoogleStyle(FormatStyle::LK_Java)) {
62 FormatStyle Style = getStyleWithColumns(50);
66 Style.BreakBeforeBinaryOperators = FormatStyle::BOS_None;
86 getChromiumStyle(FormatStyle::LK_Java));
256 FormatStyle Style = getStyleWithColumns(65);
302 getChromiumStyle(FormatStyle::LK_Java));
tools/clang/unittests/Format/FormatTestObjC.cpp 31 Style.Language = FormatStyle::LK_ObjC;
68 FormatStyle Style;
209 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
210 Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always;
239 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
240 Style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Always;
365 Style.ObjCBinPackProtocolList = FormatStyle::BPS_Never;
374 Style.ObjCBinPackProtocolList = FormatStyle::BPS_Auto;
381 Style.ObjCBinPackProtocolList = FormatStyle::BPS_Always;
387 Style = getGoogleStyle(FormatStyle::LK_ObjC);
481 Style = getGoogleStyle(FormatStyle::LK_ObjC);
537 Style = getGoogleStyle(FormatStyle::LK_ObjC);
584 Style = getGoogleStyle(FormatStyle::LK_ObjC);
607 Style = getGoogleStyle(FormatStyle::LK_ObjC);
608 Style.BreakBeforeBraces = FormatStyle::BS_Custom;
926 Style = getChromiumStyle(FormatStyle::LK_ObjC);
941 Style.Language = FormatStyle::LK_ObjC;
1042 Style = getGoogleStyle(FormatStyle::LK_ObjC);
1241 Style = getGoogleStyle(FormatStyle::LK_ObjC);
1330 Style = getGoogleStyle(FormatStyle::LK_ObjC);
tools/clang/unittests/Format/FormatTestProto.cpp 22 unsigned Length, const FormatStyle &Style) {
34 FormatStyle Style = getGoogleStyle(FormatStyle::LK_Proto);
34 FormatStyle Style = getGoogleStyle(FormatStyle::LK_Proto);
512 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
512 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
tools/clang/unittests/Format/FormatTestRawStrings.cpp 33 const FormatStyle &Style = getLLVMStyle(),
53 FormatStyle getStyleWithColumns(FormatStyle Style, unsigned ColumnLimit) {
53 FormatStyle getStyleWithColumns(FormatStyle Style, unsigned ColumnLimit) {
58 FormatStyle getLLVMStyleWithColumns(unsigned ColumnLimit) {
64 FormatStyle getRawStringPbStyleWithColumns(unsigned ColumnLimit) {
65 FormatStyle Style = getLLVMStyle();
69 /*Language=*/FormatStyle::LK_TextProto,
79 FormatStyle getRawStringLLVMCppStyleBasedOn(std::string BasedOnStyle) {
80 FormatStyle Style = getLLVMStyle();
83 /*Language=*/FormatStyle::LK_Cpp,
93 FormatStyle getRawStringGoogleCppStyleBasedOn(std::string BasedOnStyle) {
94 FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp);
94 FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp);
97 /*Language=*/FormatStyle::LK_Cpp,
140 FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp);
140 FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp);
145 FormatStyle::LK_Cpp,
772 FormatStyle Style = getRawStringPbStyleWithColumns(40);
795 FormatStyle Style = getRawStringPbStyleWithColumns(25);
807 FormatStyle Style = getRawStringPbStyleWithColumns(60);
835 FormatStyle Style = getRawStringPbStyleWithColumns(80);
870 FormatStyle Style = getRawStringPbStyleWithColumns(60);
897 FormatStyle Style = getRawStringPbStyleWithColumns(60);
985 FormatStyle Style = getRawStringPbStyleWithColumns(60);
tools/clang/unittests/Format/FormatTestSelective.cpp 36 FormatStyle Style = getLLVMStyle();
101 Style.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_WithoutElse;
393 Style.AlignEscapedNewlines = FormatStyle::ENAS_Left;
534 Style.UseTab = FormatStyle::UT_Always;
535 Style.AlignEscapedNewlines = FormatStyle::ENAS_Left;
587 Style = getGoogleStyle(FormatStyle::LK_JavaScript);
tools/clang/unittests/Format/FormatTestTableGen.cpp 22 unsigned Length, const FormatStyle &Style) {
34 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TableGen);
34 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TableGen);
tools/clang/unittests/Format/FormatTestTextProto.cpp 22 unsigned Length, const FormatStyle &Style) {
33 static std::string format(llvm::StringRef Code, const FormatStyle &Style) {
37 static void verifyFormat(llvm::StringRef Code, const FormatStyle &Style) {
43 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
43 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
151 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
151 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
384 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
384 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
522 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
522 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
547 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
547 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
562 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
562 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
573 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
573 FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
tools/clang/unittests/Format/NamespaceEndCommentsFixerTest.cpp 26 const FormatStyle &Style = getLLVMStyle()) {
39 const FormatStyle &Style = getLLVMStyle()) {
227 FormatStyle CompactNamespacesStyle = getLLVMStyle();
291 FormatStyle Style = getLLVMStyle();
503 FormatStyle Style = getLLVMStyle();
595 FormatStyle CompactNamespacesStyle = getLLVMStyle();
617 FormatStyle Style = getLLVMStyle();
683 FormatStyle CompactNamespacesStyle = getLLVMStyle();
750 FormatStyle Style = getLLVMStyle();
tools/clang/unittests/Format/SortImportsTestJS.cpp 44 FormatStyle Style = getGoogleStyle(FormatStyle::LK_JavaScript);
44 FormatStyle Style = getGoogleStyle(FormatStyle::LK_JavaScript);
tools/clang/unittests/Format/SortImportsTestJava.cpp 29 FormatStyle FmtStyle;
33 FmtStyle = getGoogleStyle(FormatStyle::LK_Java);
tools/clang/unittests/Format/SortIncludesTest.cpp 52 FormatStyle FmtStyle = getLLVMStyle();
353 FmtStyle = getGoogleStyle(FormatStyle::LK_Cpp);
737 FmtStyle = getGoogleStyle(FormatStyle::LK_ObjC);
tools/clang/unittests/Format/UsingDeclarationsSorterTest.cpp 24 const FormatStyle &Style = getLLVMStyle()) {
36 const FormatStyle &Style = getLLVMStyle()) {
tools/clang/unittests/Tooling/HeaderIncludesTest.cpp 102 Style = format::getGoogleStyle(format::FormatStyle::LanguageKind::LK_Cpp)
126 Style = format::getGoogleStyle(format::FormatStyle::LanguageKind::LK_Cpp)
207 Style = format::getGoogleStyle(format::FormatStyle::LanguageKind::LK_Cpp)
485 Style = format::getGoogleStyle(format::FormatStyle::LanguageKind::LK_Cpp)
tools/clang/unittests/Tooling/TransformerTest.cpp 53 auto Style = format::getLLVMStyle();
usr/include/c++/7.4.0/bits/alloc_traits.h 387 using allocator_type = allocator<_Tp>;
389 using value_type = _Tp;
392 using pointer = _Tp*;
395 using const_pointer = const _Tp*;
474 construct(allocator_type& __a, _Up* __p, _Args&&... __args)
474 construct(allocator_type& __a, _Up* __p, _Args&&... __args)
486 destroy(allocator_type& __a, _Up* __p)
usr/include/c++/7.4.0/bits/allocator.h 108 class allocator: public __allocator_base<_Tp>
113 typedef _Tp* pointer;
114 typedef const _Tp* const_pointer;
115 typedef _Tp& reference;
116 typedef const _Tp& const_reference;
117 typedef _Tp value_type;
137 allocator(const allocator<_Tp1>&) throw() { }
usr/include/c++/7.4.0/bits/cpp_type_traits.h 329 : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
329 : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
337 : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
337 : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
usr/include/c++/7.4.0/bits/move.h 46 inline _GLIBCXX_CONSTEXPR _Tp*
47 __addressof(_Tp& __r) _GLIBCXX_NOEXCEPT
72 constexpr _Tp&&
73 forward(typename std::remove_reference<_Tp>::type& __t) noexcept
83 constexpr _Tp&&
84 forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
98 move(_Tp&& __t) noexcept
104 : public __and_<__not_<is_nothrow_move_constructible<_Tp>>,
105 is_copy_constructible<_Tp>>::type { };
136 inline _GLIBCXX17_CONSTEXPR _Tp*
137 addressof(_Tp& __r) noexcept
143 const _Tp* addressof(const _Tp&&) = delete;
143 const _Tp* addressof(const _Tp&&) = delete;
usr/include/c++/7.4.0/bits/ptr_traits.h 126 typedef _Tp* pointer;
128 typedef _Tp element_type;
141 pointer_to(__make_not_void<element_type>& __r) noexcept
141 pointer_to(__make_not_void<element_type>& __r) noexcept
usr/include/c++/7.4.0/bits/shared_ptr.h 343 _Args&&... __args)
688 allocate_shared(const _Alloc& __a, _Args&&... __args)
703 make_shared(_Args&&... __args)
usr/include/c++/7.4.0/bits/shared_ptr_base.h 1317 _Args&&... __args)
usr/include/c++/7.4.0/bits/stl_algobase.h 680 __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, void>::__type
682 const _Tp& __value)
724 fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
usr/include/c++/7.4.0/bits/stl_construct.h 74 _Construct(_T1* __p, _Args&&... __args)
74 _Construct(_T1* __p, _Args&&... __args)
75 { ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); }
75 { ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); }
97 _Destroy(_Tp* __pointer)
204 allocator<_Tp>&)
usr/include/c++/7.4.0/bits/stl_iterator.h 1224 __make_move_if_noexcept_iterator(_Tp* __i)
usr/include/c++/7.4.0/bits/stl_iterator_base_types.h 181 typedef _Tp value_type;
183 typedef _Tp* pointer;
184 typedef _Tp& reference;
192 typedef _Tp value_type;
194 typedef const _Tp* pointer;
195 typedef const _Tp& reference;
usr/include/c++/7.4.0/bits/stl_map.h 103 typedef _Tp mapped_type;
104 typedef std::pair<const _Key, _Tp> value_type;
usr/include/c++/7.4.0/bits/stl_pair.h 101 is_constructible<_T2, const _U2&>>::value;
101 is_constructible<_T2, const _U2&>>::value;
108 is_convertible<const _U2&, _T2>>::value;
108 is_convertible<const _U2&, _T2>>::value;
115 is_constructible<_T2, _U2&&>>::value;
115 is_constructible<_T2, _U2&&>>::value;
122 is_convertible<_U2&&, _T2>>::value;
122 is_convertible<_U2&&, _T2>>::value;
129 is_convertible<_U2&&, _T2>>;
129 is_convertible<_U2&&, _T2>>;
134 is_constructible<_T2, _U2&&>,
134 is_constructible<_T2, _U2&&>,
143 is_convertible<const _U2&, _T2>>;
143 is_convertible<const _U2&, _T2>>;
148 is_constructible<_T2, const _U2&&>,
148 is_constructible<_T2, const _U2&&>,
209 : private __pair_base<_T1, _T2>
212 typedef _T2 second_type; /// @c second_type is the second bound type
215 _T2 second; /// @c second is a copy of the second object
252 using _PCCP = _PCC<true, _T1, _T2>;
260 constexpr pair(const _T1& __a, const _T2& __b)
269 explicit constexpr pair(const _T1& __a, const _T2& __b)
283 _T1, _T2>;
311 constexpr pair(_U1&& __x, const _T2& __y)
318 explicit constexpr pair(_U1&& __x, const _T2& __y)
325 constexpr pair(const _T1& __x, _U2&& __y)
341 constexpr pair(_U1&& __x, _U2&& __y)
380 is_copy_assignable<_T2>>::value,
391 is_move_assignable<_T2>>::value,
usr/include/c++/7.4.0/bits/stl_uninitialized.h 204 const _Tp& __x)
244 uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
288 _ForwardIterator __result, allocator<_Tp>&)
344 const _Tp& __x, _Allocator& __alloc)
365 const _Tp& __x, allocator<_Tp2>&)
365 const _Tp& __x, allocator<_Tp2>&)
usr/include/c++/7.4.0/bits/stl_vector.h 77 rebind<_Tp>::other _Tp_alloc_type;
216 class vector : protected _Vector_base<_Tp, _Alloc>
227 typedef _Vector_base<_Tp, _Alloc> _Base;
232 typedef _Tp value_type;
919 _Tp*
923 const _Tp*
1455 _Temporary_value(vector* __vec, _Args&&... __args) : _M_this(__vec)
1472 typename aligned_storage<sizeof(_Tp), alignof(_Tp)>::type __buf;
1472 typename aligned_storage<sizeof(_Tp), alignof(_Tp)>::type __buf;
usr/include/c++/7.4.0/bits/unique_ptr.h 824 make_unique(_Args&&... __args)
usr/include/c++/7.4.0/ext/alloc_traits.h 117 { typedef typename _Base_type::template rebind_alloc<_Tp> other; };
usr/include/c++/7.4.0/ext/new_allocator.h 63 typedef _Tp* pointer;
64 typedef const _Tp* const_pointer;
65 typedef _Tp& reference;
66 typedef const _Tp& const_reference;
67 typedef _Tp value_type;
111 return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
130 { return size_t(-1) / sizeof(_Tp); }
135 construct(_Up* __p, _Args&&... __args)
135 construct(_Up* __p, _Args&&... __args)
136 { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
140 destroy(_Up* __p) { __p->~_Up(); }
usr/include/c++/7.4.0/type_traits 215 : public __is_void_helper<typename remove_cv<_Tp>::type>::type
326 : public __is_integral_helper<typename remove_cv<_Tp>::type>::type
354 : public __is_floating_point_helper<typename remove_cv<_Tp>::type>::type
381 : public __is_pointer_helper<typename remove_cv<_Tp>::type>::type
567 : public __is_null_pointer_helper<typename remove_cv<_Tp>::type>::type
581 : public __or_<is_lvalue_reference<_Tp>,
582 is_rvalue_reference<_Tp>>::type
588 : public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
588 : public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
594 : public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
594 : public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
595 is_null_pointer<_Tp>>::type
601 : public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
601 : public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
602 is_void<_Tp>>>::type
611 : public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
611 : public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
611 : public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
612 is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type
612 is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type
631 : public __is_member_pointer_helper<typename remove_cv<_Tp>::type>::type
638 : public __or_<is_object<_Tp>, is_reference<_Tp>>::type
638 : public __or_<is_object<_Tp>, is_reference<_Tp>>::type
762 typename add_rvalue_reference<_Tp>::type declval() noexcept;
777 : public __and_<is_array<_Tp>, __not_<extent<_Tp>>>
777 : public __and_<is_array<_Tp>, __not_<extent<_Tp>>>
798 typedef decltype(__test<_Tp>(0)) type;
811 remove_all_extents<_Tp>::type>::type
825 : public __is_destructible_safe<_Tp>::type
984 typedef decltype(__test<_Tp, _Arg>(0)) type;
989 : public __and_<is_destructible<_Tp>,
990 __is_direct_constructible_impl<_Tp, _Arg>>
1072 __is_direct_constructible_ref_cast<_Tp, _Arg>,
1073 __is_direct_constructible_new_safe<_Tp, _Arg>
1079 : public __is_direct_constructible_new<_Tp, _Arg>::type
1119 : public __is_direct_constructible<_Tp, _Arg>
1130 : public __is_constructible_impl<_Tp, _Args...>::type
1142 : public is_constructible<_Tp, const _Tp&>
1142 : public is_constructible<_Tp, const _Tp&>
1148 : public __is_copy_constructible_impl<_Tp>
1160 : public is_constructible<_Tp, _Tp&&>
1160 : public is_constructible<_Tp, _Tp&&>
1166 : public __is_move_constructible_impl<_Tp>
1215 : public __and_<is_constructible<_Tp, _Args...>,
1216 __is_nt_constructible_impl<_Tp, _Args...>>
1246 : public is_nothrow_constructible<_Tp, _Tp&&>
1246 : public is_nothrow_constructible<_Tp, _Tp&&>
1252 : public __is_nothrow_move_constructible_impl<_Tp>
1286 : public is_assignable<_Tp&, const _Tp&>
1286 : public is_assignable<_Tp&, const _Tp&>
1292 : public __is_copy_assignable_impl<_Tp>
1304 : public is_assignable<_Tp&, _Tp&&>
1304 : public is_assignable<_Tp&, _Tp&&>
1310 : public __is_move_assignable_impl<_Tp>
1526 static void __test_aux(_To1);
1538 typedef decltype(__test<_From, _To>(0)) type;
1538 typedef decltype(__test<_From, _To>(0)) type;
1545 : public __is_convertible_helper<_From, _To>::type
1545 : public __is_convertible_helper<_From, _To>::type
1554 { typedef _Tp type; };
1563 { typedef _Tp type; };
1574 remove_const<typename remove_volatile<_Tp>::type>::type type;
1629 { typedef _Tp type; };
1633 { typedef _Tp type; };
1659 { typedef _Tp&& type; };
1664 : public __add_rvalue_reference_helper<_Tp>
1955 { typedef _Tp type; };
2171 { typedef _Iffalse type; };
utils/unittest/googletest/include/gtest/gtest-printers.h 140 static void PrintValue(const T& value, ::std::ostream* os) {
205 ::std::basic_ostream<Char, CharTraits>& os, const T& x) {
206 TypeWithoutFormatter<T,
207 (internal::IsAProtocolMessage<T>::value ? kProtobuf :
208 internal::ImplicitlyConvertible<const T&, internal::BiggestInt>::value ?
223 void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
276 static ::std::string Format(const ToPrint& value) {
351 const T1& value, const T2& /* other_operand */) {
351 const T1& value, const T2& /* other_operand */) {
352 return FormatForComparison<T1, T2>::Format(value);
352 return FormatForComparison<T1, T2>::Format(value);
366 void UniversalPrint(const T& value, ::std::ostream* os);
373 const C& container, ::std::ostream* os) {
439 const T& value, ::std::ostream* os) {
455 void PrintTo(const T& value, ::std::ostream* os) {
478 DefaultPrintTo(IsContainerTest<T>(0), is_pointer<T>(), value, os);
699 static void Print(const T& value, ::std::ostream* os) {
784 static void Print(const T& value, ::std::ostream* os) {
856 typedef T T1;
983 internal::UniversalTersePrinter<T>::Print(value, &ss);
utils/unittest/googletest/include/gtest/gtest.h 1377 const T1& lhs, const T2& rhs) {
1377 const T1& lhs, const T2& rhs) {
1389 const T1& lhs,
1390 const T2& rhs) {
1419 const T1& lhs,
1420 const T2& rhs) {
utils/unittest/googletest/include/gtest/internal/custom/raw-ostream.h 29 static const T& printable(const T& V) { return V; }
29 static const T& printable(const T& V) { return V; }
35 auto printable(const T &V) -> decltype(StreamSwitch<T>::printable(V)) {
35 auto printable(const T &V) -> decltype(StreamSwitch<T>::printable(V)) {
37 return StreamSwitch<T>::printable(V);
utils/unittest/googletest/include/gtest/internal/gtest-internal.h 94 ::std::string PrintToString(const T& value);