aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2022-04-08 10:22:09 -0400
committerAaron Ballman <aaron@aaronballman.com>2022-04-08 10:26:16 -0400
commitbe9371659380388a693ec99624e1f3d02f07047f (patch)
tree0e99843eb2b1fbdcbe48bb758c2f9693298adf1a /clang/lib/Frontend/CompilerInvocation.cpp
parentae377575b23b07107c08627357821a131a2ab1e0 (diff)
downloadllvm-be9371659380388a693ec99624e1f3d02f07047f.zip
llvm-be9371659380388a693ec99624e1f3d02f07047f.tar.gz
llvm-be9371659380388a693ec99624e1f3d02f07047f.tar.bz2
Clarify language option default value behavior; NFC
The LANGOPT macro allows you to specify a default value for the langauge option. However, it's expected that these values be constant rather than depending on other language options (because the constructor setting the default values does not know the language mode at the time it's being constructed). Some of our language options were abusing this and passing in other language mode options which were then set correctly by other parts of frontend initialization. This removes the default values for the language options, and then ensures they're consistently set from the same place when setting language standard defaults.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index f586f8d..83de27b 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -3263,6 +3263,8 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
Opts.GNUCVersion = 0;
Opts.HexFloats = Std.hasHexFloats();
Opts.ImplicitInt = Std.hasImplicitInt();
+ Opts.WChar = Std.isCPlusPlus();
+ Opts.Digraphs = Std.hasDigraphs();
Opts.HLSL = IK.getLanguage() == Language::HLSL;