]> granicus.if.org Git - clang/commitdiff
[libclang] Don't bind a StringRef to a temporary std::string object.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 28 Jun 2012 21:03:08 +0000 (21:03 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 28 Jun 2012 21:03:08 +0000 (21:03 +0000)
It may end up pointing at garbage.

Fixes the MSVC debug build. rdar://11703319

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159377 91177308-0d34-0410-b5e6-96231b3b80d8

tools/libclang/Indexing.cpp

index e660c4d6eb486e7b1127d0e653757c3aeb334e2b..6b681340f1a984755b41af6478e49015d1bedef9 100644 (file)
@@ -369,7 +369,6 @@ static void clang_indexSourceFile_Impl(void *UserData) {
     IndexActionCleanup(IndexAction.get());
 
   bool Persistent = requestedToGetTU;
-  StringRef ResourceFilesPath = CXXIdx->getClangResourcesPath();
   bool OnlyLocalDecls = false;
   bool PrecompilePreamble = false;
   bool CacheCodeCompletionResults = false;
@@ -393,7 +392,7 @@ static void clang_indexSourceFile_Impl(void *UserData) {
                                                        IndexAction.get(),
                                                        Unit,
                                                        Persistent,
-                                                       ResourceFilesPath,
+                                                CXXIdx->getClangResourcesPath(),
                                                        OnlyLocalDecls,
                                                     /*CaptureDiagnostics=*/true,
                                                        PrecompilePreamble,