diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp index 9562a2cc2cc83..5bad7146895d7 100644 --- a/clang/lib/Driver/Compilation.cpp +++ b/clang/lib/Driver/Compilation.cpp @@ -99,7 +99,7 @@ static void HandleXarchArgs(DerivedArgList *OffloadArgList, const Driver &D, OffloadArgList->MakeArgStringRef(XarchVecs[Index])); } } else - XarchValueRefs.push_back(StringRef(XarchV)); + XarchValueRefs.push_back(OffloadArgList->MakeArgString(XarchV)); } if (NeedHandle) {