@@ -130,7 +130,8 @@ std::string sparc::getSparcTargetCPU(const Driver &D, const ArgList &Args,
130
130
return " " ;
131
131
}
132
132
133
- void sparc::getSparcTargetFeatures (const Driver &D, const ArgList &Args,
133
+ void sparc::getSparcTargetFeatures (const Driver &D, const llvm::Triple &Triple,
134
+ const ArgList &Args,
134
135
std::vector<StringRef> &Features) {
135
136
sparc::FloatABI FloatABI = sparc::getSparcFloatABI (D, Args);
136
137
if (FloatABI == sparc::FloatABI::Soft)
@@ -150,11 +151,19 @@ void sparc::getSparcTargetFeatures(const Driver &D, const ArgList &Args,
150
151
Features.push_back (" -popc" );
151
152
}
152
153
154
+ // Those OSes default to enabling VIS on 64-bit SPARC.
155
+ // See also the corresponding code for external assemblers in
156
+ // sparc::getSparcAsmModeForCPU().
157
+ bool IsSparcV9ATarget =
158
+ (Triple.getArch () == llvm::Triple::sparcv9) &&
159
+ (Triple.isOSLinux () || Triple.isOSFreeBSD () || Triple.isOSOpenBSD ());
153
160
if (Arg *A = Args.getLastArg (options::OPT_mvis, options::OPT_mno_vis)) {
154
161
if (A->getOption ().matches (options::OPT_mvis))
155
162
Features.push_back (" +vis" );
156
163
else
157
164
Features.push_back (" -vis" );
165
+ } else if (IsSparcV9ATarget) {
166
+ Features.push_back (" +vis" );
158
167
}
159
168
160
169
if (Arg *A = Args.getLastArg (options::OPT_mvis2, options::OPT_mno_vis2)) {
0 commit comments