Skip to content

Commit 41eeb46

Browse files
committed
[llvm] clang-format changes to Object and ObjCopy libraries
1 parent 382209d commit 41eeb46

40 files changed

+149
-118
lines changed

llvm/include/llvm/ObjCopy/COFF/COFFObjcopy.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ namespace coff {
2828
/// Apply the transformations described by \p Config and \p COFFConfig
2929
/// to \p In and writes the result into \p Out.
3030
/// \returns any Error encountered whilst performing the operation.
31-
LLVM_ABI Error executeObjcopyOnBinary(const CommonConfig &Config, const COFFConfig &,
32-
object::COFFObjectFile &In, raw_ostream &Out);
31+
LLVM_ABI Error executeObjcopyOnBinary(const CommonConfig &Config,
32+
const COFFConfig &,
33+
object::COFFObjectFile &In,
34+
raw_ostream &Out);
3335

3436
} // end namespace coff
3537
} // end namespace objcopy

llvm/include/llvm/ObjCopy/CommonConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
#ifndef LLVM_OBJCOPY_COMMONCONFIG_H
1010
#define LLVM_OBJCOPY_COMMONCONFIG_H
1111

12-
#include "llvm/Support/Compiler.h"
1312
#include "llvm/ADT/ArrayRef.h"
1413
#include "llvm/ADT/CachedHashString.h"
1514
#include "llvm/ADT/DenseSet.h"
1615
#include "llvm/ADT/SmallVector.h"
1716
#include "llvm/ADT/StringMap.h"
1817
#include "llvm/ADT/StringRef.h"
1918
#include "llvm/Object/ELFTypes.h"
19+
#include "llvm/Support/Compiler.h"
2020
#include "llvm/Support/Compression.h"
2121
#include "llvm/Support/GlobPattern.h"
2222
#include "llvm/Support/MemoryBuffer.h"

llvm/include/llvm/ObjCopy/ConfigManager.h

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

12-
#include "llvm/Support/Compiler.h"
1312
#include "llvm/ObjCopy/COFF/COFFConfig.h"
1413
#include "llvm/ObjCopy/CommonConfig.h"
1514
#include "llvm/ObjCopy/ELF/ELFConfig.h"
1615
#include "llvm/ObjCopy/MachO/MachOConfig.h"
1716
#include "llvm/ObjCopy/MultiFormatConfig.h"
18-
#include "llvm/ObjCopy/wasm/WasmConfig.h"
1917
#include "llvm/ObjCopy/XCOFF/XCOFFConfig.h"
18+
#include "llvm/ObjCopy/wasm/WasmConfig.h"
19+
#include "llvm/Support/Compiler.h"
2020

2121
namespace llvm {
2222
namespace objcopy {

llvm/include/llvm/ObjCopy/ELF/ELFObjcopy.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,24 @@ namespace elf {
3030
/// into \p Out.
3131
/// \returns any Error encountered whilst performing the operation.
3232
LLVM_ABI Error executeObjcopyOnIHex(const CommonConfig &Config,
33-
const ELFConfig &ELFConfig, MemoryBuffer &In,
34-
raw_ostream &Out);
33+
const ELFConfig &ELFConfig,
34+
MemoryBuffer &In, raw_ostream &Out);
3535

3636
/// Apply the transformations described by \p Config and \p ELFConfig to
3737
/// \p In, which is treated as a raw binary input, and writes the result
3838
/// into \p Out.
3939
/// \returns any Error encountered whilst performing the operation.
4040
LLVM_ABI Error executeObjcopyOnRawBinary(const CommonConfig &Config,
41-
const ELFConfig &ELFConfig, MemoryBuffer &In,
42-
raw_ostream &Out);
41+
const ELFConfig &ELFConfig,
42+
MemoryBuffer &In, raw_ostream &Out);
4343

4444
/// Apply the transformations described by \p Config and \p ELFConfig to
4545
/// \p In and writes the result into \p Out.
4646
/// \returns any Error encountered whilst performing the operation.
4747
LLVM_ABI Error executeObjcopyOnBinary(const CommonConfig &Config,
48-
const ELFConfig &ELFConfig,
49-
object::ELFObjectFileBase &In, raw_ostream &Out);
48+
const ELFConfig &ELFConfig,
49+
object::ELFObjectFileBase &In,
50+
raw_ostream &Out);
5051

