clang
20.0.0git
lib
Basic
MakeSupport.cpp
Go to the documentation of this file.
1
//===-- MakeSuport.cpp --------------------------------------------------*-===//
2
//
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
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "
clang/Basic/MakeSupport.h
"
10
11
void
clang::quoteMakeTarget
(StringRef
Target
,
SmallVectorImpl<char>
&Res) {
12
for
(
unsigned
i = 0, e =
Target
.size(); i != e; ++i) {
13
switch
(
Target
[i]) {
14
case
' '
:
15
case
'\t'
:
16
// Escape the preceding backslashes
17
for
(
int
j = i - 1; j >= 0 &&
Target
[j] ==
'\\'
; --j)
18
Res.push_back(
'\\'
);
19
20
// Escape the space/tab
21
Res.push_back(
'\\'
);
22
break
;
23
case
'$'
:
24
Res.push_back(
'$'
);
25
break
;
26
case
'#'
:
27
Res.push_back(
'\\'
);
28
break
;
29
default
:
30
break
;
31
}
32
33
Res.push_back(
Target
[i]);
34
}
35
}
Target
llvm::MachO::Target Target
Definition:
MachO.h:51
MakeSupport.h
llvm::SmallVectorImpl
Definition:
Randstruct.h:18
clang::quoteMakeTarget
void quoteMakeTarget(StringRef Target, SmallVectorImpl< char > &Res)
Quote target names for inclusion in GNU Make dependency files.
Definition:
MakeSupport.cpp:11
Generated on Thu Nov 21 2024 14:03:04 for clang by
1.9.6