aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/FrontendActions.cpp
diff options
context:
space:
mode:
authoryronglin <yronglin777@gmail.com>2025-04-16 20:53:25 +0800
committerGitHub <noreply@github.com>2025-04-16 20:53:25 +0800
commitd3153ad66c539ad146062b6e65741901e5b5e1cc (patch)
tree2e2340c0ef9215149ec7f46256830437e5e547fb /clang/lib/Frontend/FrontendActions.cpp
parentfe4a31d59db7b18dc45c3593bf100c101e725b79 (diff)
downloadllvm-d3153ad66c539ad146062b6e65741901e5b5e1cc.zip
llvm-d3153ad66c539ad146062b6e65741901e5b5e1cc.tar.gz
llvm-d3153ad66c539ad146062b6e65741901e5b5e1cc.tar.bz2
[clang] Unify `SourceLocation` and `IdentifierInfo*` pair-like data structures to `IdentifierLoc` (#135808)
I found this issue when I working on https://github.com/llvm/llvm-project/pull/107168. Currently we have many similiar data structures like: - `std::pair<IdentifierInfo *, SourceLocation>`. - Element type of `ModuleIdPath`. - `IdentifierLocPair`. - `IdentifierLoc`. This PR unify these data structures to `IdentifierLoc`, moved `IdentifierLoc` definition to SourceLocation.h, and deleted other similer data structures. --------- Signed-off-by: yronglin <yronglin777@gmail.com>
Diffstat (limited to 'clang/lib/Frontend/FrontendActions.cpp')
-rw-r--r--clang/lib/Frontend/FrontendActions.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Frontend/FrontendActions.cpp b/clang/lib/Frontend/FrontendActions.cpp
index c5aeb92..e6c7b9f 100644
--- a/clang/lib/Frontend/FrontendActions.cpp
+++ b/clang/lib/Frontend/FrontendActions.cpp
@@ -1216,9 +1216,9 @@ void GetDependenciesByModuleNameAction::ExecuteAction() {
SourceManager &SM = PP.getSourceManager();
FileID MainFileID = SM.getMainFileID();
SourceLocation FileStart = SM.getLocForStartOfFile(MainFileID);
- SmallVector<std::pair<IdentifierInfo *, SourceLocation>, 2> Path;
+ SmallVector<IdentifierLoc, 2> Path;
IdentifierInfo *ModuleID = PP.getIdentifierInfo(ModuleName);
- Path.push_back(std::make_pair(ModuleID, FileStart));
+ Path.emplace_back(FileStart, ModuleID);
auto ModResult = CI.loadModule(FileStart, Path, Module::Hidden, false);
PPCallbacks *CB = PP.getPPCallbacks();
CB->moduleImport(SourceLocation(), Path, ModResult);