Skip to content

Commit d04fae7

Browse files
committed
LLVM and SPIRV-LLVM-Translator pulldown (WW37)
2 parents 4f41444 + e3b451a commit d04fae7

File tree

1,307 files changed

+51750
-24976
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,307 files changed

+51750
-24976
lines changed

clang-tools-extra/clangd/DumpAST.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ class DumpVisitor : public RecursiveASTVisitor<DumpVisitor> {
295295
}
296296
std::string getDetail(const TemplateName &TN) {
297297
return toString([&](raw_ostream &OS) {
298-
TN.print(OS, Ctx.getPrintingPolicy(), /*SuppressNNS=*/true);
298+
TN.print(OS, Ctx.getPrintingPolicy(), TemplateName::Qualified::None);
299299
});
300300
}
301301
std::string getDetail(const Attr *A) {

clang-tools-extra/clangd/PathMapping.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ llvm::Optional<std::string> doPathMapping(llvm::StringRef S,
4040
llvm::StringRef Body = Uri->body();
4141
if (Body.consume_front(From) && (Body.empty() || Body.front() == '/')) {
4242
std::string MappedBody = (To + Body).str();
43-
return URI(Uri->scheme(), Uri->authority(), MappedBody.c_str())
43+
return URI(Uri->scheme(), Uri->authority(), MappedBody)
4444
.toString();
4545
}
4646
}

clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ abseil-no-internal-dependencies
55

66
Warns if code using Abseil depends on internal details. If something is in a
77
namespace that includes the word "internal", code is not allowed to depend upon
8-
it beaucse it’s an implementation detail. They cannot friend it, include it,
8+
it because it’s an implementation detail. They cannot friend it, include it,
99
you mention it or refer to it in any way. Doing so violates Abseil's
1010
compatibility guidelines and may result in breakage. See
1111
https://abseil.io/about/compatibility for more information.

clang-tools-extra/docs/clang-tidy/checks/abseil-time-subtraction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Examples:
2525
int x;
2626
absl::Time t;
2727

28-
// Original - absl::Duration result and first operand is a absl::Time.
28+
// Original - absl::Duration result and first operand is an absl::Time.
2929
absl::Duration d = absl::Seconds(absl::ToUnixSeconds(t) - x);
3030

3131
// Suggestion - Perform subtraction in the Time domain instead.

clang-tools-extra/docs/clang-tidy/checks/bugprone-fold-init-type.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ the latter, with ``operator+`` by default. This can cause loss of precision
1111
through:
1212

1313
- Truncation: The following code uses a floating point range and an int
14-
initial value, so trucation will happen at every application of ``operator+``
14+
initial value, so truncation will happen at every application of ``operator+``
1515
and the result will be `0`, which might not be what the user expected.
1616

1717
.. code-block:: c++

clang-tools-extra/docs/clang-tidy/checks/bugprone-redundant-branch-condition.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ is an operand of a logical "and" (``&&``) or a logical "or" (``||``) operator:
4141
4242
In the first case (logical "and") the suggested fix is to remove the redundant
4343
condition variable and keep the other side of the ``&&``. In the second case
44-
(logical "or") the whole ``if`` is removed similarily to the simple case on the
44+
(logical "or") the whole ``if`` is removed similarly to the simple case on the
4545
top.
4646

4747
The condition of the outer ``if`` statement may also be a logical "and" (``&&``)

clang-tools-extra/docs/clang-tidy/checks/bugprone-signal-handler.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ and has an alias name ``cert-sig30-c``.
2020

2121
.. option:: AsyncSafeFunctionSet
2222

23-
Selects wich set of functions is considered as asynchronous-safe
23+
Selects which set of functions is considered as asynchronous-safe
2424
(and therefore allowed in signal handlers). Value ``minimal`` selects
2525
a minimal set that is defined in the CERT SIG30-C rule and includes functions
2626
``abort()``, ``_Exit()``, ``quick_exit()`` and ``signal()``. Value ``POSIX``

clang-tools-extra/docs/clang-tidy/checks/bugprone-suspicious-memory-comparison.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ arguments. The following cases are covered:
88

99
**Case 1: Non-standard-layout type**
1010

11-
Comparing the object representaions of non-standard-layout objects may not
11+
Comparing the object representations of non-standard-layout objects may not
1212
properly compare the value representations.
1313

1414
**Case 2: Types with no unique object representation**
1515

16-
Objects with the same value may not have the same object representaion.
16+
Objects with the same value may not have the same object representation.
1717
This may be caused by padding or floating-point types.
1818

1919
See also:

clang-tools-extra/docs/clang-tidy/checks/bugprone-too-small-loop-variable.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ a larger user input.
3333
Upper limit for the magnitude bits of the loop variable. If it's set the check
3434
filters out those catches in which the loop variable's type has more magnitude
3535
bits as the specified upper limit. The default value is 16.
36-
For example, if the user sets this option to 31 (bits), then a 32-bit ``unsigend int``
36+
For example, if the user sets this option to 31 (bits), then a 32-bit ``unsigned int``
3737
is ignored by the check, however a 32-bit ``int`` is not (A 32-bit ``signed int``
3838
has 31 magnitude bits).
3939

clang-tools-extra/docs/clang-tidy/checks/bugprone-unhandled-exception-at-new.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ is allowed to propagate out of the function (exception handler is checked for
2121
types ``std::bad_alloc``, ``std::exception``, and catch-all handler).
2222
The check assumes that any user-defined ``operator new`` is either
2323
``noexcept`` or may throw an exception of type ``std::bad_alloc`` (or derived
24-
from it). Other exception types or exceptions occuring in the objects's
24+
from it). Other exception types or exceptions occurring in the objects's
2525
constructor are not taken into account.

