Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
4b10a4c
[mlir] Enable specifying bytecode producer in mlir-opt. (#182846)
jpienaar Feb 27, 2026
9c53215
[VPlan] Remove manual region removal when simplifying for VF and UF. …
fhahn Feb 27, 2026
975dba2
[ThinLTO] Reduce the number of renaming due to promotions (#178587)
yonghong-song Feb 27, 2026
729602e
Revert "[SPIRV][NFCI] Use unordered data structures for SPIR-V extens…
sarnex Feb 27, 2026
a703d91
[lldb-dap] Improve test performance for 'cancel' request. (#183632)
ashgti Feb 27, 2026
d1da7f6
[clang-scan-deps] Add test for symlink-aliased module map PCM reuse a…
cyndyishida Feb 27, 2026
0617623
[SPIR-V] Fix non-deterministic compiler output for debug type pointer…
MrSidims Feb 27, 2026
de4a1a7
[clang][modules] Prevent deadlock in module cache (#182722)
jansvoboda11 Feb 27, 2026
35f8ca8
[flang][NFC] Converted five tests from old lowering to new lowering (…
eugeneepshteyn Feb 27, 2026
bad56db
[libsycl] Add sycl::context stub (#182826)
KseniyaTikhomirova Feb 27, 2026
7f0a343
[flang] Implement -grecord-command-line for Flang (#181686)
cyyself Feb 27, 2026
dc26edd
[ASan] Enable Internalization for 'asanrtl.bc' in Driver (#182825)
ampandey-1995 Feb 27, 2026
5661ed6
[mlir][vector] Fix crashes in MaskOp::fold and CanonializeEmptyMaskOp…
joker-eph Feb 27, 2026
55d62ab
[lldb] Add arithmetic binary addition to DIL (#177208)
kuilpd Feb 27, 2026
d2c5452
[RISCV] Use getCopyFromReg in unit test to match comment. NFC (#183199)
topperc Feb 27, 2026
cd50a30
Revert "[ThinLTO] Reduce the number of renaming due to promotions (#1…
yonghong-song Feb 27, 2026
179c25e
[MTE] [HWASan] support more complicated lifetimes
fmayer Feb 27, 2026
1269a74
[bazel] Enable `parse_headers` for llvm/BUILD.bazel (#183680)
rupprecht Feb 27, 2026
c3b3f41
[SystemZ] Emit external aliases required for indirect symbol handling…
amy-kwan Feb 27, 2026
0d95dda
[LoopInfo] Preserve profile information in makeLoopInvariant (#174171)
boomanaiden154 Feb 27, 2026
67a51ea
[NFC][POWER] add Pre-Commit test case for Inefficient std::bit_floor(…
diggerlin Feb 27, 2026
c49460b
[flang-rt] Enable more runtime functions for the GPU target (#183649)
jhuber6 Feb 27, 2026
6301243
Reapply "[ValueTracking] Propagate sign information out of loop" (#18…
kshitijvp Feb 27, 2026
ca0e7d3
[flang] [flang-rt] Addition of the Fortran 2023 TOKENIZE intrinsic. (…
kwyatt-ext Feb 27, 2026
48eb40b
[lldb-dap] Adjust VariableReferenceStorage lifetime management. (#183…
ashgti Feb 27, 2026
852c6ef
[mlir][LLVM] Let decomposeValue/composeValue handle aggregates (#183405)
krzysz00 Feb 27, 2026
c05e323
[WebAssembly] Incorporate SCCs into WebAssemblyFixIrreducibleControlF…
QuantumSegfault Feb 27, 2026
dce48f2
[OpenMP] Enable internalization of 'ockl.bc' for OpenMP (#183685)
ampandey-1995 Feb 27, 2026
403fd76
[SlotIndexes] Further pack indices to improve spill placement time (#…
boomanaiden154 Feb 27, 2026
282a2b7
[clang][ssaf] Add `JSONFormat` support for `TUSummaryEncoding`
aviralg Feb 27, 2026
cf28f23
[SLP] Reject duplicate shift amounts in matchesShlZExt reorder path (…
akadutta Feb 27, 2026
25d709e
[SystemZ] Emit external aliases for indirect function descriptors in …
amy-kwan Feb 27, 2026
ee6f5f3
[InstCombine] Replace alloca with undef size with poison instead of n…
mgcarrasco Feb 27, 2026
8ce2b9c
[Clang][ItaniumMangle] Fix recursive mangling for lambda init-capture…
oToToT Feb 27, 2026
df5bee6
[CIR] Implement TryOp flattening (#183591)
andykaylor Feb 27, 2026
3d889c4
[clang-format] Fix SpaceBeforeParens with explicit template instantia…
bdunkin Feb 27, 2026
4f05592
[Driver][SYCL] Add tests for -Xarch_<arch> option forwarding to SYCL …
srividya-sundaram Feb 27, 2026
d1f4f94
[flang] Fix explanatory messages for generic resolution error (#183565)
klausler Feb 27, 2026
6f612cf
[clang] stop error recovery in SFINAE for narrowing in converted cons…
mizvekov Feb 27, 2026
ca04a70
[libc][math] Refactor bf16sub family to header-only (#182115)
hulxv Feb 27, 2026
fc153b1
[alpha.webkit.NoDeleteChecker] Check if each field is trivially destr…
rniwa Feb 27, 2026
fff2f0b
[AMDGPU] Handle GFX1250 hazards between WMMA and VOPD (#183573)
jayfoad Feb 27, 2026
02ebe23
[ASan] Document limitations of container overflow checks (#183590)
vitalybuka Feb 27, 2026
2c98566
Revert "[Metal][HLSL] Add support for dumping reflection" (#183818)
mysterymath Feb 27, 2026
977702c
[clang] fix crash when casting a parenthesized unresolved template-id…
Serosh-commits Feb 27, 2026
d0afaea
[clang][modulemap] Lazily load module maps by header name (#181916)
Bigcheese Feb 27, 2026
1073951
[mlir][cf] Fix crash in simplifyBrToBlockWithSinglePred when branch o…
joker-eph Feb 27, 2026
a71ded3
[BOLT][AArch64] Add a unittest for compare-and-branch inversion. (#18…
labrinea Feb 27, 2026
c2f66f2
[WebAseembly] Fix -Wunused-variable in #181755
boomanaiden154 Feb 27, 2026
63ab568
[NFC] [HWASan] add test for duplicated lifetime end
fmayer Feb 27, 2026
94bd8b9
[NFC] [MTE] add test for duplicated lifetime end
fmayer Feb 27, 2026
d7e037c
Revert "[VPlan] Remove manual region removal when simplifying for VF …
fhahn Feb 27, 2026
cdd4313
[mlir][LLVM] Let decomposeValue/composeVale pad out larger types (#18…
krzysz00 Feb 27, 2026
8f268e6
[Offload] Remove unused data type (#183840)
hansangbae Feb 27, 2026
73d655a
[VPlan] Support unrolling/cloning masked VPInstructions.
fhahn Feb 27, 2026
7ad2c6d
[mlir][arith] Add `exact` to `index_cast{,ui}` (#183395)
amd-eochoalo Feb 27, 2026
abbba22
[lldb] Add synthetic support to formatter_bytecode.py (#183804)
kastiglione Feb 27, 2026
c5588be
[lldb] Add skip shared build to more API tests
jasonmolenda Feb 27, 2026
89d42b3
merge main into amd-staging
ronlieb Feb 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 101 additions & 0 deletions bolt/unittests/Core/MCPlusBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,107 @@ TEST_P(MCPlusBuilderTester, AliasSmallerX0) {
/*OnlySmaller=*/true);
}

TEST_P(MCPlusBuilderTester, AArch64_ReverseCompAndBranch) {
if (GetParam() != Triple::aarch64)
GTEST_SKIP();

BinaryFunction *BF = BC->createInjectedBinaryFunction("BF", true);
std::unique_ptr<BinaryBasicBlock> TargetBB = BF->createBasicBlock();

// Compare register with immediate and branch.
// Inversion requires incrementing the immediate value.
// cbgt x0, #0, target ~> cblt x0, #1, target
MCInst NeedsImmInc = MCInstBuilder(AArch64::CBGTXri)
.addReg(AArch64::X0)
.addImm(0)
.addExpr(MCSymbolRefExpr::create(
TargetBB->getLabel(), *BC->Ctx.get()));
ASSERT_TRUE(BC->MIB->isReversibleBranch(NeedsImmInc));
BC->MIB->reverseBranchCondition(NeedsImmInc, TargetBB->getLabel(),
BC->Ctx.get());
ASSERT_EQ(NeedsImmInc.getOpcode(), AArch64::CBLTXri);
ASSERT_EQ(NeedsImmInc.getOperand(1).getImm(), 1);

// Compare register with immediate and branch.
// Inversion requires decrementing the immediate value.
// cblo x0, #1, target ~> cbhi x0, #0, target
MCInst NeedsImmDec = MCInstBuilder(AArch64::CBLOXri)
.addReg(AArch64::X0)
.addImm(1)
.addExpr(MCSymbolRefExpr::create(
TargetBB->getLabel(), *BC->Ctx.get()));
ASSERT_TRUE(BC->MIB->isReversibleBranch(NeedsImmDec));
BC->MIB->reverseBranchCondition(NeedsImmDec, TargetBB->getLabel(),
BC->Ctx.get());
ASSERT_EQ(NeedsImmDec.getOpcode(), AArch64::CBHIXri);
ASSERT_EQ(NeedsImmDec.getOperand(1).getImm(), 0);

// Compare registers and branch.
// Inversion requires swapping registers.
// cbge x0, x1, target ~> cbgt x1, x0, target
MCInst CompRegNeedsRegSwap = MCInstBuilder(AArch64::CBGEXrr)
.addReg(AArch64::X0)
.addReg(AArch64::X1)
.addExpr(MCSymbolRefExpr::create(
TargetBB->getLabel(), *BC->Ctx.get()));
ASSERT_TRUE(BC->MIB->isReversibleBranch(CompRegNeedsRegSwap));
BC->MIB->reverseBranchCondition(CompRegNeedsRegSwap, TargetBB->getLabel(),
BC->Ctx.get());
ASSERT_EQ(CompRegNeedsRegSwap.getOpcode(), AArch64::CBGTXrr);
ASSERT_EQ(CompRegNeedsRegSwap.getOperand(0).getReg(), AArch64::X1);
ASSERT_EQ(CompRegNeedsRegSwap.getOperand(1).getReg(), AArch64::X0);

// Compare bytes and branch.
// Inversion requires swapping registers.
// cbbhi w0, w1, target ~> cbbhs w1, w0, target
MCInst CompByteNeedsRegSwap = MCInstBuilder(AArch64::CBBHIWrr)
.addReg(AArch64::W0)
.addReg(AArch64::W1)
.addExpr(MCSymbolRefExpr::create(
TargetBB->getLabel(), *BC->Ctx.get()));
ASSERT_TRUE(BC->MIB->isReversibleBranch(CompByteNeedsRegSwap));
BC->MIB->reverseBranchCondition(CompByteNeedsRegSwap, TargetBB->getLabel(),
BC->Ctx.get());
ASSERT_EQ(CompByteNeedsRegSwap.getOpcode(), AArch64::CBBHSWrr);
ASSERT_EQ(CompByteNeedsRegSwap.getOperand(0).getReg(), AArch64::W1);
ASSERT_EQ(CompByteNeedsRegSwap.getOperand(1).getReg(), AArch64::W0);

// Compare halfwords and branch.
// Inversion requires swapping registers.
// cbhhs w0, w1, target ~> cbhhi w1, w0, target
MCInst CompHalfNeedsRegSwap = MCInstBuilder(AArch64::CBHHSWrr)
.addReg(AArch64::W0)
.addReg(AArch64::W1)
.addExpr(MCSymbolRefExpr::create(
TargetBB->getLabel(), *BC->Ctx.get()));
ASSERT_TRUE(BC->MIB->isReversibleBranch(CompHalfNeedsRegSwap));
BC->MIB->reverseBranchCondition(CompHalfNeedsRegSwap, TargetBB->getLabel(),
BC->Ctx.get());
ASSERT_EQ(CompHalfNeedsRegSwap.getOpcode(), AArch64::CBHHIWrr);
ASSERT_EQ(CompHalfNeedsRegSwap.getOperand(0).getReg(), AArch64::W1);
ASSERT_EQ(CompHalfNeedsRegSwap.getOperand(1).getReg(), AArch64::W0);

// Compare register with immediate and branch.
// Inversion not possible, immediate value underflows.
// cblt x0, #0, target
MCInst Underflows = MCInstBuilder(AArch64::CBLTXri)
.addReg(AArch64::X0)
.addImm(0)
.addExpr(MCSymbolRefExpr::create(TargetBB->getLabel(),
*BC->Ctx.get()));
ASSERT_FALSE(BC->MIB->isReversibleBranch(Underflows));

// Compare register with immediate and branch.
// Inversion not possible, immediate value overflows.
// cbhi x0, #63, target
MCInst Overflows = MCInstBuilder(AArch64::CBHIXri)
.addReg(AArch64::X0)
.addImm(63)
.addExpr(MCSymbolRefExpr::create(TargetBB->getLabel(),
*BC->Ctx.get()));
ASSERT_FALSE(BC->MIB->isReversibleBranch(Overflows));
}

TEST_P(MCPlusBuilderTester, AArch64_CmpJE) {
if (GetParam() != Triple::aarch64)
GTEST_SKIP();
Expand Down
7 changes: 5 additions & 2 deletions clang/docs/AddressSanitizer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,11 @@ AddressSanitizer can detect overflows in containers with custom allocators
(such as std::vector) where the library developers have added calls into the
AddressSanitizer runtime to indicate which memory is poisoned etc.

In environments where not all the process binaries can be recompiled with
AddressSanitizer enabled, these checks can cause false positives.
Note that this feature is prone to false positives:
* Partially poisoning objects on stack, e.g. for small string optimization, can
cause both false positives and negatives.
* If the binary is partially AddressSanitizer instrumented, these
checks can cause false positives.

See `Disabling container overflow checks`_ for details on suppressing checks.

Expand Down
1 change: 1 addition & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ Miscellaneous Clang Crashes Fixed
- Fixed a crash when using loop hint with a value dependent argument inside a
generic lambda. (#GH172289)
- Fixed a crash in C++ overload resolution with ``_Atomic``-qualified argument types. (#GH170433)
- Fixed a crash when casting a parenthesized unresolved template-id or array section. (#GH183505)
- Fixed a crash when initializing a ``constexpr`` pointer with a floating-point literal in C23. (#GH180313)
- Fixed an assertion when diagnosing address-space qualified ``new``/``delete`` in language-defined address spaces such as OpenCL ``__local``. (#GH178319)
- Fixed an assertion failure in ObjC++ ARC when binding a rvalue reference to reference with different lifetimes (#GH178524)
Expand Down
13 changes: 7 additions & 6 deletions clang/include/clang/AST/DeclCXX.h
Original file line number Diff line number Diff line change
Expand Up @@ -1791,6 +1791,9 @@ class CXXRecordDecl : public RecordDecl {
/// the declaration context suffices.
Decl *getLambdaContextDecl() const;

/// Set the context declaration for a lambda class.
void setLambdaContextDecl(Decl *ContextDecl);

/// Retrieve the index of this lambda within the context declaration returned
/// by getLambdaContextDecl().
unsigned getLambdaIndexInContext() const {
Expand All @@ -1800,21 +1803,19 @@ class CXXRecordDecl : public RecordDecl {

/// Information about how a lambda is numbered within its context.
struct LambdaNumbering {
Decl *ContextDecl = nullptr;
unsigned IndexInContext = 0;
unsigned ManglingNumber = 0;
unsigned DeviceManglingNumber = 0;
bool HasKnownInternalLinkage = false;
};

/// Set the mangling numbers and context declaration for a lambda class.
/// Set the mangling numbers for a lambda class.
void setLambdaNumbering(LambdaNumbering Numbering);

// Get the mangling numbers and context declaration for a lambda class.
// Get the mangling numbers for a lambda class.
LambdaNumbering getLambdaNumbering() const {
return {getLambdaContextDecl(), getLambdaIndexInContext(),
getLambdaManglingNumber(), getDeviceLambdaManglingNumber(),
hasKnownLambdaInternalLinkage()};
return {getLambdaIndexInContext(), getLambdaManglingNumber(),
getDeviceLambdaManglingNumber(), hasKnownLambdaInternalLinkage()};
}

/// Retrieve the device side mangling number.
Expand Down
37 changes: 36 additions & 1 deletion clang/include/clang/Analysis/Scalable/Serialization/JSONFormat.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ class JSONFormat final : public SerializationFormat {
llvm::Error writeTUSummary(const TUSummary &Summary,
llvm::StringRef Path) override;

llvm::Expected<TUSummaryEncoding>
readTUSummaryEncoding(llvm::StringRef Path) override;

llvm::Error writeTUSummaryEncoding(const TUSummaryEncoding &SummaryEncoding,
llvm::StringRef Path) override;

using SerializerFn = llvm::function_ref<Object(const EntitySummary &,
const EntityIdConverter &)>;
using DeserializerFn =
Expand Down Expand Up @@ -98,7 +104,7 @@ class JSONFormat final : public SerializationFormat {

llvm::Expected<std::map<EntityId, EntityLinkage>>
linkageTableFromJSON(const Array &LinkageTableArray,
std::set<EntityId> EntityIds) const;
std::set<EntityId> ExpectedIds) const;
Array linkageTableToJSON(
const std::map<EntityId, EntityLinkage> &LinkageTable) const;

Expand Down Expand Up @@ -141,6 +147,35 @@ class JSONFormat final : public SerializationFormat {
const std::map<SummaryName,
std::map<EntityId, std::unique_ptr<EntitySummary>>>
&SummaryDataMap) const;

llvm::Expected<std::pair<EntityId, std::unique_ptr<EntitySummaryEncoding>>>
encodingDataMapEntryFromJSON(const Object &EntityDataMapEntryObject) const;
Object encodingDataMapEntryToJSON(
EntityId EI,
const std::unique_ptr<EntitySummaryEncoding> &Encoding) const;

llvm::Expected<std::map<EntityId, std::unique_ptr<EntitySummaryEncoding>>>
encodingDataMapFromJSON(const Array &EntityDataArray) const;
Array encodingDataMapToJSON(
const std::map<EntityId, std::unique_ptr<EntitySummaryEncoding>>
&EncodingDataMap) const;

llvm::Expected<std::pair<
SummaryName, std::map<EntityId, std::unique_ptr<EntitySummaryEncoding>>>>
encodingSummaryDataMapEntryFromJSON(
const Object &SummaryDataMapEntryObject) const;
Object encodingSummaryDataMapEntryToJSON(
const SummaryName &SN,
const std::map<EntityId, std::unique_ptr<EntitySummaryEncoding>>
&EncodingMap) const;

llvm::Expected<std::map<
SummaryName, std::map<EntityId, std::unique_ptr<EntitySummaryEncoding>>>>
encodingSummaryDataMapFromJSON(const Array &SummaryDataArray) const;
Array encodingSummaryDataMapToJSON(
const std::map<SummaryName,
std::map<EntityId, std::unique_ptr<EntitySummaryEncoding>>>
&EncodingSummaryDataMap) const;
};

} // namespace clang::ssaf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ class SerializationFormat {
virtual llvm::Error writeTUSummary(const TUSummary &Summary,
llvm::StringRef Path) = 0;

virtual llvm::Expected<TUSummaryEncoding>
readTUSummaryEncoding(llvm::StringRef Path) = 0;

virtual llvm::Error
writeTUSummaryEncoding(const TUSummaryEncoding &SummaryEncoding,
llvm::StringRef Path) = 0;

protected:
// Helpers providing access to implementation details of basic data structures
// for efficient serialization/deserialization.
Expand Down
2 changes: 0 additions & 2 deletions clang/include/clang/Basic/DiagnosticDriverKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -868,8 +868,6 @@ def err_drv_dxc_invalid_matrix_layout : Error<
"cannot specify /Zpr and /Zpc together">;
def err_drv_dxc_missing_target_profile : Error<
"target profile option (-T) is missing">;
def err_drv_dxc_Fre_requires_Fo_metal
: Error<"-Fre option requires -Fo option when targeting Metal">;
def err_drv_hlsl_unsupported_target : Error<
"HLSL code generation is unsupported for target '%0'">;
def err_drv_hlsl_bad_shader_required_in_target : Error<
Expand Down
8 changes: 6 additions & 2 deletions clang/include/clang/DependencyScanning/InProcessModuleCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@
#include "llvm/ADT/StringMap.h"

#include <atomic>
#include <condition_variable>
#include <mutex>
#include <shared_mutex>

namespace clang {
namespace dependencies {

struct ModuleCacheEntry {
std::shared_mutex CompilationMutex;
std::mutex Mutex;
std::condition_variable CondVar;
bool Locked = false;
unsigned Generation = 0;

std::atomic<std::time_t> Timestamp = 0;
};

Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/Frontend/FrontendOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,9 @@ class FrontendOptions {
/// The list of files to embed into the compiled module file.
std::vector<std::string> ModulesEmbedFiles;

/// The time in seconds to wait on an implicit module lock before timing out.
unsigned ImplicitModulesLockTimeoutSeconds = 90;

/// The list of AST files to merge.
std::vector<std::string> ASTMergeFiles;

Expand Down
37 changes: 36 additions & 1 deletion clang/include/clang/Lex/HeaderSearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,20 @@ class HeaderSearch {

struct ModuleMapDirectoryState {
OptionalFileEntryRef ModuleMapFile;
OptionalFileEntryRef PrivateModuleMapFile;
enum {
Parsed,
Loaded,
Invalid,
} Status;

/// Relative header path -> list of module names
llvm::StringMap<llvm::SmallVector<StringRef, 1>> HeaderToModules{};
/// Relative dir path -> module name
llvm::SmallVector<std::pair<std::string, StringRef>, 2>
UmbrellaDirModules{};
/// List of module names with umbrella header decls
llvm::SmallVector<StringRef, 2> UmbrellaHeaderModules{};
};

/// Describes whether a given directory has a module map in it.
Expand Down Expand Up @@ -372,6 +381,31 @@ class HeaderSearch {
/// map their keys to the SearchDir index of their header map.
void indexInitialHeaderMaps();

/// Build the module map index for a directory's module map.
///
/// This fills a ModuleMapDirectoryState with index information from its
/// directory's module map.
void buildModuleMapIndex(DirectoryEntryRef Dir,
ModuleMapDirectoryState &MMState);

void processModuleMapForIndex(const modulemap::ModuleMapFile &MMF,
DirectoryEntryRef MMDir, StringRef PathPrefix,
ModuleMapDirectoryState &MMState);

void processExternModuleDeclForIndex(const modulemap::ExternModuleDecl &EMD,
DirectoryEntryRef MMDir,
StringRef PathPrefix,
ModuleMapDirectoryState &MMState);

void processModuleDeclForIndex(const modulemap::ModuleDecl &MD,
StringRef ModuleName, DirectoryEntryRef MMDir,
StringRef PathPrefix,
ModuleMapDirectoryState &MMState);

void addToModuleMapIndex(StringRef RelPath, StringRef ModuleName,
StringRef PathPrefix,
ModuleMapDirectoryState &MMState);

public:
HeaderSearch(const HeaderSearchOptions &HSOpts, SourceManager &SourceMgr,
DiagnosticsEngine &Diags, const LangOptions &LangOpts,
Expand Down Expand Up @@ -953,7 +987,8 @@ class HeaderSearch {
bool IsSystem,
DirectoryEntryRef Dir,
FileID ID = FileID(),
unsigned *Offset = nullptr);
unsigned *Offset = nullptr,
bool DiagnosePrivMMap = false);

ModuleMapResult parseModuleMapFileImpl(FileEntryRef File, bool IsSystem,
DirectoryEntryRef Dir,
Expand Down
7 changes: 6 additions & 1 deletion clang/include/clang/Lex/HeaderSearchOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ class HeaderSearchOptions {
LLVM_PREFERRED_TYPE(bool)
unsigned AllowModuleMapSubdirectorySearch : 1;

/// Whether modules from module maps should only be loaded when used, not just
/// when parsed.
LLVM_PREFERRED_TYPE(bool)
unsigned LazyLoadModuleMaps : 1;

HeaderSearchOptions(StringRef _Sysroot = "/")
: Sysroot(_Sysroot), ModuleFormat("raw"), DisableModuleHash(false),
ImplicitModuleMaps(false), ModuleMapFileHomeIsCwd(false),
Expand All @@ -301,7 +306,7 @@ class HeaderSearchOptions {
ModulesPruneNonAffectingModuleMaps(true), ModulesHashContent(false),
ModulesSerializeOnlyPreprocessor(false),
ModulesStrictContextHash(false), ModulesIncludeVFSUsage(false),
AllowModuleMapSubdirectorySearch(true) {}
AllowModuleMapSubdirectorySearch(true), LazyLoadModuleMaps(false) {}

/// AddPath - Add the \p Path path to the specified \p Group list.
void AddPath(StringRef Path, frontend::IncludeDirGroup Group,
Expand Down
Loading
Loading