summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2022-08-24 19:56:31 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2022-08-25 14:17:26 +0000
commitbd28bd59a3693b6abc12231f2140e02760c0ada0 (patch)
tree465aff6a1e096b86c260c515ff6e9ebe8d039777 /clang/lib/CodeGen/CodeGenModule.cpp
parentc0a55121618b2f3f5db613cfb0d104a9ae2b700e (diff)
[clang-cl] /kernel should toggle bit 30 in @feat.00
The linker is supposed to detect when an object with /kernel is linked with another object which is not compiled with /kernel. The linker detects this by checking bit 30 in @feat.00.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 6238a289978d..9df197056664 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -697,6 +697,10 @@ void CodeGenModule::Release() {
// Function ID tables for EH Continuation Guard.
getModule().addModuleFlag(llvm::Module::Warning, "ehcontguard", 1);
}
+ if (Context.getLangOpts().Kernel) {
+ // Note if we are compiling with /kernel.
+ getModule().addModuleFlag(llvm::Module::Warning, "ms-kernel", 1);
+ }
if (CodeGenOpts.OptimizationLevel > 0 && CodeGenOpts.StrictVTablePointers) {
// We don't support LTO with 2 with different StrictVTablePointers
// FIXME: we could support it by stripping all the information introduced