Skip to content

Commit 339cd0e

Browse files
committed
[llvm] clang-format changes to TextAPI library
1 parent e48e1b6 commit 339cd0e

File tree

10 files changed

+56
-42
lines changed

10 files changed

+56
-42
lines changed

llvm/include/llvm/TextAPI/Architecture.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ enum Architecture : uint8_t {
3333
};
3434

3535
/// Convert a CPU Type and Subtype pair to an architecture slice.
36-
LLVM_ABI Architecture getArchitectureFromCpuType(uint32_t CPUType, uint32_t CPUSubType);
36+
LLVM_ABI Architecture getArchitectureFromCpuType(uint32_t CPUType,
37+
uint32_t CPUSubType);
3738

3839
/// Convert a name to an architecture slice.
3940
LLVM_ABI Architecture getArchitectureFromName(StringRef Name);
@@ -42,7 +43,8 @@ LLVM_ABI Architecture getArchitectureFromName(StringRef Name);
4243
LLVM_ABI StringRef getArchitectureName(Architecture Arch);
4344

4445
/// Convert an architecture slice to a CPU Type and Subtype pair.
45-
LLVM_ABI std::pair<uint32_t, uint32_t> getCPUTypeFromArchitecture(Architecture Arch);
46+
LLVM_ABI std::pair<uint32_t, uint32_t>
47+
getCPUTypeFromArchitecture(Architecture Arch);
4648

4749
/// Convert a target to an architecture slice.
4850
LLVM_ABI Architecture mapToArchitecture(const llvm::Triple &Target);

llvm/include/llvm/TextAPI/DylibReader.h

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

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/ADT/StringMap.h"
17+
#include "llvm/Support/Compiler.h"
1818
#include "llvm/Support/Error.h"
1919
#include "llvm/Support/MemoryBuffer.h"
2020
#include "llvm/TextAPI/ArchitectureSet.h"
@@ -38,7 +38,8 @@ struct ParseOption {
3838
/// \param Buffer Data that points to dylib.
3939
/// \param Options Determines which attributes to extract.
4040
/// \return List of record slices.
41-
LLVM_ABI Expected<Records> readFile(MemoryBufferRef Buffer, const ParseOption &Opt);
41+
LLVM_ABI Expected<Records> readFile(MemoryBufferRef Buffer,
42+
const ParseOption &Opt);
4243

4344
/// Get TAPI file representation of binary dylib.
4445
///
@@ -51,7 +52,7 @@ using SymbolToSourceLocMap = llvm::StringMap<RecordLoc>;
5152
/// \param DSYM Path to DSYM file.
5253
/// \param T Requested target slice for dylib.
5354
LLVM_ABI SymbolToSourceLocMap accumulateSourceLocFromDSYM(const StringRef DSYM,
54-
const Target &T);
55+
const Target &T);
5556

5657
} // namespace llvm::MachO::DylibReader
5758

llvm/include/llvm/TextAPI/InterfaceFile.h

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

17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/ADT/Hashing.h"
1918
#include "llvm/ADT/StringRef.h"
2019
#include "llvm/ADT/iterator.h"
2120
#include "llvm/Support/Allocator.h"
21+
#include "llvm/Support/Compiler.h"
2222
#include "llvm/TextAPI/ArchitectureSet.h"
2323
#include "llvm/TextAPI/FileTypes.h"
2424
#include "llvm/TextAPI/PackedVersion.h"
@@ -275,7 +275,8 @@ class InterfaceFile {
275275
///
276276
/// \param InstallName The name of the library to re-export.
277277
/// \param Target The target triple for which this applies.
278-
LLVM_ABI void addReexportedLibrary(StringRef InstallName, const Target &Target);
278+
LLVM_ABI void addReexportedLibrary(StringRef InstallName,
279+
const Target &Target);
279280

280281
/// Get the list of re-exported libraries.
281282
///
@@ -399,15 +400,15 @@ class InterfaceFile {
399400
/// \param Library Interface of reexported library.
400401
/// \param Overwrite Whether to overwrite preexisting inlined library.
401402
LLVM_ABI void inlineLibrary(std::shared_ptr<InterfaceFile> Library,
402-
bool Overwrite = false);
403+
bool Overwrite = false);
403404

404405
/// Set InterfaceFile properties from pre-gathered binary attributes,
405406
/// if they are not set already.
406407
///
407408
/// \param BA Attributes typically represented in load commands.
408409
/// \param Targ MachO Target slice to add attributes to.
409410
LLVM_ABI void setFromBinaryAttrs(const RecordsSlice::BinaryAttrs &BA,
410-
const Target &Targ);
411+
const Target &Targ);
411412

