diff options
author | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-04-25 14:26:07 +0800 |
---|---|---|
committer | Chuanqi Xu <yedeng.yd@linux.alibaba.com> | 2024-04-25 14:26:07 +0800 |
commit | 72b58146b14308c0c745111f082fc6354cefda22 (patch) | |
tree | 2ee29de49e186738e0848881c95ae64db77c2378 /clang/lib/Frontend/ASTUnit.cpp | |
parent | 011a65353b8b4dc018541f86356f2dfa0f124f1a (diff) | |
download | llvm-72b58146b14308c0c745111f082fc6354cefda22.zip llvm-72b58146b14308c0c745111f082fc6354cefda22.tar.gz llvm-72b58146b14308c0c745111f082fc6354cefda22.tar.bz2 |
Revert "[NFC] [Serialization] Avoid using DeclID directly as much as possible"
This reverts commit 42070a5c092ed420bf92ebf38229c594885e94c7.
I forgot to touch lldb.
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 2f75313e..361331d 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -1067,7 +1067,7 @@ public: std::vector<Decl *> takeTopLevelDecls() { return std::move(TopLevelDecls); } - std::vector<LocalDeclID> takeTopLevelDeclIDs() { + std::vector<DeclID> takeTopLevelDeclIDs() { return std::move(TopLevelDeclIDs); } @@ -1101,7 +1101,7 @@ public: private: unsigned Hash = 0; std::vector<Decl *> TopLevelDecls; - std::vector<LocalDeclID> TopLevelDeclIDs; + std::vector<DeclID> TopLevelDeclIDs; llvm::SmallVector<ASTUnit::StandaloneDiagnostic, 4> PreambleDiags; }; @@ -1471,9 +1471,7 @@ void ASTUnit::RealizeTopLevelDeclsFromPreamble() { for (const auto TopLevelDecl : TopLevelDeclsInPreamble) { // Resolve the declaration ID to an actual declaration, possibly // deserializing the declaration in the process. - // - // FIMXE: We shouldn't convert a LocalDeclID to GlobalDeclID directly. - if (Decl *D = Source.GetExternalDecl(GlobalDeclID(TopLevelDecl.get()))) + if (Decl *D = Source.GetExternalDecl(TopLevelDecl)) Resolved.push_back(D); } TopLevelDeclsInPreamble.clear(); |