Skip to content

Commit dc275e9

Browse files
committed
update comment for getMinHeaderInsertionOffset
1 parent e044938 commit dc275e9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

clang/lib/Tooling/Inclusions/HeaderIncludes.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,11 @@ bool checkAndConsumeModuleDecl(const SourceManager &SM, Lexer &Lex,
8383
return Matched;
8484
}
8585

86-
// If file does not use modules, returns the offset after header guard
87-
// directives and any comments before/after header guards (e.g.
88-
// `#ifndef/#define` pair, `#pragma once`). If no header guard is present in the
89-
// code, this will return the offset after skipping all comments from the start
90-
// of the code. If modules are in use, the offset will be in the global module
91-
// fragment.
86+
// Determines the minimum offset into the file where we want to insert header
87+
// includes. This will be put (when available):
88+
// - after `#pragma once`
89+
// - after header guards (`#ifdef` and `#define`)
90+
// - after opening global module (`module;`)
9291
unsigned getMinHeaderInsertionOffset(StringRef FileName, StringRef Code,
9392
const IncludeStyle &Style) {
9493
// \p Consume returns location after header guard or 0 if no header guard is

0 commit comments

Comments
 (0)