Skip to content

Commit 34c14bb

Browse files
committed
Handled skipping of tiny and kernel CM + rebase + clang-format
1 parent fca9ce5 commit 34c14bb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5749,6 +5749,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
57495749
if (Arg *A = Args.getLastArg(options::OPT_mcmodel_EQ)) {
57505750
StringRef CM = A->getValue();
57515751
bool Ok = false;
5752+
bool Skip = false;
57525753
if (Triple.isOSAIX() && CM == "medium")
57535754
CM = "large";
57545755
if (Triple.isAArch64(64)) {
@@ -5774,13 +5775,16 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
57745775
} else if (Triple.isAMDGPU()) {
57755776
// AMDGPU does not care about the code model.
57765777
Ok = true;
5777-
// AMDGPU target does not accept CM tiny and kernel.
5778+
// AMDGPU target ignores CM tiny and kernel.
57785779
if (CM == "tiny" || CM == "kernel") {
5780+
Skip = true;
57795781
D.Diag(diag::warn_ignored_clang_option)
57805782
<< A->getSpelling() << CM << TripleStr;
57815783
}
57825784
}
5783-
if (Ok) {
5785+
if (Skip) {
5786+
// CM option is not propogated further.
5787+
} else if (Ok) {
57845788
CmdArgs.push_back(Args.MakeArgString("-mcmodel=" + CM));
57855789
} else {
57865790
D.Diag(diag::err_drv_unsupported_option_argument_for_target)

0 commit comments

Comments
 (0)