clang-tools-extra/docs/clang-tidy/checks/cert-oop57-cpp.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ Options
1111

1212
.. option:: MemSetNames
1313

14-
Specify extra functions to flag that act similarily to ``memset``.
14+
Specify extra functions to flag that act similarly to ``memset``.
1515
Specify names in a semicolon delimited list.
1616
Default is an empty string.
1717
The check will detect the following functions:
1818
`memset`, `std::memset`.
1919

2020
.. option:: MemCpyNames
2121

22-
Specify extra functions to flag that act similarily to ``memcpy``.
22+
Specify extra functions to flag that act similarly to ``memcpy``.
2323
Specify names in a semicolon delimited list.
2424
Default is an empty string.
2525
The check will detect the following functions:
@@ -28,7 +28,7 @@ Options
2828

2929
.. option:: MemCmpNames
3030

31-
Specify extra functions to flag that act similarily to ``memcmp``.
31+
Specify extra functions to flag that act similarly to ``memcmp``.
3232
Specify names in a semicolon delimited list.
3333
Default is an empty string.
3434
The check will detect the following functions:

clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-narrowing-conversions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Options
4444
.. option:: WarnWithinTemplateInstantiation
4545

4646
When `true`, the check will warn on narrowing conversions within template
47-
instantations. `false` by default.
47+
instantiations. `false` by default.
4848

4949
.. option:: WarnOnEquivalentBitWidth
5050

clang-tools-extra/docs/clang-tidy/checks/google-upgrade-googletest-case.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ becomes
4949

5050
For better consistency of user code, the check renames both virtual and
5151
non-virtual member functions with matching names in derived types. The check
52-
tries to provide a only warning when a fix cannot be made safely, as is the case
52+
tries to provide only a warning when a fix cannot be made safely, as is the case
5353
with some template and macro uses.

clang-tools-extra/docs/clang-tidy/checks/hicpp-no-assembler.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ hicpp-no-assembler
55

66
Check for assembler statements. No fix is offered.
77

8-
Inline assembler is forbidden by the `High Intergrity C++ Coding Standard
8+
Inline assembler is forbidden by the `High Integrity C++ Coding Standard
99
<http://www.codingstandard.com/section/7-5-the-asm-declaration/>`_
1010
as it restricts the portability of code.

