Skip to content

Commit 80c61de

Browse files
committed
[llvm-objcopy] Fix some namespace style issues
Similar to https://reviews.llvm.org/D104693
1 parent 35255cc commit 80c61de

File tree

4 files changed

+13
-27
lines changed

4 files changed

+13
-27
lines changed

llvm/lib/ObjCopy/Archive.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
#include "llvm/Support/FileOutputBuffer.h"
1515
#include "llvm/Support/SmallVectorMemoryBuffer.h"
1616

17-
namespace llvm {
18-
namespace objcopy {
19-
17+
using namespace llvm;
18+
using namespace llvm::objcopy;
2019
using namespace llvm::object;
2120

2221
Expected<std::vector<NewArchiveMember>>
23-
createNewArchiveMembers(const MultiFormatConfig &Config, const Archive &Ar) {
22+
objcopy::createNewArchiveMembers(const MultiFormatConfig &Config,
23+
const Archive &Ar) {
2424
std::vector<NewArchiveMember> NewArchiveMembers;
2525
Error Err = Error::success();
2626
for (const Archive::Child &Child : Ar.children(Err)) {
@@ -94,8 +94,8 @@ static Error deepWriteArchive(StringRef ArcName,
9494
return Error::success();
9595
}
9696

97-
Error executeObjcopyOnArchive(const MultiFormatConfig &Config,
98-
const object::Archive &Ar) {
97+
Error objcopy::executeObjcopyOnArchive(const MultiFormatConfig &Config,
98+
const object::Archive &Ar) {
9999
Expected<std::vector<NewArchiveMember>> NewArchiveMembersOrErr =
100100
createNewArchiveMembers(Config, Ar);
101101
if (!NewArchiveMembersOrErr)
@@ -107,6 +107,3 @@ Error executeObjcopyOnArchive(const MultiFormatConfig &Config,
107107
Ar.kind(), CommonConfig.DeterministicArchives,
108108
Ar.isThin());
109109
}
110-
111-
} // end namespace objcopy
112-
} // end namespace llvm

llvm/lib/ObjCopy/CommonConfig.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include "llvm/ObjCopy/CommonConfig.h"
1010
#include "llvm/Support/Errc.h"
1111

12-
namespace llvm {
13-
namespace objcopy {
12+
using namespace llvm;
13+
using namespace llvm::objcopy;
1414

1515
Expected<NameOrPattern>
1616
NameOrPattern::create(StringRef Pattern, MatchStyle MS,
@@ -47,6 +47,3 @@ NameOrPattern::create(StringRef Pattern, MatchStyle MS,
4747
}
4848
llvm_unreachable("Unhandled llvm.objcopy.MatchStyle enum");
4949
}
50-
51-
} // end namespace objcopy
52-
} // end namespace llvm

llvm/lib/ObjCopy/ConfigManager.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#include "llvm/Support/Errc.h"
1111
#include "llvm/Support/Error.h"
1212

13-
namespace llvm {
14-
namespace objcopy {
13+
using namespace llvm;
14+
using namespace llvm::objcopy;
1515

1616
Expected<const COFFConfig &> ConfigManager::getCOFFConfig() const {
1717
if (!Common.SplitDWO.empty() || !Common.SymbolsPrefix.empty() ||
@@ -107,6 +107,3 @@ Expected<const XCOFFConfig &> ConfigManager::getXCOFFConfig() const {
107107

108108
return XCOFF;
109109
}
110-
111-
} // end namespace objcopy
112-
} // end namespace llvm

llvm/lib/ObjCopy/ObjCopy.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@
2626
#include "llvm/Object/Wasm.h"
2727
#include "llvm/Object/XCOFFObjectFile.h"
2828

29-
namespace llvm {
30-
namespace objcopy {
31-
29+
using namespace llvm;
3230
using namespace llvm::object;
3331

3432
/// The function executeObjcopyOnBinary does the dispatch based on the format
3533
/// of the input binary (ELF, MachO or COFF).
36-
Error executeObjcopyOnBinary(const MultiFormatConfig &Config,
37-
object::Binary &In, raw_ostream &Out) {
34+
Error objcopy::executeObjcopyOnBinary(const MultiFormatConfig &Config,
35+
object::Binary &In, raw_ostream &Out) {
3836
if (auto *ELFBinary = dyn_cast<object::ELFObjectFileBase>(&In)) {
3937
Expected<const ELFConfig &> ELFConfig = Config.getELFConfig();
4038
if (!ELFConfig)
@@ -83,6 +81,3 @@ Error executeObjcopyOnBinary(const MultiFormatConfig &Config,
8381
return createStringError(object_error::invalid_file_type,
8482
"unsupported object file format");
8583
}
86-
87-
} // end namespace objcopy
88-
} // end namespace llvm

0 commit comments

Comments
 (0)