5152
} // end namespace elf
5253
} // end namespace objcopy

llvm/include/llvm/ObjCopy/MachO/MachOObjcopy.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ namespace macho {
3030
/// \p In and writes the result into \p Out.
3131
/// \returns any Error encountered whilst performing the operation.
3232
LLVM_ABI Error executeObjcopyOnBinary(const CommonConfig &Config,
33-
const MachOConfig &MachOConfig,
34-
object::MachOObjectFile &In, raw_ostream &Out);
33+
const MachOConfig &MachOConfig,
34+
object::MachOObjectFile &In,
35+
raw_ostream &Out);
3536

3637
/// Apply the transformations described by \p Config and \p MachOConfig to
3738
/// \p In and writes the result into \p Out.

llvm/include/llvm/ObjCopy/ObjCopy.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ class MultiFormatConfig;
2828
/// Writes a result in a file specified by \p Config.OutputFilename.
2929
/// \returns any Error encountered whilst performing the operation.
3030
LLVM_ABI Error executeObjcopyOnArchive(const MultiFormatConfig &Config,
31-
const object::Archive &Ar);
31+
const object::Archive &Ar);
3232

3333
/// Applies the transformations described by \p Config to \p In and writes
3434
/// the result into \p Out. This function does the dispatch based on the
3535
/// format of the input binary (COFF, ELF, MachO or wasm).
3636
/// \returns any Error encountered whilst performing the operation.
3737
LLVM_ABI Error executeObjcopyOnBinary(const MultiFormatConfig &Config,
38-
object::Binary &In, raw_ostream &Out);
38+
object::Binary &In, raw_ostream &Out);
3939

4040
} // end namespace objcopy
4141
} // end namespace llvm

llvm/include/llvm/ObjCopy/wasm/WasmObjcopy.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ namespace wasm {
2727
/// Apply the transformations described by \p Config and \p WasmConfig
2828
/// to \p In and writes the result into \p Out.
2929
/// \returns any Error encountered whilst performing the operation.
30-
LLVM_ABI Error executeObjcopyOnBinary(const CommonConfig &Config, const WasmConfig &,
31-
object::WasmObjectFile &In, raw_ostream &Out);
30+
LLVM_ABI Error executeObjcopyOnBinary(const CommonConfig &Config,
31+
const WasmConfig &,
32+
object::WasmObjectFile &In,
33+
raw_ostream &Out);
3234

3335
} // end namespace wasm
3436
} // end namespace objcopy