clang-tools-extra/docs/clang-tidy/checks/readability-redundant-member-init.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Options
2929

3030
When `true`, the check will ignore unnecessary base class initializations
3131
within copy constructors, since some compilers issue warnings/errors when
32-
base classes are not explicitly intialized in copy constructors. For example,
32+
base classes are not explicitly initialized in copy constructors. For example,
3333
``gcc`` with ``-Wextra`` or ``-Werror=extra`` issues warning or error
3434
``base class 'Bar' should be explicitly initialized in the copy constructor``
3535
if ``Bar()`` were removed in the following example:

clang/docs/LanguageExtensions.rst

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3597,7 +3597,7 @@ specification, a stack is supported so that the ``pragma float_control``
35973597
settings can be pushed or popped.
35983598
35993599
When ``pragma float_control(precise, on)`` is enabled, the section of code
3600-
governed by the pragma uses precise floating-point semantics, effectively
3600+
governed by the pragma uses precise floating point semantics, effectively
36013601
``-ffast-math`` is disabled and ``-ffp-contract=on``
36023602
(fused multiply add) is enabled.
36033603
@@ -3608,29 +3608,8 @@ when ``pragma float_control(precise, off)`` is enabled, the section of code
36083608
governed by the pragma behaves as though the command-line option
36093609
``-ffp-exception-behavior=ignore`` is enabled.
36103610
3611-
When ``pragma float_control(source, on)`` is enabled, the section of code governed
3612-
by the pragma behaves as though the command-line option
3613-
``-ffp-eval-method=source`` is enabled. Note: The default
3614-
floating-point evaluation method is target-specific, typically ``source``.
3615-
3616-
When ``pragma float_control(double, on)`` is enabled, the section of code governed
3617-
by the pragma behaves as though the command-line option
3618-
``-ffp-eval-method=double`` is enabled.
3619-
3620-
When ``pragma float_control(extended, on)`` is enabled, the section of code governed
3621-
by the pragma behaves as though the command-line option
3622-
``-ffp-eval-method=extended`` is enabled.
3623-
3624-
When ``pragma float_control(source, off)`` or
3625-
``pragma float_control(double, off)`` or
3626-
``pragma float_control(extended, off)`` is enabled,
3627-
the section of code governed
3628-
by the pragma behaves as though the command-line option
3629-
``-ffp-eval-method=source`` is enabled, returning floating-point evaluation
3630-
method to the default setting.
3631-
36323611
The full syntax this pragma supports is
3633-
``float_control(except|precise|source|double|extended, on|off [, push])`` and
3612+
``float_control(except|precise, on|off [, push])`` and
36343613
``float_control(push|pop)``.
36353614
The ``push`` and ``pop`` forms, including using ``push`` as the optional
36363615
third argument, can only occur at file scope.

clang/docs/UsersManual.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,17 +1478,6 @@ Note that floating-point operations performed as part of constant initialization
14781478
* ``maytrap`` The compiler avoids transformations that may raise exceptions that would not have been raised by the original code. Constant folding performed by the compiler is exempt from this option.
14791479
* ``strict`` The compiler ensures that all transformations strictly preserve the floating point exception semantics of the original code.
14801480

1481-
.. option:: -ffp-eval-method=<value>
1482-
1483-
Specify the floating-point evaluation method.
1484-
1485-
Valid values are: ``source``, ``double``, and ``extended``.
1486-
The default value is target-specific, typically ``source``. Details:
1487-
1488-
* ``source`` The compiler uses the floating-point type declared in the source program as the evaluation method.
1489-
* ``double`` The compiler uses ``double`` as the floating-point evaluation method for all float expressions of type that is narrower than ``double``.
1490-
* ``extended`` The compiler uses ``long double`` as the floating-point evaluation method for all float expressions of type that is narrower than ``long double``.
1491-
14921481
.. option:: -f[no-]protect-parens:
14931482

14941483
This option pertains to floating-point types, complex types with