412413
/// The equality is determined by attributes that impact linking
413414
/// compatibilities. Path, & FileKind are irrelevant since these by

llvm/include/llvm/TextAPI/Platform.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
#ifndef LLVM_TEXTAPI_PLATFORM_H
1313
#define LLVM_TEXTAPI_PLATFORM_H
1414

15-
#include "llvm/Support/Compiler.h"
1615
#include "llvm/ADT/SmallSet.h"
1716
#include "llvm/BinaryFormat/MachO.h"
17+
#include "llvm/Support/Compiler.h"
1818
#include "llvm/Support/VersionTuple.h"
1919

2020
namespace llvm {
@@ -29,7 +29,7 @@ LLVM_ABI PlatformSet mapToPlatformSet(ArrayRef<Triple> Targets);
2929
LLVM_ABI StringRef getPlatformName(PlatformType Platform);
3030
LLVM_ABI PlatformType getPlatformFromName(StringRef Name);
3131
LLVM_ABI std::string getOSAndEnvironmentName(PlatformType Platform,
32-
std::string Version = "");
32+
std::string Version = "");
3333
LLVM_ABI VersionTuple mapToSupportedOSVersion(const Triple &Triple);
3434

3535
} // end namespace MachO.

llvm/include/llvm/TextAPI/Record.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
#ifndef LLVM_TEXTAPI_RECORD_H
1515
#define LLVM_TEXTAPI_RECORD_H
1616

17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/ADT/MapVector.h"
1918
#include "llvm/ADT/StringRef.h"
2019
#include "llvm/Support/Casting.h"
20+
#include "llvm/Support/Compiler.h"
2121
#include "llvm/TextAPI/Symbol.h"
2222
#include <string>
2323

@@ -209,7 +209,8 @@ class ObjCInterfaceRecord : public ObjCContainerRecord {
209209
}
210210

211211
LLVM_ABI RecordLinkage getLinkageForSymbol(ObjCIFSymbolKind CurrType) const;
212-
LLVM_ABI void updateLinkageForSymbols(ObjCIFSymbolKind SymType, RecordLinkage Link);
212+
LLVM_ABI void updateLinkageForSymbols(ObjCIFSymbolKind SymType,
213+
RecordLinkage Link);
213214

214215
LLVM_ABI bool addObjCCategory(ObjCCategoryRecord *Record);
215216
LLVM_ABI std::vector<ObjCCategoryRecord *> getObjCCategories() const;

llvm/include/llvm/TextAPI/RecordsSlice.h

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#ifndef LLVM_TEXTAPI_RECORDSLICE_H
1515
#define LLVM_TEXTAPI_RECORDSLICE_H
1616

