1 //===-- MakeSuport.cpp --------------------------------------------------*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #include "clang/Basic/MakeSupport.h"
11 void clang::quoteMakeTarget(StringRef Target
, SmallVectorImpl
<char> &Res
) {
12 for (unsigned i
= 0, e
= Target
.size(); i
!= e
; ++i
) {
16 // Escape the preceding backslashes
17 for (int j
= i
- 1; j
>= 0 && Target
[j
] == '\\'; --j
)
20 // Escape the space/tab
33 Res
.push_back(Target
[i
]);