File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,25 @@ enum class InputFileKind {
33
33
// Inputs may include buffers that override contents, and eventually should
34
34
// always include a buffer.
35
35
class InputFile {
36
+ // / An \c InputFile encapsulates information about an input passed to the
37
+ // / frontend.
38
+ // /
39
+ // / Compiler inputs are usually passed on the command line without a leading
40
+ // / flag. However, there are clients that use the \c CompilerInvocation as
41
+ // / a library like LLDB and SourceKit that generate their own \c InputFile
42
+ // / instances programmatically. Note that an \c InputFile need not actually be
43
+ // / backed by a physical file, nor does its file name actually reflect its
44
+ // / contents. \c InputFile has a constructor that will try to figure out the file
45
+ // / type from the file name if none is provided, but many clients that
46
+ // / construct \c InputFile instances themselves may provide bogus file names
47
+ // / with pre-computed kinds. It is imperative that \c InputFile::getType be used
48
+ // / as a source of truth for this information.
49
+ // /
50
+ // / \warning \c InputFile takes an unfortunately lax view of the ownership of
51
+ // / its primary data. It currently only owns the file name and a copy of any
52
+ // / assigned \c PrimarySpecificPaths outright. It is the responsibility of the
53
+ // / caller to ensure that an associated memory buffer outlives the \c InputFile.
54
+ class InputFile final {
36
55
std::string Filename;
37
56
bool IsPrimary;
38
57
// / Points to a buffer overriding the file's contents, or nullptr if there is
You can’t perform that action at this time.
0 commit comments