Better error message.
authorMikhail Glushenkov <foldr@codedgers.com>
Tue, 26 Jan 2010 14:55:16 +0000 (14:55 +0000)
committerMikhail Glushenkov <foldr@codedgers.com>
Tue, 26 Jan 2010 14:55:16 +0000 (14:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94544 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CompilerDriver/CompilationGraph.cpp

index 56e5b9ce076161d04d10ff97fb910b1b5b194dcc..524607bee779633f14bb408d459d73dad6d53eed 100644 (file)
@@ -33,9 +33,11 @@ using namespace llvmc;
 namespace llvmc {
 
   const std::string& LanguageMap::GetLanguage(const sys::Path& File) const {
-    LanguageMap::const_iterator Lang = this->find(File.getSuffix());
+    StringRef suf = File.getSuffix();
+    LanguageMap::const_iterator Lang = this->find(suf);
     if (Lang == this->end())
-      throw std::runtime_error(("Unknown suffix: " + File.getSuffix()).str());
+      throw std::runtime_error("File '" + File.str() +
+                                "' has unknown suffix '" + suf.str() + '\'');
     return Lang->second;
   }
 }