Fix Windows bot failure in Transforms/FunctionImport/funcimport.ll
authorTeresa Johnson <tejohnson@google.com>
Wed, 10 Feb 2016 23:47:38 +0000 (23:47 +0000)
committerTeresa Johnson <tejohnson@google.com>
Wed, 10 Feb 2016 23:47:38 +0000 (23:47 +0000)
Make sure we split ":" from the end of the global function id (which
is <path>:<function> for local functions) instead of the beginning to
avoid splitting at the wrong place for Windows file paths that contain
a ":".

llvm-svn: 260469

llvm/lib/Transforms/IPO/FunctionImport.cpp

index b3cdebb..89f3f9d 100644 (file)
@@ -252,7 +252,7 @@ GetImportList(Module &DestModule,
       // source file name prepended for functions that were originally local
       // in the source module. Strip any prepended name to recover the original
       // name in the source module.
-      std::pair<StringRef, StringRef> Split = CalledFunctionName.split(":");
+      std::pair<StringRef, StringRef> Split = CalledFunctionName.rsplit(':');
       SGV = SrcModule.getNamedValue(Split.second);
       assert(SGV && "Can't find function to import in source module");
     }