chrib created this revision.
Herald added a subscriber: cfe-commits.
Fix an assertion when -print-prog-name=
Repository:
rC Clang
https://reviews.llvm.org/D45814
Files:
lib/Driver/Driver.cpp
Index: lib/Driver/Driver.cpp
===================================================================
--- lib/Driver/Driver.cpp
+++ lib/Driver/Driver.cpp
@@ -4053,6 +4053,11 @@
}
std::string Driver::GetProgramPath(StringRef Name, const ToolChain &TC) const {
+
+ // Null program name cannot have a path.
+ if (Name.empty())
+ return Name.str();
+
SmallVector<std::string, 2> TargetSpecificExecutables;
generatePrefixedToolNames(Name, TC, TargetSpecificExecutables);
Index: lib/Driver/Driver.cpp
===================================================================
--- lib/Driver/Driver.cpp
+++ lib/Driver/Driver.cpp
@@ -4053,6 +4053,11 @@
}
std::string Driver::GetProgramPath(StringRef Name, const ToolChain &TC) const {
+
+ // Null program name cannot have a path.
+ if (Name.empty())
+ return Name.str();
+
SmallVector<std::string, 2> TargetSpecificExecutables;
generatePrefixedToolNames(Name, TC, TargetSpecificExecutables);
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits