Skip to content

[Driver] Reject -mcmodel=tiny on X86 #125643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0aebcd7
Adding diagnostics for unsupported option
ShashwathiNavada Feb 4, 2025
f791b1d
minor changes
ShashwathiNavada Feb 4, 2025
689dc3a
minor changes
ShashwathiNavada Feb 4, 2025
28fcb0e
minor changes
ShashwathiNavada Feb 4, 2025
ba6c662
Merge branch 'main' into mcmodel_crash
ShashwathiNavada Feb 4, 2025
843d4cc
Addressed build fail
ShashwathiNavada Feb 4, 2025
adf4236
Merge branch 'llvm:main' into mcmodel_crash
ShashwathiNavada Feb 4, 2025
cb512f3
Added tests and releasenotes entry
ShashwathiNavada Feb 11, 2025
b2724ba
Merge branch 'main' into mcmodel_crash
ShashwathiNavada Feb 11, 2025
ad5c8ca
Merge branch 'main' into mcmodel_crash
ShashwathiNavada Feb 19, 2025
5b9ff44
Merge branch 'main' into mcmodel_crash
ShashwathiNavada Feb 21, 2025
0fa223c
Added testcase in mcmodel.c file
Mar 26, 2025
d85fad3
Merge branch 'main' into mcmodel_crash
ShashwathiNavada Mar 26, 2025
ca4d129
Merge branch 'main' into mcmodel_crash
ShashwathiNavada Apr 15, 2025
fcbc340
Merge branch 'main' into mcmodel_crash
ShashwathiNavada Apr 15, 2025
d2cf187
Merge branch 'llvm:main' into mcmodel_crash
ShashwathiNavada Apr 15, 2025
8e2b440
Suggested changes completed
Apr 15, 2025
12e4423
Merge branch 'main' into mcmodel_crash
ShashwathiNavada Apr 15, 2025
215aa42
Update Driver.cpp
ShashwathiNavada Apr 15, 2025
39e7667
Merge branch 'llvm:main' into mcmodel_crash
ShashwathiNavada Apr 22, 2025
2024997
Merge branch 'llvm:main' into mcmodel_crash
ShashwathiNavada Apr 27, 2025
075a921
Removed check from driver.cpp and corrected existing one in CommonArg…
Apr 29, 2025
742ea57
removed unnecessary test
Apr 29, 2025
59985ea
minor change
Apr 29, 2025
0c14a0c
Update ReleaseNotes.rst
ShashwathiNavada May 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions clang/lib/Driver/ToolChains/CommonArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2936,8 +2936,7 @@ void tools::addMCModel(const Driver &D, const llvm::opt::ArgList &Args,
Ok = CM == "small" || CM == "medium" ||
(CM == "large" && Triple.isRISCV64());
} else if (Triple.getArch() == llvm::Triple::x86_64) {
Ok = llvm::is_contained({"small", "kernel", "medium", "large", "tiny"},
CM);
Ok = llvm::is_contained({"small", "kernel", "medium", "large"}, CM);
} else if (Triple.isNVPTX() || Triple.isAMDGPU() || Triple.isSPIRV()) {
// NVPTX/AMDGPU/SPIRV does not care about the code model and will accept
// whatever works for the host.
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Driver/mcmodel.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: not %clang -### -c --target=i686 -mcmodel=medium %s 2>&1 | FileCheck --check-prefix=ERR-MEDIUM %s
// RUN: %clang --target=x86_64 -### -c -mcmodel=tiny %s 2>&1 | FileCheck --check-prefix=TINY %s
// RUN: not %clang --target=x86_64 -### -c -mcmodel=tiny %s 2>&1 | FileCheck --check-prefix=ERR-TINY %s
// RUN: %clang --target=x86_64 -### -c -mcmodel=small %s 2>&1 | FileCheck --check-prefix=SMALL %s
// RUN: %clang --target=x86_64 -### -S -mcmodel=kernel %s 2>&1 | FileCheck --check-prefix=KERNEL %s
// RUN: %clang --target=x86_64 -### -c -mcmodel=medium %s 2>&1 | FileCheck --check-prefix=MEDIUM %s
Expand Down
Loading