The Darwin kernel does not provide useful guard variable support.
Issue this as an IR-gen error; it's not really worthwhile doing this "right", i.e. in Sema, because IR gen knows a lot of tricks beyond what the constant evaluator knows. llvm-svn: 127854
This commit is contained in:
@@ -1138,6 +1138,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
if (getToolChain().getTriple().getOS() != llvm::Triple::Darwin)
|
||||
CmdArgs.push_back("-mconstructor-aliases");
|
||||
|
||||
// Darwin's kernel doesn't support guard variables; just die if we
|
||||
// try to use them.
|
||||
if (KernelOrKext &&
|
||||
getToolChain().getTriple().getOS() == llvm::Triple::Darwin)
|
||||
CmdArgs.push_back("-fforbid-guard-variables");
|
||||
|
||||
if (Args.hasArg(options::OPT_mms_bitfields)) {
|
||||
CmdArgs.push_back("-mms-bitfields");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user