Skip to content

Commit 574e777

Browse files
committed
[NFC][OffloadBundler] Fix whitespace formatting to match upstream
Change-Id: I470e7fc14444611d0ec376462f0811ae654065a3
1 parent 5e5bc90 commit 574e777

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

clang/include/clang/Driver/OffloadBundler.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,14 @@ class OffloadBundler {
5656
// TODO: Add error checking from ClangOffloadBundler.cpp
5757
OffloadBundler(const OffloadBundlerConfig &BC) : BundlerConfig(BC) {}
5858

59+
// List bundle IDs. Return true if an error was found.
60+
static llvm::Error
61+
ListBundleIDsInFile(llvm::StringRef InputFileName,
62+
const OffloadBundlerConfig &BundlerConfig);
63+
5964
llvm::Error BundleFiles();
6065
llvm::Error UnbundleFiles();
6166
llvm::Error UnbundleArchive();
62-
63-
// List bundle IDs. Return true if an error was found.
64-
static llvm::Error ListBundleIDsInFile(llvm::StringRef InputFileName,
65-
const OffloadBundlerConfig &BundlerConfig);
6667
};
6768

6869
/// Obtain the offload kind, real machine triple, and an optional TargetID
@@ -78,7 +79,8 @@ struct OffloadTargetInfo {
7879

7980
const OffloadBundlerConfig &BundlerConfig;
8081

81-
OffloadTargetInfo(const llvm::StringRef Target, const OffloadBundlerConfig &BC);
82+
OffloadTargetInfo(const llvm::StringRef Target,
83+
const OffloadBundlerConfig &BC);
8284
bool hasHostKind() const;
8385
bool isOffloadKindValid() const;
8486
bool isOffloadKindCompatible(const llvm::StringRef TargetOffloadKind) const;

clang/lib/Driver/OffloadBundler.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,9 @@ bool OffloadTargetInfo::isTripleValid() const {
132132

133133
bool OffloadTargetInfo::operator==(const OffloadTargetInfo &Target) const {
134134
return OffloadKind == Target.OffloadKind &&
135-
Triple.isCompatibleWith(Target.Triple) &&
136-
TargetID == Target.TargetID;
135+
Triple.isCompatibleWith(Target.Triple) && TargetID == Target.TargetID;
137136
}
138137

139-
//std::string OffloadTargetInfo::str() {
140-
// Triple.isCompatibleWith(Target.Triple) && TargetID == Target.TargetID;
141-
//}
142-
143138
std::string OffloadTargetInfo::str() const {
144139
return Twine(OffloadKind + "-" + Triple.str() + "-" + TargetID).str();
145140
}
@@ -557,7 +552,8 @@ class ObjectFileHandler final : public FileHandler {
557552

558553
public:
559554
// TODO: Add error checking from ClangOffloadBundler.cpp
560-
ObjectFileHandler(std::unique_ptr<ObjectFile> ObjIn, const OffloadBundlerConfig &BC)
555+
ObjectFileHandler(std::unique_ptr<ObjectFile> ObjIn,
556+
const OffloadBundlerConfig &BC)
561557
: Obj(std::move(ObjIn)), CurrentSection(Obj->section_begin()),
562558
NextSection(Obj->section_begin()), BundlerConfig(BC) {}
563559

@@ -1574,7 +1570,8 @@ Error OffloadBundler::UnbundleArchive() {
15741570
return FileHandlerOrErr.takeError();
15751571

15761572
std::unique_ptr<FileHandler> &FileHandler = *FileHandlerOrErr;
1577-
assert(FileHandler);
1573+
assert(FileHandler &&
1574+
"FileHandle creation failed for file in the archive!");
15781575

15791576
if (Error ReadErr = FileHandler->ReadHeader(CodeObjectBuffer))
15801577
return ReadErr;

clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,9 @@ int main(int argc, const char **argv) {
274274
"-targets option is invalid for -list"));
275275
}
276276

277-
doWork([&]() { return OffloadBundler::ListBundleIDsInFile(InputFileNames.front(),
278-
BundlerConfig); });
277+
doWork([&]() { return OffloadBundler::ListBundleIDsInFile(
278+
InputFileNames.front(),
279+
BundlerConfig); });
279280
return 0;
280281
}
281282

0 commit comments

Comments
 (0)