/// language options which change the target configuration.
virtual void adjust(const LangOptions &Opts);
- /// \brief Get the default set of target features for the CPU;
- /// this should include all legal feature strings on the target.
- virtual void getDefaultFeatures(llvm::StringMap<bool> &Features) const {
- }
+ /// \brief Initialize the map with the default set of target features for the
+ /// CPU, ABI, and FPMath options - these should have already been set prior
+ /// to calling this function; this should include all legal feature strings on
+ /// the target.
+ virtual void initDefaultFeatures(llvm::StringMap<bool> &Features) const {}
/// \brief Get the ABI currently in use.
virtual StringRef getABI() const { return StringRef(); }
void getTargetDefines(const LangOptions &Opts,
MacroBuilder &Builder) const override;
- void getDefaultFeatures(llvm::StringMap<bool> &Features) const override;
+ void initDefaultFeatures(llvm::StringMap<bool> &Features) const override;
bool handleTargetFeatures(std::vector<std::string> &Features,
DiagnosticsEngine &Diags) override;
// __NO_FPRS__
}
-void PPCTargetInfo::getDefaultFeatures(llvm::StringMap<bool> &Features) const {
+void PPCTargetInfo::initDefaultFeatures(llvm::StringMap<bool> &Features) const {
Features["altivec"] = llvm::StringSwitch<bool>(CPU)
.Case("7400", true)
.Case("g4", true)
-mcpu=pwr8 -mno-vsx (should disable vsx and everything that depends on it)
-mcpu=pwr8 -mdirect-move -mno-vsx (should actually be diagnosed)
-NOTE: Do not call this from PPCTargetInfo::getDefaultFeatures
+NOTE: Do not call this from PPCTargetInfo::initDefaultFeatures
*/
void PPCTargetInfo::setFeatureEnabled(llvm::StringMap<bool> &Features,
StringRef Name, bool Enabled) const {
setFeatureEnabledImpl(Features, Name, Enabled);
}
// This exists purely to cut down on the number of virtual calls in
- // getDefaultFeatures which calls this repeatedly.
+ // initDefaultFeatures which calls this repeatedly.
static void setFeatureEnabledImpl(llvm::StringMap<bool> &Features,
StringRef Name, bool Enabled);
- void getDefaultFeatures(llvm::StringMap<bool> &Features) const override;
+ void initDefaultFeatures(llvm::StringMap<bool> &Features) const override;
bool hasFeature(StringRef Feature) const override;
bool handleTargetFeatures(std::vector<std::string> &Features,
DiagnosticsEngine &Diags) override;
return false;
}
-void X86TargetInfo::getDefaultFeatures(llvm::StringMap<bool> &Features) const {
+void X86TargetInfo::initDefaultFeatures(llvm::StringMap<bool> &Features) const {
// FIXME: This *really* should not be here.
// X86_64 always has SSE2.
}
// FIXME: This should be based on Arch attributes, not CPU names.
- void getDefaultFeatures(llvm::StringMap<bool> &Features) const override {
+ void initDefaultFeatures(llvm::StringMap<bool> &Features) const override {
if (CPU == "arm1136jf-s" || CPU == "arm1176jzf-s" || CPU == "mpcore")
Features["vfp2"] = true;
else if (CPU == "cortex-a8" || CPU == "cortex-a9") {
return CPUKnown;
}
- void getDefaultFeatures(llvm::StringMap<bool> &Features) const override {
+ void initDefaultFeatures(llvm::StringMap<bool> &Features) const override {
if (CPU == "zEC12")
Features["transactional-execution"] = true;
if (CPU == "z13") {
.Default(false);
}
const std::string& getCPU() const { return CPU; }
- void getDefaultFeatures(llvm::StringMap<bool> &Features) const override {
+ void initDefaultFeatures(llvm::StringMap<bool> &Features) const override {
if (CPU == "octeon")
Features["mips64r2"] = Features["cnmips"] = true;
else
// Compute the default target features, we need the target to handle this
// because features may have dependencies on one another.
llvm::StringMap<bool> Features;
- Target->getDefaultFeatures(Features);
+ Target->initDefaultFeatures(Features);
// Apply the user specified deltas.
for (const auto &F : Opts->FeaturesAsWritten) {