saugustine created this revision.
saugustine added a reviewer: echristo.
Herald added a reviewer: JDevlieghere.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
saugustine requested review of this revision.

Such as the one in the darwin-dsymutil.c test.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85231

Files:
  clang/lib/Driver/Driver.cpp


Index: clang/lib/Driver/Driver.cpp
===================================================================
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -4675,6 +4675,8 @@
     std::string::size_type End = std::string::npos;
     if (!types::appendSuffixForType(JA.getType()))
       End = BaseName.rfind('.');
+    if (End == StringRef::npos)
+      End = BaseName.size();
     SmallString<128> Suffixed(BaseName.substr(0, End));
     Suffixed += OffloadingPrefix;
     if (MultipleArchs && !BoundArch.empty()) {


Index: clang/lib/Driver/Driver.cpp
===================================================================
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -4675,6 +4675,8 @@
     std::string::size_type End = std::string::npos;
     if (!types::appendSuffixForType(JA.getType()))
       End = BaseName.rfind('.');
+    if (End == StringRef::npos)
+      End = BaseName.size();
     SmallString<128> Suffixed(BaseName.substr(0, End));
     Suffixed += OffloadingPrefix;
     if (MultipleArchs && !BoundArch.empty()) {
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to