hchilama created this revision. hchilama created this object with edit policy "Administrators". Herald added a project: All. hchilama requested review of this revision. Herald added subscribers: cfe-commits, MaskRay. Herald added a project: clang.
Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D158254 Files: clang/lib/Driver/ToolChains/ZOS.cpp Index: clang/lib/Driver/ToolChains/ZOS.cpp =================================================================== --- clang/lib/Driver/ToolChains/ZOS.cpp +++ clang/lib/Driver/ToolChains/ZOS.cpp @@ -188,11 +188,10 @@ CmdArgs.push_back( Args.MakeArgString("//'" + LEHLQ + ".SCEELIB(CELQS003)'")); } else { - char *ld_side_deck = strdup(ld_env_var.str().c_str()); - ld_side_deck = strtok(ld_side_deck, ":"); - while (ld_side_deck != nullptr) { - CmdArgs.push_back(ld_side_deck); - ld_side_deck = strtok(nullptr, ":"); + SmallVector<StringRef> ld_side_deck; + ld_env_var.split(ld_side_deck, ":"); + for (StringRef ld_loc : ld_side_deck) { + CmdArgs.push_back((ld_loc.str()).c_str()); } } }
Index: clang/lib/Driver/ToolChains/ZOS.cpp =================================================================== --- clang/lib/Driver/ToolChains/ZOS.cpp +++ clang/lib/Driver/ToolChains/ZOS.cpp @@ -188,11 +188,10 @@ CmdArgs.push_back( Args.MakeArgString("//'" + LEHLQ + ".SCEELIB(CELQS003)'")); } else { - char *ld_side_deck = strdup(ld_env_var.str().c_str()); - ld_side_deck = strtok(ld_side_deck, ":"); - while (ld_side_deck != nullptr) { - CmdArgs.push_back(ld_side_deck); - ld_side_deck = strtok(nullptr, ":"); + SmallVector<StringRef> ld_side_deck; + ld_env_var.split(ld_side_deck, ":"); + for (StringRef ld_loc : ld_side_deck) { + CmdArgs.push_back((ld_loc.str()).c_str()); } } }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits