aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorDavid Stone <davidfromonline@gmail.com>2023-10-07 19:49:05 -0600
committerGitHub <noreply@github.com>2023-10-08 09:49:05 +0800
commit701d804cdb6944fbb2d4519c1f334425b3a38677 (patch)
tree5fa28417b67f0bcaafb95068ed457524fca2af7f /clang/lib/Frontend/CompilerInstance.cpp
parentdae91f5dbc5bee579eac7f4cbb71e86f2934817f (diff)
downloadllvm-701d804cdb6944fbb2d4519c1f334425b3a38677.zip
llvm-701d804cdb6944fbb2d4519c1f334425b3a38677.tar.gz
llvm-701d804cdb6944fbb2d4519c1f334425b3a38677.tar.bz2
[clang][Modules] `checkModuleIsAvailable` should use a const & parameter instead of pointer (#67902)
The `Module` parameter to `checkModuleIsAvailable` is currently passed by pointer to non-const. However, it requires only const access and it cannot be null. Change this to be a reference to const instead. This then makes it obvious that it is an input-only parameter, so move it to be before the in-out parameter for diagnostics.
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index d18371f..d749195 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -2116,7 +2116,7 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
// Check whether this module is available.
if (Preprocessor::checkModuleIsAvailable(getLangOpts(), getTarget(),
- getDiagnostics(), Module)) {
+ *Module, getDiagnostics())) {
getDiagnostics().Report(ImportLoc, diag::note_module_import_here)
<< SourceRange(Path.front().second, Path.back().second);
LastModuleImportLoc = ImportLoc;