clang
20.0.0git
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
y
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
o
p
q
r
s
t
u
v
w
Enumerations
_
a
b
c
f
g
i
l
m
n
o
p
r
s
t
v
Enumerator
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Examples
include
clang
Tooling
Inclusions
HeaderAnalysis.h
Go to the documentation of this file.
1
//===--- HeaderAnalysis.h -----------------------------------------*-C++-*-===//
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
#ifndef LLVM_CLANG_TOOLING_INCLUSIONS_HEADER_ANALYSIS_H
10
#define LLVM_CLANG_TOOLING_INCLUSIONS_HEADER_ANALYSIS_H
11
12
#include "
clang/Basic/FileEntry.h
"
13
#include "llvm/ADT/StringRef.h"
14
#include <optional>
15
16
namespace
clang
{
17
class
SourceManager;
18
class
HeaderSearch
;
19
20
namespace
tooling {
21
22
/// Returns true if the given physical file is a self-contained header.
23
///
24
/// A header is considered self-contained if
25
// - it has a proper header guard or has been #imported or contains #import(s)
26
// - *and* it doesn't have a dont-include-me pattern.
27
///
28
/// This function can be expensive as it may scan the source code to find out
29
/// dont-include-me pattern heuristically.
30
bool
isSelfContainedHeader
(FileEntryRef FE,
const
SourceManager &
SM
,
31
const
HeaderSearch &HeaderInfo);
32
33
/// This scans the given source code to see if it contains #import(s).
34
bool
codeContainsImports
(llvm::StringRef Code);
35
36
/// If Text begins an Include-What-You-Use directive, returns it.
37
/// Given "// IWYU pragma: keep", returns "keep".
38
/// Input is a null-terminated char* as provided by SM.getCharacterData().
39
/// (This should not be StringRef as we do *not* want to scan for its length).
40
/// For multi-line comments, we return only the first line.
41
std::optional<llvm::StringRef>
parseIWYUPragma
(
const
char
*
Text
);
42
43
}
// namespace tooling
44
}
// namespace clang
45
46
#endif
// LLVM_CLANG_TOOLING_INCLUSIONS_HEADER_ANALYSIS_H
SM
#define SM(sm)
Definition:
Cuda.cpp:84
FileEntry.h
Defines interfaces for clang::FileEntry and clang::FileEntryRef.
Text
StringRef Text
Definition:
Format.cpp:3052
clang::tooling::dependencies::ScanningOptimizations::HeaderSearch
@ HeaderSearch
Remove unused header search paths including header maps.
clang::tooling::codeContainsImports
bool codeContainsImports(llvm::StringRef Code)
This scans the given source code to see if it contains #import(s).
Definition:
HeaderAnalysis.cpp:83
clang::tooling::isSelfContainedHeader
bool isSelfContainedHeader(FileEntryRef FE, const SourceManager &SM, const HeaderSearch &HeaderInfo)
Returns true if the given physical file is a self-contained header.
Definition:
HeaderAnalysis.cpp:69
clang::tooling::parseIWYUPragma
std::optional< llvm::StringRef > parseIWYUPragma(const char *Text)
If Text begins an Include-What-You-Use directive, returns it.
Definition:
HeaderAnalysis.cpp:95
clang
The JSON file list parser is used to communicate input to InstallAPI.
Definition:
CalledOnceCheck.h:17
Generated on Mon Mar 31 2025 21:04:48 for clang by
1.9.6