[clang] [clang][Lex][NFC] Remove unused ModuleDeclLoc (PR #239947)

via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 7 01:53:00 PST 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Chen Miao (ChenMiaoi)

<details>
<summary>Changes</summary>

`ModuleDeclLoc` is assigned but never read.

---
Full diff: https://github.com/llvm/llvm-project/pull/239947.diff


2 Files Affected:

- (modified) clang/include/clang/Lex/Preprocessor.h (-4) 
- (modified) clang/lib/Lex/Preprocessor.cpp (-1) 


``````````diff
diff --git a/clang/include/clang/Lex/Preprocessor.h b/clang/include/clang/Lex/Preprocessor.h
index 31b68a0fd0670e..2d0c24b92334a3 100644
--- a/clang/include/clang/Lex/Preprocessor.h
+++ b/clang/include/clang/Lex/Preprocessor.h
@@ -376,10 +376,6 @@ class Preprocessor {
   /// lexed, if any.
   SourceLocation ModuleImportLoc;
 
-  /// The source location of the \c module contextual keyword we just
-  /// lexed, if any.
-  SourceLocation ModuleDeclLoc;
-
   llvm::DenseMap<FileID, SmallVector<const char *>> CheckPoints;
   unsigned CheckPointCounter = 0;
 
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index a8717424f1d155..d3a56f726b7b85 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -1424,7 +1424,6 @@ bool Preprocessor::HandleModuleContextualKeyword(Token &Result) {
         LookUpIdentifierInfo(*NextTok);
       if (NextTok->isOneOf(tok::identifier, tok::colon, tok::semi)) {
         Result.setKind(tok::kw_module);
-        ModuleDeclLoc = Result.getLocation();
         return true;
       }
     }

``````````

</details>


https://github.com/llvm/llvm-project/pull/239947


More information about the cfe-commits mailing list