Skip to content

Commit 88edd04

Browse files
committed
Fix getValue() return type - returns const char* not string
1 parent 75f7c25 commit 88edd04

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clang/lib/Driver/ToolChains/Gnu.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
596596
if (ToolChain.getDriver().HasPizfix) {
597597
std::string BasePath;
598598
if (Arg *A = Args.getLastArg(options::OPT_filc_crt_path))
599-
BasePath = A->getValue().str();
599+
BasePath = A->getValue();
600600
else {
601601
SmallString<128> P(ToolChain.getDriver().PizfixRoot);
602602
llvm::sys::path::append(P, "lib");
@@ -690,7 +690,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
690690
if (ToolChain.getDriver().HasPizfix) {
691691
std::string BasePath;
692692
if (Arg *A = Args.getLastArg(options::OPT_filc_crt_path))
693-
BasePath = A->getValue().str();
693+
BasePath = A->getValue();
694694
else {
695695
SmallString<128> P(ToolChain.getDriver().PizfixRoot);
696696
llvm::sys::path::append(P, "lib");

clang/lib/Driver/ToolChains/Linux.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
459459
if ((true)) {
460460
// Check for explicit override flag
461461
if (Arg *A = Args.getLastArg(options::OPT_filc_dynamic_linker))
462-
return A->getValue().str();
462+
return std::string(A->getValue());
463463

464464
if (getDriver().HasPizfix) {
465465
SmallString<128> P(getDriver().PizfixRoot);
@@ -661,7 +661,7 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
661661
{
662662
std::string P;
663663
if (Arg *A = DriverArgs.getLastArg(options::OPT_filc_stdfil_include))
664-
P = A->getValue().str();
664+
P = A->getValue();
665665
else {
666666
SmallString<128> Path(D.PizfixRoot);
667667
llvm::sys::path::append(Path, "stdfil-include");
@@ -673,7 +673,7 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
673673
{
674674
std::string P;
675675
if (Arg *A = DriverArgs.getLastArg(options::OPT_filc_os_include))
676-
P = A->getValue().str();
676+
P = A->getValue();
677677
else {
678678
SmallString<128> Path(D.PizfixRoot);
679679
llvm::sys::path::append(Path, "os-include");
@@ -686,7 +686,7 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
686686
&& !DriverArgs.hasArg(options::OPT_nostdlibinc)) {
687687
std::string P;
688688
if (Arg *A = DriverArgs.getLastArg(options::OPT_filc_include))
689-
P = A->getValue().str();
689+
P = A->getValue();
690690
else {
691691
SmallString<128> Path(D.PizfixRoot);
692692
llvm::sys::path::append(Path, "include");

0 commit comments

Comments
 (0)