17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/Support/Allocator.h"
18+
#include "llvm/Support/Compiler.h"
1919
#include "llvm/TextAPI/FileTypes.h"
2020
#include "llvm/TextAPI/PackedVersion.h"
2121
#include "llvm/TextAPI/Record.h"
@@ -44,9 +44,10 @@ class RecordsSlice {
4444
/// symbol.
4545
/// \param Linkage The linkage of symbol.
4646
/// \return The non-owning pointer to added record in slice.
47-
LLVM_ABI Record *addRecord(StringRef Name, SymbolFlags Flags,
48-
GlobalRecord::Kind GV = GlobalRecord::Kind::Unknown,
49-
RecordLinkage Linkage = RecordLinkage::Unknown);
47+
LLVM_ABI Record *
48+
addRecord(StringRef Name, SymbolFlags Flags,
49+
GlobalRecord::Kind GV = GlobalRecord::Kind::Unknown,
50+
RecordLinkage Linkage = RecordLinkage::Unknown);
5051

5152
/// Add non-ObjC global record.
5253
///
@@ -58,27 +59,28 @@ class RecordsSlice {
5859
/// functions.
5960
/// \return The non-owning pointer to added record in slice.
6061
LLVM_ABI GlobalRecord *addGlobal(StringRef Name, RecordLinkage Linkage,
61-
GlobalRecord::Kind GV,
62-
SymbolFlags Flags = SymbolFlags::None,
63-
bool Inlined = false);
62+
GlobalRecord::Kind GV,
63+
SymbolFlags Flags = SymbolFlags::None,
64+
bool Inlined = false);
6465

6566
/// Add ObjC Class record.
6667
///
6768
/// \param Name The name of class, not symbol.
6869
/// \param Linkage The linkage of symbol.
6970
/// \param SymType The symbols this class represents.
7071
/// \return The non-owning pointer to added record in slice.
71-
LLVM_ABI ObjCInterfaceRecord *addObjCInterface(StringRef Name, RecordLinkage Linkage,
72-
ObjCIFSymbolKind SymType);
72+
LLVM_ABI ObjCInterfaceRecord *addObjCInterface(StringRef Name,
73+
RecordLinkage Linkage,
74+
ObjCIFSymbolKind SymType);
7375

7476
/// Add ObjC IVar record.
7577
///
7678
/// \param Container Owning pointer for instance variable.
7779
/// \param Name The name of ivar, not symbol.
7880
/// \param Linkage The linkage of symbol.
7981
/// \return The non-owning pointer to added record in slice.
80-
LLVM_ABI ObjCIVarRecord *addObjCIVar(ObjCContainerRecord *Container, StringRef Name,
81-
RecordLinkage Linkage);
82+
LLVM_ABI ObjCIVarRecord *addObjCIVar(ObjCContainerRecord *Container,
83+
StringRef Name, RecordLinkage Linkage);
8284

8385
/// Add ObjC Category record.
8486
///
@@ -87,7 +89,7 @@ class RecordsSlice {
8789
/// \param Category The name of category.
8890
/// \return The non-owning pointer to added record in slice.
8991
LLVM_ABI ObjCCategoryRecord *addObjCCategory(StringRef ClassToExtend,
90-
StringRef Category);
92+
StringRef Category);
9193

9294
/// Find ObjC Class.
9395
///
@@ -101,7 +103,7 @@ class RecordsSlice {
101103
/// \param Category The name of category.
102104
/// \return The non-owning pointer to record in slice.
103105
LLVM_ABI ObjCCategoryRecord *findObjCCategory(StringRef ClassToExtend,
104-
StringRef Category) const;
106+
StringRef Category) const;
105107

106108
/// Find ObjC Container. This is commonly used for assigning for looking up
107109
/// instance variables that are assigned to either a category or class.
@@ -111,14 +113,16 @@ class RecordsSlice {
111113
/// \param Name Either the name of ivar or name of container.
112114
/// \return The non-owning pointer to record in
113115
/// slice.
114-
LLVM_ABI ObjCContainerRecord *findContainer(bool IsIVar, StringRef Name) const;
116+
LLVM_ABI ObjCContainerRecord *findContainer(bool IsIVar,
117+
StringRef Name) const;
115118

116119
/// Find ObjC instance variable.
117120
///
118121
/// \param IsScopedName This is used to determine how to parse the name.
119122
/// \param Name Either the full name of the symbol or just the ivar.
120123
/// \return The non-owning pointer to record in slice.
121-
LLVM_ABI ObjCIVarRecord *findObjCIVar(bool IsScopedName, StringRef Name) const;
124+
LLVM_ABI ObjCIVarRecord *findObjCIVar(bool IsScopedName,
125+
StringRef Name) const;
122126

123127
/// Find non-objc global.
124128
///
@@ -197,7 +201,8 @@ class RecordsSlice {
197201

198202
using Records = llvm::SmallVector<std::shared_ptr<RecordsSlice>, 4>;
199203
class InterfaceFile;
200-
LLVM_ABI std::unique_ptr<InterfaceFile> convertToInterfaceFile(const Records &Slices);
204+
LLVM_ABI std::unique_ptr<InterfaceFile>
205+
convertToInterfaceFile(const Records &Slices);
201206

202207
} // namespace MachO
203208
} // namespace llvm

llvm/include/llvm/TextAPI/Symbol.h

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

12-
#include "llvm/Support/Compiler.h"
1312
#include "llvm/ADT/BitmaskEnum.h"
1413
#include "llvm/ADT/StringRef.h"
14+
#include "llvm/Support/Compiler.h"
1515
#include "llvm/Support/raw_ostream.h"
1616
#include "llvm/TextAPI/ArchitectureSet.h"
1717
#include "llvm/TextAPI/Target.h"
@@ -153,7 +153,8 @@ class Symbol {
153153
std::function<bool(const Target &)>>;
154154
using const_filtered_target_range =
155155
llvm::iterator_range<const_filtered_target_iterator>;
156-
LLVM_ABI const_filtered_target_range targets(ArchitectureSet architectures) const;
156+
LLVM_ABI const_filtered_target_range
157+
targets(ArchitectureSet architectures) const;
157158

158159
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
159160
void dump(raw_ostream &OS) const;

llvm/include/llvm/TextAPI/SymbolSet.h

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

12-
#include "llvm/Support/Compiler.h"
1312
#include "llvm/ADT/DenseMap.h"
1413
#include "llvm/ADT/Hashing.h"
1514
#include "llvm/ADT/StringRef.h"
1615
#include "llvm/ADT/iterator.h"
1716
#include "llvm/ADT/iterator_range.h"
1817
#include "llvm/Support/Allocator.h"
18+
#include "llvm/Support/Compiler.h"
1919
#include "llvm/TextAPI/Architecture.h"
2020
#include "llvm/TextAPI/ArchitectureSet.h"
2121
#include "llvm/TextAPI/Symbol.h"
@@ -93,7 +93,7 @@ class SymbolSet {
9393
public:
9494
SymbolSet() = default;
9595
LLVM_ABI Symbol *addGlobal(EncodeKind Kind, StringRef Name, SymbolFlags Flags,
96-
const Target &Targ);
96+
const Target &Targ);
9797
size_t size() const { return Symbols.size(); }
9898

9999
template <typename RangeT, typename ElT = std::remove_reference_t<

llvm/include/llvm/TextAPI/TextAPIWriter.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#ifndef LLVM_TEXTAPI_TEXTAPIWRITER_H
1010
#define LLVM_TEXTAPI_TEXTAPIWRITER_H
1111

12-
#include "llvm/Support/Compiler.h"
1312
#include "llvm/ADT/StringSwitch.h"
13+
#include "llvm/Support/Compiler.h"
1414
#include "llvm/TextAPI/InterfaceFile.h"
1515

1616
namespace llvm {
@@ -31,9 +31,10 @@ class TextAPIWriter {
3131
/// \param FileKind File format to write text file as. If not specified, it
3232
/// will read from File.
3333
/// \param Compact Whether to limit whitespace in text file.
34-
LLVM_ABI static Error writeToStream(raw_ostream &OS, const InterfaceFile &File,
35-
const FileType FileKind = FileType::Invalid,
36-
bool Compact = false);
34+
LLVM_ABI static Error
35+
writeToStream(raw_ostream &OS, const InterfaceFile &File,
36+
const FileType FileKind = FileType::Invalid,
37+
bool Compact = false);
3738

3839
/// Get TAPI FileType from the input string.
3940
///

llvm/include/llvm/TextAPI/Utils.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#ifndef LLVM_TEXTAPI_UTILS_H
1414
#define LLVM_TEXTAPI_UTILS_H
1515

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/ADT/Twine.h"
17+
#include "llvm/Support/Compiler.h"
1818
#include "llvm/Support/Error.h"
1919
#include "llvm/Support/FileSystem.h"
2020
#include "llvm/Support/MemoryBuffer.h"
@@ -52,7 +52,8 @@ struct SymLink {
5252
///
5353
/// \param Path Location of file.
5454
/// \param Extension File extension to update with.
55-
LLVM_ABI void replace_extension(SmallVectorImpl<char> &Path, const Twine &Extension);
55+
LLVM_ABI void replace_extension(SmallVectorImpl<char> &Path,
56+
const Twine &Extension);
5657

5758
/// Determine whether to skip over symlink due to either too many symlink levels
5859
/// or is cyclic.
@@ -67,7 +68,7 @@ LLVM_ABI std::error_code shouldSkipSymLink(const Twine &Path, bool &Result);
6768
/// \param To What the symlink points to.
6869
/// \param RelativePath Path location to update what the symlink points to.
6970
LLVM_ABI std::error_code make_relative(StringRef From, StringRef To,
70-
SmallVectorImpl<char> &RelativePath);
71+
SmallVectorImpl<char> &RelativePath);
7172

7273
/// Determine if library is private by parsing file path.
7374
/// It does not touch the file system.
@@ -88,14 +89,15 @@ using AliasMap = std::map<AliasEntry, AliasEntry>;
8889
///
8990
/// \param Buffer Data contents of file for the alias list.
9091
/// \return Lookup table of alias to their base symbol.
91-
LLVM_ABI Expected<AliasMap> parseAliasList(std::unique_ptr<llvm::MemoryBuffer> &Buffer);
92+
LLVM_ABI Expected<AliasMap>
93+
parseAliasList(std::unique_ptr<llvm::MemoryBuffer> &Buffer);
9294

9395
/// Pickup active paths for a given platform.
9496
///
9597
/// \param Paths File or search paths to pick up.
9698
/// \param Platform Platform to collect paths for.
9799
LLVM_ABI PathSeq getPathsForPlatform(const PathToPlatformSeq &Paths,
98-
PlatformType Platform);
100+
PlatformType Platform);
99101

100102
} // namespace llvm::MachO
101103
#endif // LLVM_TEXTAPI_UTILS_H

0 commit comments

Comments
 (0)