Skip to content

Commit f79bc69

Browse files
committed
[llvm] clang-format changes to Option and Remarks libraries
1 parent b148622 commit f79bc69

File tree

11 files changed

+41
-34
lines changed

11 files changed

+41
-34
lines changed

llvm/include/llvm/Option/Arg.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
#ifndef LLVM_OPTION_ARG_H
1515
#define LLVM_OPTION_ARG_H
1616

17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/ADT/SmallVector.h"
1918
#include "llvm/ADT/StringRef.h"
2019
#include "llvm/Option/Option.h"
20+
#include "llvm/Support/Compiler.h"
2121
#include <string>
2222

2323
namespace llvm {
@@ -72,11 +72,12 @@ class Arg {
7272

7373
public:
7474
LLVM_ABI Arg(const Option Opt, StringRef Spelling, unsigned Index,
75-
const Arg *BaseArg = nullptr);
75+
const Arg *BaseArg = nullptr);
7676
LLVM_ABI Arg(const Option Opt, StringRef Spelling, unsigned Index,
77-
const char *Value0, const Arg *BaseArg = nullptr);
77+
const char *Value0, const Arg *BaseArg = nullptr);
7878
LLVM_ABI Arg(const Option Opt, StringRef Spelling, unsigned Index,
79-
const char *Value0, const char *Value1, const Arg *BaseArg = nullptr);
79+
const char *Value0, const char *Value1,
80+
const Arg *BaseArg = nullptr);
8081
Arg(const Arg &) = delete;
8182
Arg &operator=(const Arg &) = delete;
8283
LLVM_ABI ~Arg();

llvm/include/llvm/Option/ArgList.h

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
#ifndef LLVM_OPTION_ARGLIST_H
1010
#define LLVM_OPTION_ARGLIST_H
1111

