and into TargetInfo::adjust so that it gets called in more places
throughout the compiler (AST serialization in particular).
Should fix PPC modules after removing of faltivec.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298487
91177308-0d34-0410-b5e6-
96231b3b80d8
/// \brief Set forced language options.
///
/// Apply changes to the target information with respect to certain
- /// language options which change the target configuration.
- virtual void adjust(const LangOptions &Opts);
+ /// language options which change the target configuration and adjust
+ /// the language based on the target options where applicable.
+ virtual void adjust(LangOptions &Opts);
/// \brief Adjust target options based on codegen options.
virtual void adjustTargetOptions(const CodeGenOptions &CGOpts,
/// adjust - Set forced language options.
/// Apply changes to the target information with respect to certain
-/// language options which change the target configuration.
-void TargetInfo::adjust(const LangOptions &Opts) {
+/// language options which change the target configuration and adjust
+/// the language based on the target options where applicable.
+void TargetInfo::adjust(LangOptions &Opts) {
if (Opts.NoBitFieldTypeAlign)
UseBitFieldTypeAlignment = false;
if (Opts.ShortWChar)
ArchDefineA2q = 1 << 15
} ArchDefineTypes;
+ // Set the language option for altivec based on our value.
+ void adjust(LangOptions &Opts) override {
+ if (HasAltivec)
+ Opts.AltiVec = 1;
+ TargetInfo::adjust(Opts);
+ }
+
// Note: GCC recognizes the following additional cpus:
// 401, 403, 405, 405fp, 440fp, 464, 464fp, 476, 476fp, 505, 740, 801,
// 821, 823, 8540, 8548, e300c2, e300c3, e500mc64, e6500, 860, cell,
if (!hasTarget())
return false;
- // FIXME: Setting this here is less than ideal, but it is set based on a
- // target option for compatibility and this is immediately after we construct
- // a target.
- if (getTarget().hasFeature("altivec"))
- getLangOpts().AltiVec = 1;
-
// Create TargetInfo for the other side of CUDA compilation.
if (getLangOpts().CUDA && !getFrontendOpts().AuxTriple.empty()) {
auto TO = std::make_shared<TargetOptions>();