Skip to content

Commit

Permalink
[NFC][OffloadBundler] Fix whitespace formatting to match upstream
Browse files Browse the repository at this point in the history
Change-Id: I470e7fc14444611d0ec376462f0811ae654065a3
  • Loading branch information
lamb-j committed Dec 4, 2023
1 parent 5e5bc90 commit 574e777
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
12 changes: 7 additions & 5 deletions clang/include/clang/Driver/OffloadBundler.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ class OffloadBundler {
// TODO: Add error checking from ClangOffloadBundler.cpp
OffloadBundler(const OffloadBundlerConfig &BC) : BundlerConfig(BC) {}

// List bundle IDs. Return true if an error was found.
static llvm::Error
ListBundleIDsInFile(llvm::StringRef InputFileName,
const OffloadBundlerConfig &BundlerConfig);

llvm::Error BundleFiles();
llvm::Error UnbundleFiles();
llvm::Error UnbundleArchive();

// List bundle IDs. Return true if an error was found.
static llvm::Error ListBundleIDsInFile(llvm::StringRef InputFileName,
const OffloadBundlerConfig &BundlerConfig);
};

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

const OffloadBundlerConfig &BundlerConfig;

OffloadTargetInfo(const llvm::StringRef Target, const OffloadBundlerConfig &BC);
OffloadTargetInfo(const llvm::StringRef Target,
const OffloadBundlerConfig &BC);
bool hasHostKind() const;
bool isOffloadKindValid() const;
bool isOffloadKindCompatible(const llvm::StringRef TargetOffloadKind) const;
Expand Down
13 changes: 5 additions & 8 deletions clang/lib/Driver/OffloadBundler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,9 @@ bool OffloadTargetInfo::isTripleValid() const {

bool OffloadTargetInfo::operator==(const OffloadTargetInfo &Target) const {
return OffloadKind == Target.OffloadKind &&
Triple.isCompatibleWith(Target.Triple) &&
TargetID == Target.TargetID;
Triple.isCompatibleWith(Target.Triple) && TargetID == Target.TargetID;
}

//std::string OffloadTargetInfo::str() {
// Triple.isCompatibleWith(Target.Triple) && TargetID == Target.TargetID;
//}

std::string OffloadTargetInfo::str() const {
return Twine(OffloadKind + "-" + Triple.str() + "-" + TargetID).str();
}
Expand Down Expand Up @@ -557,7 +552,8 @@ class ObjectFileHandler final : public FileHandler {

public:
// TODO: Add error checking from ClangOffloadBundler.cpp
ObjectFileHandler(std::unique_ptr<ObjectFile> ObjIn, const OffloadBundlerConfig &BC)
ObjectFileHandler(std::unique_ptr<ObjectFile> ObjIn,
const OffloadBundlerConfig &BC)
: Obj(std::move(ObjIn)), CurrentSection(Obj->section_begin()),
NextSection(Obj->section_begin()), BundlerConfig(BC) {}

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

std::unique_ptr<FileHandler> &FileHandler = *FileHandlerOrErr;
assert(FileHandler);
assert(FileHandler &&
"FileHandle creation failed for file in the archive!");

if (Error ReadErr = FileHandler->ReadHeader(CodeObjectBuffer))
return ReadErr;
Expand Down
5 changes: 3 additions & 2 deletions clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,9 @@ int main(int argc, const char **argv) {
"-targets option is invalid for -list"));
}

doWork([&]() { return OffloadBundler::ListBundleIDsInFile(InputFileNames.front(),
BundlerConfig); });
doWork([&]() { return OffloadBundler::ListBundleIDsInFile(
InputFileNames.front(),
BundlerConfig); });
return 0;
}

Expand Down

0 comments on commit 574e777

Please sign in to comment.