clang/include/clang/AST/TemplateName.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,16 +309,17 @@ class TemplateName {
309309
/// unexpanded parameter pack (for C++0x variadic templates).
310310
bool containsUnexpandedParameterPack() const;
311311

312+
enum class Qualified { None, AsWritten, Fully };
312313
/// Print the template name.
313314
///
314315
/// \param OS the output stream to which the template name will be
315316
/// printed.
316317
///
317-
/// \param SuppressNNS if true, don't print the
318-
/// nested-name-specifier that precedes the template name (if it has
319-
/// one).
318+
/// \param Qual print the (Qualified::None) simple name,
319+
/// (Qualified::AsWritten) any written (possibly partial) qualifier, or
320+
/// (Qualified::Fully) the fully qualified name.
320321
void print(raw_ostream &OS, const PrintingPolicy &Policy,
321-
bool SuppressNNS = false) const;
322+
Qualified Qual = Qualified::AsWritten) const;
322323

323324
/// Debugging aid that dumps the template name.
324325
void dump(raw_ostream &OS) const;

clang/include/clang/AST/Type.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3534,14 +3534,10 @@ class DependentSizedMatrixType final : public MatrixType {
35343534
Expr *ColumnExpr, SourceLocation loc);
35353535

35363536
public:
3537-
QualType getElementType() const { return ElementType; }
35383537
Expr *getRowExpr() const { return RowExpr; }
35393538
Expr *getColumnExpr() const { return ColumnExpr; }
35403539
SourceLocation getAttributeLoc() const { return loc; }
35413540

3542-
bool isSugared() const { return false; }
3543-
QualType desugar() const { return QualType(this, 0); }
3544-
35453541
static bool classof(const Type *T) {
35463542
return T->getTypeClass() == DependentSizedMatrix;
35473543
}

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ def err_drv_invalid_riscv_arch_name : Error<
2929
"invalid arch name '%0', %1">;
3030
def err_drv_invalid_riscv_ext_arch_name : Error<
3131
"invalid arch name '%0', %1 '%2'">;
32+
def warn_drv_invalid_arch_name_with_suggestion : Warning<
33+
"ignoring invalid /arch: argument '%0'; for %select{64|32}1-bit expected one of %2">,
34+
InGroup<UnusedCommandLineArgument>;
3235
def warn_drv_avr_mcu_not_specified : Warning<
3336
"no target microcontroller specified on command line, cannot "
3437
"link standard libraries, please pass -mmcu=<mcu name>">,

