Skip to content

Commit 3dbf62a

Browse files
sndmitrievvmaksimo
authored andcommitted
[clang-offload-bundler] Restore --check-section functionality
Some changes related to --check-section option were lost during conflict resolution. This patch restores this code. Signed-off-by: Sergey Dmitriev <[email protected]>
1 parent a571e9d commit 3dbf62a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@ int main(int argc, const char **argv) {
15511551
return 0;
15521552
}
15531553

1554-
if (OutputFileNames.getNumOccurrences() == 0) {
1554+
if (OutputFileNames.getNumOccurrences() == 0 && !CheckSection) {
15551555
reportError(createStringError(
15561556
errc::invalid_argument,
15571557
"for the --outputs option: must be specified at least once!"));
@@ -1662,6 +1662,15 @@ int main(int argc, const char **argv) {
16621662
++Index;
16631663
}
16641664

1665+
if (CheckSection) {
1666+
Expected<bool> Res = CheckBundledSection();
1667+
if (!Res) {
1668+
reportError(Res.takeError());
1669+
return 1;
1670+
}
1671+
return !*Res;
1672+
}
1673+
16651674
// Host triple is not really needed for unbundling operation, so do not
16661675
// treat missing host triple as error if we do unbundling.
16671676
if ((Unbundle && HostTargetNum > 1) || (!Unbundle && HostTargetNum != 1)) {

0 commit comments

Comments
 (0)