Skip to content

Commit 5d4eb70

Browse files
authored
Revert "[Driver] Reject -mcmodel=tiny on X86 (#125643)"
This reverts commit c53e583.
1 parent 43c514b commit 5d4eb70

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clang/lib/Driver/ToolChains/CommonArgs.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -2938,7 +2938,8 @@ void tools::addMCModel(const Driver &D, const llvm::opt::ArgList &Args,
29382938
Ok = CM == "small" || CM == "medium" ||
29392939
(CM == "large" && Triple.isRISCV64());
29402940
} else if (Triple.getArch() == llvm::Triple::x86_64) {
2941-
Ok = llvm::is_contained({"small", "kernel", "medium", "large"}, CM);
2941+
Ok = llvm::is_contained({"small", "kernel", "medium", "large", "tiny"},
2942+
CM);
29422943
} else if (Triple.isNVPTX() || Triple.isAMDGPU() || Triple.isSPIRV()) {
29432944
// NVPTX/AMDGPU/SPIRV does not care about the code model and will accept
29442945
// whatever works for the host.

clang/test/Driver/mcmodel.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: not %clang -### -c --target=i686 -mcmodel=medium %s 2>&1 | FileCheck --check-prefix=ERR-MEDIUM %s
2-
// RUN: not %clang --target=x86_64 -### -c -mcmodel=tiny %s 2>&1 | FileCheck --check-prefix=ERR-TINY %s
2+
// RUN: %clang --target=x86_64 -### -c -mcmodel=tiny %s 2>&1 | FileCheck --check-prefix=TINY %s
33
// RUN: %clang --target=x86_64 -### -c -mcmodel=small %s 2>&1 | FileCheck --check-prefix=SMALL %s
44
// RUN: %clang --target=x86_64 -### -S -mcmodel=kernel %s 2>&1 | FileCheck --check-prefix=KERNEL %s
55
// RUN: %clang --target=x86_64 -### -c -mcmodel=medium %s 2>&1 | FileCheck --check-prefix=MEDIUM %s

0 commit comments

Comments
 (0)