12-
#include "llvm/Support/Compiler.h"
1312
#include "llvm/ADT/ArrayRef.h"
1413
#include "llvm/ADT/DenseMap.h"
15-
#include "llvm/ADT/iterator_range.h"
1614
#include "llvm/ADT/SmallString.h"
1715
#include "llvm/ADT/SmallVector.h"
1816
#include "llvm/ADT/StringRef.h"
1917
#include "llvm/ADT/Twine.h"
18+
#include "llvm/ADT/iterator_range.h"
2019
#include "llvm/Option/Arg.h"
2120
#include "llvm/Option/OptSpecifier.h"
2221
#include "llvm/Option/Option.h"
22+
#include "llvm/Support/Compiler.h"
2323
#include <algorithm>
2424
#include <cstddef>
2525
#include <initializer_list>
@@ -285,7 +285,8 @@ class ArgList {
285285
/// @{
286286

287287
/// getLastArgValue - Return the value of the last argument, or a default.
288-
LLVM_ABI StringRef getLastArgValue(OptSpecifier Id, StringRef Default = "") const;
288+
LLVM_ABI StringRef getLastArgValue(OptSpecifier Id,
289+
StringRef Default = "") const;
289290

290291
/// getAllArgValues - Get the values of all instances of the given argument
291292
/// as strings.
@@ -300,19 +301,20 @@ class ArgList {
300301
/// \p Default if neither option is given. If both the option and its
301302
/// negation are present, the last one wins.
302303
LLVM_ABI bool hasFlag(OptSpecifier Pos, OptSpecifier Neg, bool Default) const;
303-
LLVM_ABI bool hasFlagNoClaim(OptSpecifier Pos, OptSpecifier Neg, bool Default) const;
304+
LLVM_ABI bool hasFlagNoClaim(OptSpecifier Pos, OptSpecifier Neg,
305+
bool Default) const;
304306

305307
/// hasFlag - Given an option \p Pos, an alias \p PosAlias and its negative
306308
/// form \p Neg, return true if the option or its alias is present, false if
307309
/// the negation is present, and \p Default if none of the options are
308310
/// given. If multiple options are present, the last one wins.
309-
LLVM_ABI bool hasFlag(OptSpecifier Pos, OptSpecifier PosAlias, OptSpecifier Neg,
310-
bool Default) const;
311+
LLVM_ABI bool hasFlag(OptSpecifier Pos, OptSpecifier PosAlias,
312+
OptSpecifier Neg, bool Default) const;
311313

312314
/// Given an option Pos and its negative form Neg, render the option if Pos is
313315
/// present.
314316
LLVM_ABI void addOptInFlag(ArgStringList &Output, OptSpecifier Pos,
315-
OptSpecifier Neg) const;
317+
OptSpecifier Neg) const;
316318
/// Render the option if Neg is present.
317319
void addOptOutFlag(ArgStringList &Output, OptSpecifier Pos,
318320
OptSpecifier Neg) const {
@@ -332,18 +334,21 @@ class ArgList {
332334

333335
/// AddAllArgsExcept - Render all arguments matching any of the given ids
334336
/// and not matching any of the excluded ids.
335-
LLVM_ABI void AddAllArgsExcept(ArgStringList &Output, ArrayRef<OptSpecifier> Ids,
336-
ArrayRef<OptSpecifier> ExcludeIds) const;
337+
LLVM_ABI void AddAllArgsExcept(ArgStringList &Output,
338+
ArrayRef<OptSpecifier> Ids,
339+
ArrayRef<OptSpecifier> ExcludeIds) const;
337340
/// Render all arguments matching any of the given ids.
338-
LLVM_ABI void addAllArgs(ArgStringList &Output, ArrayRef<OptSpecifier> Ids) const;
341+
LLVM_ABI void addAllArgs(ArgStringList &Output,
342+
ArrayRef<OptSpecifier> Ids) const;
339343

340344
/// AddAllArgs - Render all arguments matching the given ids.
341345
LLVM_ABI void AddAllArgs(ArgStringList &Output, OptSpecifier Id0) const;
342346

343347
/// AddAllArgValues - Render the argument values of all arguments
344348
/// matching the given ids.
345349
LLVM_ABI void AddAllArgValues(ArgStringList &Output, OptSpecifier Id0,
346-
OptSpecifier Id1 = 0U, OptSpecifier Id2 = 0U) const;
350+
OptSpecifier Id1 = 0U,
351+
OptSpecifier Id2 = 0U) const;
347352

348353
/// AddAllArgsTranslated - Render all the arguments matching the
349354
/// given ids, but forced to separate args and using the provided
@@ -352,8 +357,8 @@ class ArgList {
352357
/// \param Joined - If true, render the argument as joined with
353358
/// the option specifier.
354359
LLVM_ABI void AddAllArgsTranslated(ArgStringList &Output, OptSpecifier Id0,
355-
const char *Translation,
356-
bool Joined = false) const;
360+
const char *Translation,
361+
bool Joined = false) const;
357362

358363
/// ClaimAllArgs - Claim all arguments which match the given
359364
/// option id.
@@ -383,7 +388,7 @@ class ArgList {
383388
/// Create an arg string for (\p LHS + \p RHS), reusing the
384389
/// string at \p Index if possible.
385390
LLVM_ABI const char *GetOrMakeJoinedArgString(unsigned Index, StringRef LHS,
386-
StringRef RHS) const;
391+
StringRef RHS) const;
387392

388393
LLVM_ABI void print(raw_ostream &O) const;
389394
LLVM_ABI void dump() const;

llvm/include/llvm/Option/OptTable.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
#ifndef LLVM_OPTION_OPTTABLE_H
1010
#define LLVM_OPTION_OPTTABLE_H
1111

12-
#include "llvm/Support/Compiler.h"
1312
#include "llvm/ADT/ArrayRef.h"
1413
#include "llvm/ADT/SmallString.h"
1514
#include "llvm/ADT/StringRef.h"
1615
#include "llvm/ADT/StringTable.h"
1716
#include "llvm/Option/OptSpecifier.h"
17+
#include "llvm/Support/Compiler.h"
1818
#include "llvm/Support/StringSaver.h"
1919
#include <cassert>
2020
#include <string>
@@ -427,8 +427,8 @@ class LLVM_ABI OptTable {
427427
class GenericOptTable : public OptTable {
428428
protected:
429429
LLVM_ABI GenericOptTable(const StringTable &StrTable,
430-
ArrayRef<StringTable::Offset> PrefixesTable,
431-
ArrayRef<Info> OptionInfos, bool IgnoreCase = false);
430+
ArrayRef<StringTable::Offset> PrefixesTable,
431+
ArrayRef<Info> OptionInfos, bool IgnoreCase = false);
432432
};
433433

434434
class PrecomputedOptTable : public OptTable {

llvm/include/llvm/Option/Option.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
#ifndef LLVM_OPTION_OPTION_H
1010
#define LLVM_OPTION_OPTION_H
1111

12-
#include "llvm/Support/Compiler.h"
1312
#include "llvm/ADT/SmallVector.h"
1413
#include "llvm/ADT/StringRef.h"
1514
#include "llvm/Option/OptSpecifier.h"
1615
#include "llvm/Option/OptTable.h"
16+
#include "llvm/Support/Compiler.h"
1717
#include "llvm/Support/ErrorHandling.h"
1818
#include <cassert>
1919

@@ -229,7 +229,8 @@ class Option {
229229
/// \p GroupedShortOption If true, we are handling the fallback case of
230230
/// parsing a prefix of the current argument as a short option.
231231
LLVM_ABI std::unique_ptr<Arg> accept(const ArgList &Args, StringRef CurArg,
232-
bool GroupedShortOption, unsigned &Index) const;
232+
bool GroupedShortOption,
233+
unsigned &Index) const;
233234

234235
private:
235236
std::unique_ptr<Arg> acceptInternal(const ArgList &Args, StringRef CurArg,

llvm/include/llvm/Remarks/Remark.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
#ifndef LLVM_REMARKS_REMARK_H
1414
#define LLVM_REMARKS_REMARK_H
1515

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm-c/Remarks.h"
1817
#include "llvm/ADT/SmallVector.h"
1918
#include "llvm/ADT/StringRef.h"
2019
#include "llvm/Support/CBindingWrapping.h"
20+
#include "llvm/Support/Compiler.h"
2121
#include "llvm/Support/raw_ostream.h"
2222
#include <optional>
2323
#include <string>

llvm/include/llvm/Remarks/RemarkFormat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#ifndef LLVM_REMARKS_REMARKFORMAT_H
1414
#define LLVM_REMARKS_REMARKFORMAT_H
1515

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/ADT/StringRef.h"
17+
#include "llvm/Support/Compiler.h"
1818
#include "llvm/Support/Error.h"
1919

2020
namespace llvm {

llvm/include/llvm/Remarks/RemarkLinker.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
#ifndef LLVM_REMARKS_REMARKLINKER_H
1414
#define LLVM_REMARKS_REMARKLINKER_H
1515

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/Remarks/Remark.h"
1817
#include "llvm/Remarks/RemarkFormat.h"
1918
#include "llvm/Remarks/RemarkStringTable.h"
19+
#include "llvm/Support/Compiler.h"
2020
#include "llvm/Support/Error.h"
2121
#include <memory>
2222
#include <optional>
@@ -81,12 +81,12 @@ struct RemarkLinker {
8181
/// \p Buffer can be either a standalone remark container or just
8282
/// metadata. This takes care of uniquing and merging the remarks.
8383
LLVM_ABI Error link(StringRef Buffer,
84-
std::optional<Format> RemarkFormat = std::nullopt);
84+
std::optional<Format> RemarkFormat = std::nullopt);
8585

8686
/// Link the remarks found in \p Obj by looking for the right section and
8787
/// calling the method above.
8888
LLVM_ABI Error link(const object::ObjectFile &Obj,
89-
std::optional<Format> RemarkFormat = std::nullopt);
89+
std::optional<Format> RemarkFormat = std::nullopt);
9090

9191
/// Serialize the linked remarks to the stream \p OS, using the format \p
9292
/// RemarkFormat.

llvm/include/llvm/Remarks/RemarkParser.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#ifndef LLVM_REMARKS_REMARKPARSER_H
1414
#define LLVM_REMARKS_REMARKPARSER_H
1515

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/ADT/StringRef.h"
1817
#include "llvm/Remarks/RemarkFormat.h"
18+
#include "llvm/Support/Compiler.h"
1919
#include "llvm/Support/Error.h"
2020
#include <memory>
2121
#include <optional>
@@ -77,8 +77,8 @@ struct ParsedStringTable {
7777
LLVM_ABI Expected<StringRef> operator[](size_t Index) const;
7878
};
7979

80-
LLVM_ABI Expected<std::unique_ptr<RemarkParser>> createRemarkParser(Format ParserFormat,
81-
StringRef Buf);
80+
LLVM_ABI Expected<std::unique_ptr<RemarkParser>>
81+
createRemarkParser(Format ParserFormat, StringRef Buf);
8282

8383
LLVM_ABI Expected<std::unique_ptr<RemarkParser>>
8484
createRemarkParser(Format ParserFormat, StringRef Buf,

llvm/include/llvm/Remarks/RemarkSerializer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
#ifndef LLVM_REMARKS_REMARKSERIALIZER_H
1414
#define LLVM_REMARKS_REMARKSERIALIZER_H
1515

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/Remarks/RemarkFormat.h"
1817
#include "llvm/Remarks/RemarkStringTable.h"
18+
#include "llvm/Support/Compiler.h"
1919
#include <optional>
2020

2121
namespace llvm {

llvm/include/llvm/Remarks/RemarkStringTable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
#ifndef LLVM_REMARKS_REMARKSTRINGTABLE_H
1717
#define LLVM_REMARKS_REMARKSTRINGTABLE_H
1818

19-
#include "llvm/Support/Compiler.h"
2019
#include "llvm/ADT/StringMap.h"
2120
#include "llvm/Support/Allocator.h"
21+
#include "llvm/Support/Compiler.h"
2222
#include <vector>
2323

2424
namespace llvm {

llvm/include/llvm/Remarks/YAMLRemarkSerializer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#ifndef LLVM_REMARKS_YAMLREMARKSERIALIZER_H
1414
#define LLVM_REMARKS_YAMLREMARKSERIALIZER_H
1515

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/Remarks/RemarkSerializer.h"
17+
#include "llvm/Support/Compiler.h"
1818
#include "llvm/Support/YAMLTraits.h"
1919
#include <optional>
2020

0 commit comments

Comments
 (0)