llvm/include/llvm/Object/Archive.h

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

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/ADT/StringRef.h"
1817
#include "llvm/ADT/fallible_iterator.h"
1918
#include "llvm/ADT/iterator_range.h"
2019
#include "llvm/Object/Binary.h"
2120
#include "llvm/Support/Chrono.h"
21+
#include "llvm/Support/Compiler.h"
2222
#include "llvm/Support/Error.h"
2323
#include "llvm/Support/FileSystem.h"
2424
#include "llvm/Support/MemoryBuffer.h"
@@ -63,7 +63,8 @@ class AbstractArchiveMemberHeader {
6363
virtual Expected<bool> isThin() const = 0;
6464

6565
LLVM_ABI Expected<sys::fs::perms> getAccessMode() const;
66-
LLVM_ABI Expected<sys::TimePoint<std::chrono::seconds>> getLastModified() const;
66+
LLVM_ABI Expected<sys::TimePoint<std::chrono::seconds>>
67+
getLastModified() const;
6768
LLVM_ABI Expected<unsigned> getUID() const;
6869
LLVM_ABI Expected<unsigned> getGID() const;
6970

@@ -100,7 +101,8 @@ struct UnixArMemHdrType {
100101
char Terminator[2];
101102
};
102103

103-
class LLVM_ABI ArchiveMemberHeader : public CommonArchiveMemberHeader<UnixArMemHdrType> {
104+
class LLVM_ABI ArchiveMemberHeader
105+
: public CommonArchiveMemberHeader<UnixArMemHdrType> {
104106
public:
105107
ArchiveMemberHeader(const Archive *Parent, const char *RawHeaderPtr,
106108
uint64_t Size, Error *Err);
@@ -333,8 +335,8 @@ class LLVM_ABI Archive : public Binary {
333335
static Expected<std::unique_ptr<Archive>> create(MemoryBufferRef Source);
334336

335337
// Explicitly non-copyable.
336-
Archive(Archive const&) = delete;
337-
Archive& operator=(Archive const&) = delete;
338+
Archive(Archive const &) = delete;
339+
Archive &operator=(Archive const &) = delete;
338340

339341
/// Size field is 10 decimal digits long
340342
static const uint64_t MaxMemberSize = 9999999999;

llvm/include/llvm/Object/ArchiveWriter.h

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#ifndef LLVM_OBJECT_ARCHIVEWRITER_H
1414
#define LLVM_OBJECT_ARCHIVEWRITER_H
1515

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/Object/Archive.h"
17+
#include "llvm/Support/Compiler.h"
1818

1919
namespace llvm {
2020

@@ -36,10 +36,11 @@ struct NewArchiveMember {
3636
getOldMember(const object::Archive::Child &OldMember, bool Deterministic);
3737

3838
LLVM_ABI static Expected<NewArchiveMember> getFile(StringRef FileName,
39-
bool Deterministic);
39+
bool Deterministic);
4040
};
4141

42-
LLVM_ABI Expected<std::string> computeArchiveRelativePath(StringRef From, StringRef To);
42+
LLVM_ABI Expected<std::string> computeArchiveRelativePath(StringRef From,
43+
StringRef To);
4344

4445
enum class SymtabWritingMode {
4546
NoSymtab, // Do not write symbol table.
@@ -52,19 +53,19 @@ enum class SymtabWritingMode {
5253
LLVM_ABI void warnToStderr(Error Err);
5354

5455
// Write an archive directly to an output stream.
55-
LLVM_ABI Error writeArchiveToStream(raw_ostream &Out,
56-
ArrayRef<NewArchiveMember> NewMembers,
57-
SymtabWritingMode WriteSymtab,
58-
object::Archive::Kind Kind, bool Deterministic,
59-
bool Thin, std::optional<bool> IsEC = std::nullopt,
60-
function_ref<void(Error)> Warn = warnToStderr);
56+
LLVM_ABI Error writeArchiveToStream(
57+
raw_ostream &Out, ArrayRef<NewArchiveMember> NewMembers,
58+
SymtabWritingMode WriteSymtab, object::Archive::Kind Kind,
59+
bool Deterministic, bool Thin, std::optional<bool> IsEC = std::nullopt,
60+
function_ref<void(Error)> Warn = warnToStderr);
6161

62-
LLVM_ABI Error writeArchive(StringRef ArcName, ArrayRef<NewArchiveMember> NewMembers,
63-
SymtabWritingMode WriteSymtab, object::Archive::Kind Kind,
64-
bool Deterministic, bool Thin,
65-
std::unique_ptr<MemoryBuffer> OldArchiveBuf = nullptr,
66-
std::optional<bool> IsEC = std::nullopt,
67-
function_ref<void(Error)> Warn = warnToStderr);
62+
LLVM_ABI Error
63+
writeArchive(StringRef ArcName, ArrayRef<NewArchiveMember> NewMembers,
64+
SymtabWritingMode WriteSymtab, object::Archive::Kind Kind,
65+
bool Deterministic, bool Thin,
66+
std::unique_ptr<MemoryBuffer> OldArchiveBuf = nullptr,
67+
std::optional<bool> IsEC = std::nullopt,
68+
function_ref<void(Error)> Warn = warnToStderr);
6869

6970
// writeArchiveToBuffer is similar to writeArchive but returns the Archive in a
7071
// buffer instead of writing it out to a file.

llvm/include/llvm/Object/Binary.h

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

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm-c/Types.h"
1817
#include "llvm/Object/Error.h"
1918
#include "llvm/Support/CBindingWrapping.h"
19+
#include "llvm/Support/Compiler.h"
2020
#include "llvm/Support/Error.h"
2121
#include "llvm/Support/MemoryBuffer.h"
2222
#include "llvm/TargetParser/Triple.h"
@@ -190,9 +190,9 @@ DEFINE_ISA_CONVERSION_FUNCTIONS(Binary, LLVMBinaryRef)
190190
/// Create a Binary from Source, autodetecting the file type.
191191
///
192192
/// @param Source The data to create the Binary from.
193-
LLVM_ABI Expected<std::unique_ptr<Binary>> createBinary(MemoryBufferRef Source,
194-
LLVMContext *Context = nullptr,
195-
bool InitContent = true);
193+
LLVM_ABI Expected<std::unique_ptr<Binary>>
194+
createBinary(MemoryBufferRef Source, LLVMContext *Context = nullptr,
195+
bool InitContent = true);
196196

197197
template <typename T> class OwningBinary {
198198
std::unique_ptr<T> Bin;
@@ -242,9 +242,9 @@ template <typename T> const T* OwningBinary<T>::getBinary() const {
242242
return Bin.get();
243243
}
244244

245-
LLVM_ABI Expected<OwningBinary<Binary>> createBinary(StringRef Path,
246-
LLVMContext *Context = nullptr,
247-
bool InitContent = true);
245+
LLVM_ABI Expected<OwningBinary<Binary>>
246+
createBinary(StringRef Path, LLVMContext *Context = nullptr,
247+
bool InitContent = true);
248248

249249
} // end namespace object
250250

llvm/include/llvm/Object/BuildID.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
#ifndef LLVM_DEBUGINFO_OBJECT_BUILDID_H
1616
#define LLVM_DEBUGINFO_OBJECT_BUILDID_H
1717

18-
#include "llvm/Support/Compiler.h"
1918
#include "llvm/ADT/ArrayRef.h"
2019
#include "llvm/ADT/SmallVector.h"
20+
#include "llvm/Support/Compiler.h"
2121

2222
namespace llvm {
2323
namespace object {

llvm/include/llvm/Object/COFF.h

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

16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/ADT/iterator_range.h"
1817
#include "llvm/BinaryFormat/COFF.h"
1918
#include "llvm/Object/Binary.h"
2019
#include "llvm/Object/CVDebugRecord.h"
2120
#include "llvm/Object/Error.h"
2221
#include "llvm/Object/ObjectFile.h"
2322
#include "llvm/Support/BinaryByteStream.h"
23+
#include "llvm/Support/Compiler.h"
2424
#include "llvm/Support/ConvertUTF.h"
2525
#include "llvm/Support/Endian.h"
2626
#include "llvm/Support/ErrorHandling.h"
@@ -1244,7 +1244,8 @@ class ImportDirectoryEntryRef {
12441244

12451245
LLVM_ABI imported_symbol_iterator lookup_table_begin() const;
12461246
LLVM_ABI imported_symbol_iterator lookup_table_end() const;
1247-
LLVM_ABI iterator_range<imported_symbol_iterator> lookup_table_symbols() const;
1247+
LLVM_ABI iterator_range<imported_symbol_iterator>
1248+
lookup_table_symbols() const;
12481249

12491250
LLVM_ABI Error getName(StringRef &Result) const;
12501251
LLVM_ABI Error getImportLookupTableRVA(uint32_t &Result) const;
@@ -1274,8 +1275,8 @@ class DelayImportDirectoryEntryRef {
12741275
LLVM_ABI iterator_range<imported_symbol_iterator> imported_symbols() const;
12751276

12761277
LLVM_ABI Error getName(StringRef &Result) const;
1277-
LLVM_ABI Error getDelayImportTable(
1278-
const delay_import_directory_table_entry *&Result) const;
1278+
LLVM_ABI Error
1279+
getDelayImportTable(const delay_import_directory_table_entry *&Result) const;
12791280
LLVM_ABI Error getImportAddress(int AddrIndex, uint64_t &Result) const;
12801281

12811282
private:
@@ -1428,7 +1429,8 @@ class ResourceSectionRef {
14281429
LLVM_ABI Expected<const coff_resource_dir_entry &>
14291430
getTableEntry(const coff_resource_dir_table &Table, uint32_t Index);
14301431

1431-
LLVM_ABI Expected<StringRef> getContents(const coff_resource_data_entry &Entry);
1432+
LLVM_ABI Expected<StringRef>
1433+
getContents(const coff_resource_data_entry &Entry);
14321434

14331435
private:
14341436
BinaryByteStream BBS;

llvm/include/llvm/Object/COFFImportFile.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
#ifndef LLVM_OBJECT_COFFIMPORTFILE_H
1717
#define LLVM_OBJECT_COFFIMPORTFILE_H
1818

19-
#include "llvm/Support/Compiler.h"
2019
#include "llvm/ADT/ArrayRef.h"
2120
#include "llvm/IR/Mangler.h"
2221
#include "llvm/Object/COFF.h"
2322
#include "llvm/Object/ObjectFile.h"
2423
#include "llvm/Object/SymbolicFile.h"
24+
#include "llvm/Support/Compiler.h"
2525
#include "llvm/Support/MemoryBufferRef.h"
2626
#include "llvm/Support/raw_ostream.h"
2727

@@ -137,9 +137,9 @@ struct COFFShortExport {
137137
/// the exports relevant to the target platform. For non-hybrid targets,
138138
/// the NativeExports parameter should not be used.
139139
LLVM_ABI Error writeImportLibrary(StringRef ImportName, StringRef Path,
140-
ArrayRef<COFFShortExport> Exports,
141-
COFF::MachineTypes Machine, bool MinGW,
142-
ArrayRef<COFFShortExport> NativeExports = {});
140+
ArrayRef<COFFShortExport> Exports,
141+
COFF::MachineTypes Machine, bool MinGW,
142+
ArrayRef<COFFShortExport> NativeExports = {});
143143

144144
} // namespace object
145145
} // namespace llvm

llvm/include/llvm/Object/COFFModuleDefinition.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
#ifndef LLVM_OBJECT_COFFMODULEDEFINITION_H
1919
#define LLVM_OBJECT_COFFMODULEDEFINITION_H
2020

21-
#include "llvm/Support/Compiler.h"
2221
#include "llvm/BinaryFormat/COFF.h"
2322
#include "llvm/Object/COFFImportFile.h"
23+
#include "llvm/Support/Compiler.h"
2424

2525
namespace llvm {
2626
namespace object {

llvm/include/llvm/Object/DXContainer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
#ifndef LLVM_OBJECT_DXCONTAINER_H
1616
#define LLVM_OBJECT_DXCONTAINER_H
1717

18-
#include "llvm/Support/Compiler.h"
1918
#include "llvm/ADT/SmallVector.h"
2019
#include "llvm/ADT/StringRef.h"
2120
#include "llvm/ADT/Twine.h"
2221
#include "llvm/BinaryFormat/DXContainer.h"
2322
#include "llvm/Object/Error.h"
23+
#include "llvm/Support/Compiler.h"
2424
#include "llvm/Support/Endian.h"
2525
#include "llvm/Support/Error.h"
2626
#include "llvm/Support/MemoryBufferRef.h"

llvm/include/llvm/Object/Decompressor.h

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

12-
#include "llvm/Support/Compiler.h"
1312
#include "llvm/ADT/ArrayRef.h"
1413
#include "llvm/ADT/StringRef.h"
14+
#include "llvm/Support/Compiler.h"
1515
#include "llvm/Support/Compression.h"
1616
#include "llvm/Support/Error.h"
1717

@@ -27,7 +27,7 @@ class Decompressor {
2727
/// @param IsLE Flag determines if Data is in little endian form.
2828
/// @param Is64Bit Flag determines if object is 64 bit.
2929
LLVM_ABI static Expected<Decompressor> create(StringRef Name, StringRef Data,
30-
bool IsLE, bool Is64Bit);
30+
bool IsLE, bool Is64Bit);
3131

3232
/// Resize the buffer and uncompress section data into it.
3333
/// @param Out Destination buffer.

llvm/include/llvm/Object/ELF.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class ELFFile {
257257
LLVM_ELF_IMPORT_TYPES_ELFT(ELFT)
258258

259259
// Default ctor required to instantiate the template for DLL export.
260-
ELFFile(const ELFFile&) = default;
260+
ELFFile(const ELFFile &) = default;
261261

262262
// This is a callback that can be passed to a number of functions.
263263
// It can be used to ignore non-critical errors (warnings), which is

0 commit comments

Comments
 (0)