[PATCH] D132421: [HLSL] Support PCH for cc1 mode
Xiang Li via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 14 11:59:16 PDT 2022
python3kgae added inline comments.
================
Comment at: clang/lib/Sema/HLSLExternalSemaSource.cpp:55
+ } else
+ PrevDecl = dyn_cast<CXXRecordDecl>(Found);
+ assert(PrevDecl && "Unexpected lookup result type.");
----------------
aaron.ballman wrote:
> Is it possible that this finds a different kind of tag, like an enumeration?
No, enum with the same name will get an error when building the PCH.
================
Comment at: clang/lib/Sema/HLSLExternalSemaSource.cpp:378
+ if (S.LookupQualifiedName(Result, AST.getTranslationUnitDecl()))
+ PrevDecl = Result.getAsSingle<NamespaceDecl>();
+ HLSLNamespace = NamespaceDecl::Create(AST, AST.getTranslationUnitDecl(),
----------------
aaron.ballman wrote:
> How certain are you that there's only one result possible here?
I cannot think of a case more than one result is here.
================
Comment at: clang/lib/Sema/HLSLExternalSemaSource.cpp:459-461
+ ASTContext &AST = SemaPtr->getASTContext();
+ IdentifierInfo &II = AST.Idents.get("Resource", tok::TokenKind::identifier);
+ LookupResult Result(*SemaPtr, &II, SourceLocation(), Sema::LookupTagName);
----------------
aaron.ballman wrote:
> We made a lookup result but then do nothing with it?
Removed.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132421/new/
https://reviews.llvm.org/D132421
More information about the cfe-commits
mailing list