clang/include/clang/Basic/DiagnosticIDs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace clang {
2828
// Size of each of the diagnostic categories.
2929
enum {
3030
DIAG_SIZE_COMMON = 300,
31-
DIAG_SIZE_DRIVER = 250,
31+
DIAG_SIZE_DRIVER = 260,
3232
DIAG_SIZE_FRONTEND = 150,
3333
DIAG_SIZE_SERIALIZATION = 120,
3434
DIAG_SIZE_LEX = 400,

clang/include/clang/Basic/FPOptions.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ OPTION(NoHonorInfs, bool, 1, NoHonorNaNs)
2323
OPTION(NoSignedZero, bool, 1, NoHonorInfs)
2424
OPTION(AllowReciprocal, bool, 1, NoSignedZero)
2525
OPTION(AllowApproxFunc, bool, 1, AllowReciprocal)
26-
OPTION(FPEvalMethod, LangOptions::FPEvalMethodKind, 2, AllowApproxFunc)
2726
#undef OPTION

clang/include/clang/Basic/LangOptions.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,6 @@ BENIGN_ENUM_LANGOPT(DefaultFPContractMode, FPModeKind, 2, FPM_Off, "FP contracti
310310
COMPATIBLE_LANGOPT(ExpStrictFP, 1, false, "Enable experimental strict floating point")
311311
BENIGN_ENUM_LANGOPT(FPRoundingMode, RoundingMode, 3, RoundingMode::NearestTiesToEven, "FP Rounding Mode type")
312312
BENIGN_ENUM_LANGOPT(FPExceptionMode, FPExceptionModeKind, 2, FPE_Ignore, "FP Exception Behavior Mode type")
313-
BENIGN_ENUM_LANGOPT(FPEvalMethod, FPEvalMethodKind, 2, FEM_TargetDefault, "FP type used for floating point arithmetic")
314313
LANGOPT(NoBitFieldTypeAlign , 1, 0, "bit-field type alignment")
315314
LANGOPT(HexagonQdsp6Compat , 1, 0, "hexagon-qdsp6 backward compatibility")
316315
LANGOPT(ObjCAutoRefCount , 1, 0, "Objective-C automated reference counting")

clang/include/clang/Basic/LangOptions.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -238,19 +238,6 @@ class LangOptions : public LangOptionsBase {
238238
/// Possible exception handling behavior.
239239
enum class ExceptionHandlingKind { None, SjLj, WinEH, DwarfCFI, Wasm };
240240

241-
/// Possible float expression evaluation method choices.
242-
enum FPEvalMethodKind {
243-
/// Use the declared type for fp arithmetic.
244-
FEM_Source,
245-
/// Use the type double for fp arithmetic.
246-
FEM_Double,
247-
/// Use extended type for fp arithmetic.
248-
FEM_Extended,
249-
/// Use the default float eval method specified by Target:
250-
// most targets are defined with evaluation method FEM_Source.
251-
FEM_TargetDefault
252-
};
253-
254241
enum class LaxVectorConversionKind {
255242
/// Permit no implicit vector bitcasts.
256243
None,
@@ -568,7 +555,6 @@ class FPOptions {
568555
setAllowFEnvAccess(true);
569556
else
570557
setAllowFEnvAccess(LangOptions::FPM_Off);
571-
setFPEvalMethod(LO.getFPEvalMethod());
572558
}
573559

574560
bool allowFPContractWithinStatement() const {

clang/include/clang/Basic/PragmaKinds.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ enum PragmaFloatControlKind {
3232
PFC_Except, // #pragma float_control(except [,on])
3333
PFC_NoExcept, // #pragma float_control(except, off)
3434
PFC_Push, // #pragma float_control(push)
35-
PFC_Pop, // #pragma float_control(pop)
36-
PFC_Source, // #pragma float_control(source, {on|off} [,push])
37-
PFC_Double, // #pragma float_control(double, {on|off} [,push])
38-
PFC_Extended, // #pragma float_control(extended, {on|off} [,push])
35+
PFC_Pop // #pragma float_control(pop)
3936
};
4037
}
4138

clang/include/clang/Basic/TargetInfo.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -684,8 +684,7 @@ class TargetInfo : public virtual TransferrableTargetInfo,
684684
}
685685

686686
/// Return the value for the C99 FLT_EVAL_METHOD macro.
687-
// Note: implementation defined values may be negative.
688-
virtual int getFPEvalMethod() const { return 0; }
687+
virtual unsigned getFloatEvalMethod() const { return 0; }
689688

690689
// getLargeArrayMinWidth/Align - Return the minimum array size that is
691690
// 'large' and its alignment.

clang/include/clang/Driver/Options.td

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,11 +1484,6 @@ def : Flag<["-"], "fextended-identifiers">, Group<clang_ignored_f_Group>;
14841484
def : Flag<["-"], "fno-extended-identifiers">, Group<f_Group>, Flags<[Unsupported]>;
14851485
def fhosted : Flag<["-"], "fhosted">, Group<f_Group>;
14861486
def fdenormal_fp_math_EQ : Joined<["-"], "fdenormal-fp-math=">, Group<f_Group>, Flags<[CC1Option]>;
1487-
def ffp_eval_method_EQ : Joined<["-"], "ffp-eval-method=">, Group<f_Group>, Flags<[CC1Option]>,
1488-
HelpText<"Specifies the evaluation method to use for floating-point arithmetic.">,
1489-
Values<"source,double,extended">, NormalizedValuesScope<"LangOptions">,
1490-
NormalizedValues<["FEM_Source", "FEM_Double", "FEM_Extended"]>,
1491-
MarshallingInfoEnum<LangOpts<"FPEvalMethod">, "FEM_TargetDefault">;
14921487
def ffp_model_EQ : Joined<["-"], "ffp-model=">, Group<f_Group>, Flags<[NoXarchOption]>,
14931488
HelpText<"Controls the semantics of floating-point calculations.">;
14941489
def ffp_exception_behavior_EQ : Joined<["-"], "ffp-exception-behavior=">, Group<f_Group>, Flags<[CC1Option]>,
@@ -3773,8 +3768,10 @@ def multi__module : Flag<["-"], "multi_module">;
37733768
def multiply__defined__unused : Separate<["-"], "multiply_defined_unused">;
37743769
def multiply__defined : Separate<["-"], "multiply_defined">;
37753770
def mwarn_nonportable_cfstrings : Flag<["-"], "mwarn-nonportable-cfstrings">, Group<m_Group>;
3771+
def canonical_prefixes : Flag<["-"], "canonical-prefixes">, Flags<[HelpHidden, CoreOption]>,
3772+
HelpText<"Use absolute paths for invoking subcommands (default)">;
37763773
def no_canonical_prefixes : Flag<["-"], "no-canonical-prefixes">, Flags<[HelpHidden, CoreOption]>,
3777-
HelpText<"Use relative instead of canonical paths">;
3774+
HelpText<"Use relative paths for invoking subcommands">;
37783775
def no_cpp_precomp : Flag<["-"], "no-cpp-precomp">, Group<clang_ignored_f_Group>;
37793776
def no_integrated_cpp : Flag<["-", "--"], "no-integrated-cpp">, Flags<[NoXarchOption]>;
37803777
def no_pedantic : Flag<["-", "--"], "no-pedantic">, Group<pedantic_Group>;

clang/include/clang/Frontend/CompilerInvocation.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ class HeaderSearchOptions;
5050
class PreprocessorOptions;
5151
class TargetOptions;
5252

53+
// This lets us create the DiagnosticsEngine with a properly-filled-out
54+
// DiagnosticOptions instance.
55+
std::unique_ptr<DiagnosticOptions>
56+
CreateAndPopulateDiagOpts(ArrayRef<const char *> Argv);
57+
5358
/// Fill out Opts based on the options given in Args.
5459
///
5560
/// Args must have been created from the OptTable returned by

clang/include/clang/Lex/HeaderSearch.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class TargetInfo;
5151
/// The preprocessor keeps track of this information for each
5252
/// file that is \#included.
5353
struct HeaderFileInfo {
54-
/// True if this is a \#import'd or \#pragma once file.
54+
/// True if this is a \#import'd file.
5555
unsigned isImport : 1;
5656

5757
/// True if this is a \#pragma once file.
@@ -450,11 +450,10 @@ class HeaderSearch {
450450
return (SrcMgr::CharacteristicKind)getFileInfo(File).DirInfo;
451451
}
452452

453-
/// Mark the specified file as a "once only" file, e.g. due to
453+
/// Mark the specified file as a "once only" file due to
454454
/// \#pragma once.
455455
void MarkFileIncludeOnce(const FileEntry *File) {
456456
HeaderFileInfo &FI = getFileInfo(File);
457-
FI.isImport = true;
458457
FI.isPragmaOnce = true;
459458
}
460459

@@ -500,8 +499,7 @@ class HeaderSearch {
500499
/// This routine does not consider the effect of \#import
501500
bool isFileMultipleIncludeGuarded(const FileEntry *File);
502501

503-
/// Determine whether the given file is known to have ever been \#imported
504-
/// (or if it has been \#included and we've encountered a \#pragma once).
502+
/// Determine whether the given file is known to have ever been \#imported.
505503
bool hasFileBeenImported(const FileEntry *File) {
506504
const HeaderFileInfo *FI = getExistingFileInfo(File);
507505
return FI && FI->isImport;

0 commit comments

Comments
 (0)