Make a copy of the string before mutation

This commit is contained in:
Arnold Schwaighofer
2017-06-30 11:20:11 -07:00
parent 1e794cdebf
commit 8b2d85fee1

View File

@@ -814,7 +814,7 @@ llvm::AttributeSet IRGenModule::constructInitialAttributes() {
attrsUpdated = attrsUpdated.addAttribute(LLVMContext,
llvm::AttributeSet::FunctionIndex, "target-cpu", CPU);
std::vector<std::string> &Features = ClangOpts.Features;
std::vector<std::string> Features = ClangOpts.Features;
if (!Features.empty()) {
SmallString<64> allFeatures;
// Sort so that the target features string is canonical.