diff options
-rw-r--r-- | test/Misc/remap-file.c | 6 | ||||
-rw-r--r-- | tools/CIndex/CIndex.cpp | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/test/Misc/remap-file.c b/test/Misc/remap-file.c index da10590ccd..f12fe95012 100644 --- a/test/Misc/remap-file.c +++ b/test/Misc/remap-file.c @@ -1,6 +1,6 @@ -// RUN: clang-cc -remap-file="%s;%S/Inputs/remapped-file" -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-EXIST %s -// RUN: clang-cc -remap-file="%S/nonexistent.c;%S/Inputs/remapped-file" -fsyntax-only %S/nonexistent.c 2>&1 | FileCheck -check-prefix=CHECK-NONEXIST %s -// RUN: clang-cc -remap-file="%S/nonexistent.c;%S/Inputs/remapped-file-2" -remap-file="%S/nonexistent.h;%S/Inputs/remapped-file-3" -fsyntax-only %S/nonexistent.c 2>&1 | FileCheck -check-prefix=CHECK-HEADER %s +// RUN: clang-cc -remap-file "%s;%S/Inputs/remapped-file" -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-EXIST %s +// RUN: clang-cc -remap-file "%S/nonexistent.c;%S/Inputs/remapped-file" -fsyntax-only %S/nonexistent.c 2>&1 | FileCheck -check-prefix=CHECK-NONEXIST %s +// RUN: clang-cc -remap-file "%S/nonexistent.c;%S/Inputs/remapped-file-2" -remap-file "%S/nonexistent.h;%S/Inputs/remapped-file-3" -fsyntax-only %S/nonexistent.c 2>&1 | FileCheck -check-prefix=CHECK-HEADER %s // CHECK-EXIST: remap-file.c:1:28: warning: incompatible pointer types // CHECK-NONEXIST: nonexistent.c:1:28: warning: incompatible pointer types diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp index 8ef9fb5ca0..432f4a09ee 100644 --- a/tools/CIndex/CIndex.cpp +++ b/tools/CIndex/CIndex.cpp @@ -1211,13 +1211,14 @@ void clang_codeComplete(CXIndex CIdx, // Add the appropriate '-code-completion-at=file:line:column' argument // to perform code completion, with an "-Xclang" preceding it. std::string code_complete_at; - code_complete_at += "-code-completion-at="; code_complete_at += complete_filename; code_complete_at += ":"; code_complete_at += llvm::utostr(complete_line); code_complete_at += ":"; code_complete_at += llvm::utostr(complete_column); argv.push_back("-Xclang"); + argv.push_back("-code-completion-at"); + argv.push_back("-Xclang"); argv.push_back(code_complete_at.c_str()); argv.push_back("-Xclang"); argv.push_back("-no-code-completion-debug-printer"); @@ -1242,11 +1243,12 @@ void clang_codeComplete(CXIndex CIdx, } // Remap the file. - std::string RemapArg = "-remap-file="; - RemapArg += unsaved_files[i].Filename; + std::string RemapArg = unsaved_files[i].Filename; RemapArg += ';'; RemapArg += tmpFileName; RemapArgs.push_back("-Xclang"); + RemapArgs.push_back("-remap-file"); + RemapArgs.push_back("-Xclang"); RemapArgs.push_back(RemapArg); TemporaryFiles.push_back(SavedFile); } |