From e9cdcaee7be23e67121d8e940c0eb67e22a77635 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 1 Sep 2015 18:13:20 +0000 Subject: Pull initFeatureMap out of line now that it's used in multiple places. llvm-svn: 246565 --- clang/lib/Basic/TargetInfo.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'clang/lib/Basic/TargetInfo.cpp') diff --git a/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp index 30378a5a751..aa7385eb005 100644 --- a/clang/lib/Basic/TargetInfo.cpp +++ b/clang/lib/Basic/TargetInfo.cpp @@ -311,6 +311,18 @@ void TargetInfo::adjust(const LangOptions &Opts) { } } +bool TargetInfo::initFeatureMap(llvm::StringMap &Features, + DiagnosticsEngine &Diags, StringRef CPU, + std::vector &FeatureVec) const { + for (const auto &F : FeatureVec) { + const char *Name = F.c_str(); + // Apply the feature via the target. + bool Enabled = Name[0] == '+'; + setFeatureEnabled(Features, Name + 1, Enabled); + } + return true; +} + //===----------------------------------------------------------------------===// -- cgit v1.2.3