From bacb98873594c6c5df06dad6bb54f7fd396c175f Mon Sep 17 00:00:00 2001 From: "Bhushan D. Attarde" Date: Fri, 4 Mar 2016 06:56:29 +0000 Subject: [PATCH] [MIPS] initFeatureMap() to handle empty string argument SUMMARY: This patch sets CPU string to its default value when it is not supplied by caller. Reviewers: vkalintiris, dsanders Subscribers: mohit.bhakkad, sagar, jaydeep, cfe-commits Differential Revision: http://reviews.llvm.org/D16139 llvm-svn: 262691 --- clang/lib/Basic/Targets.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 9f0fb902f389..db86b93f0882 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -6689,6 +6689,8 @@ public: initFeatureMap(llvm::StringMap &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector &FeaturesVec) const override { + if (CPU.empty()) + CPU = getCPU(); if (CPU == "octeon") Features["mips64r2"] = Features["cnmips"] = true; else