diff options
author | Chris Lattner <sabre@nondot.org> | 2008-12-05 00:10:44 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-12-05 00:10:44 +0000 |
commit | 802db9b4d5fba62890447bea39d637896a920e44 (patch) | |
tree | c80761fbeac39a7241e755aca68933696ba2f2de | |
parent | 4c3580e5f9d1804fa08fecca76ad5089bc9965fe (diff) |
-std=c99 defaults blocks to off even on darwin, but -fblocks overrides
even it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60568 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Driver/clang.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Driver/clang.cpp b/Driver/clang.cpp index 303bfe757f..c9022e4b57 100644 --- a/Driver/clang.cpp +++ b/Driver/clang.cpp @@ -569,8 +569,16 @@ static void InitializeLanguageStandard(LangOptions &Options, LangKind LK, // Mimicing gcc's behavior, trigraphs are only enabled if -trigraphs or -ansi // is specified, or -std is set to a conforming mode. - Options.Trigraphs = LangStd < lang_gnu_START || Trigraphs ? 1 : 0; - + Options.Trigraphs = LangStd < lang_gnu_START; + if (Trigraphs.getPosition()) + Options.Trigraphs = Trigraphs; // Command line option wins. + + // If in a conformant language mode (e.g. -std=c99) Blocks defaults to off + // even if they are normally on for the target. In GNU modes (e.g. + // -std=gnu99) the default for blocks depends on the target settings. + if (LangStd < lang_gnu_START) + Options.Blocks = 0; + Options.DollarIdents = 1; // FIXME: Really a target property. if (PascalStrings.getPosition()) Options.PascalStrings = PascalStrings; |