[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-20 Thread Xiang Li via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG079a5ffb0a3f: [HLSL] Support PCH for cc1 mode (authored by python3kgae). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132421/new/

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-20 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 461695. python3kgae marked 2 inline comments as done. python3kgae added a comment. Move #include "clang/Sema/MultiplexExternalSemaSource.h" into FrontendAction.cpp Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-20 Thread Chris Bieneman via Phabricator via cfe-commits
beanz accepted this revision. beanz added a comment. This revision is now accepted and ready to land. One small nit, otherwise looks good. Comment at: clang/include/clang/Sema/HLSLExternalSemaSource.h:18 #include "clang/Sema/ExternalSemaSource.h" +#include

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-18 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 461131. python3kgae added a comment. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132421/new/ https://reviews.llvm.org/D132421 Files: clang/include/clang/Sema/HLSLExternalSemaSource.h

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-14 Thread Xiang Li via Phabricator via cfe-commits
python3kgae added inline comments. Comment at: clang/lib/Sema/HLSLExternalSemaSource.cpp:55 + } else +PrevDecl = dyn_cast(Found); + assert(PrevDecl && "Unexpected lookup result type."); aaron.ballman wrote: > Is it possible that this finds a

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-14 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 460175. python3kgae marked 4 inline comments as done. python3kgae added a comment. Code cleanup per comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132421/new/ https://reviews.llvm.org/D132421

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-14 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/Sema/HLSLExternalSemaSource.cpp:50 +if (S.LookupQualifiedName(Result, HLSLNamespace)) { + NamedDecl *Found = Result.getFoundDecl(); + if (auto *TD = dyn_cast(Found)) { 99.9% sure this is

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-12 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 459519. python3kgae marked an inline comment as done. python3kgae added a comment. Fix test fail caused by not add HLSL builtin Resource type. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132421/new/

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-09 Thread Xiang Li via Phabricator via cfe-commits
python3kgae marked an inline comment as done. python3kgae added inline comments. Comment at: clang/lib/Frontend/FrontendAction.cpp:1036 +// Only add HLSLSema when not in MultiSource. +if (!MultiSource->HasSource()) +

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-09 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 459149. python3kgae added a comment. Remove useless code since ExternalSource is not be reused when there're more than one Input files. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132421/new/

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-09 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a reviewer: aaron.ballman. beanz added a subscriber: aaron.ballman. beanz added a comment. Looping @aaron.ballman in here too. I think we need some eyes from outside our team on this before landing it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-09 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/lib/Frontend/FrontendAction.cpp:1036 +// Only add HLSLSema when not in MultiSource. +if (!MultiSource->HasSource()) + MultiSource->AddSource(HLSLSema.get()); This seems off. The multi source

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-09 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 458966. python3kgae added a comment. Only add HLSLExternalSemaSource when ExternalSource is not HLSLExternalSemaSource. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132421/new/

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-09 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 458965. python3kgae added a comment. Only add HLSLSema when not has it in ExternalSource. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132421/new/ https://reviews.llvm.org/D132421 Files:

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-02 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 457735. python3kgae added a comment. Merge fix from Chris. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132421/new/ https://reviews.llvm.org/D132421 Files:

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-02 Thread Xiang Li via Phabricator via cfe-commits
python3kgae added inline comments. Comment at: clang/lib/Sema/HLSLExternalSemaSource.cpp:78 + // ExternalAST path. + // PrevRecord->setHasExternalLexicalStorage(); + if (PrevRecord->isCompleteDefinition()) { If comment this line out.

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-09-02 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 457684. python3kgae added a comment. Rebase to use MultiplexExternalSemaSource. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132421/new/ https://reviews.llvm.org/D132421 Files:

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-08-31 Thread Xiang Li via Phabricator via cfe-commits
python3kgae marked an inline comment as done. python3kgae added inline comments. Comment at: clang/include/clang/Sema/HLSLExternalSemaSource.h:58 +/// them before we initialize the ExternalSemaSource base class. +struct ChainedHLSLExternalSemaSourceMembers { +

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-08-31 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/include/clang/Sema/HLSLExternalSemaSource.h:58 +/// them before we initialize the ExternalSemaSource base class. +struct ChainedHLSLExternalSemaSourceMembers { + ChainedHLSLExternalSemaSourceMembers(ExternalSemaSource *ExtSema)

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-08-31 Thread Xiang Li via Phabricator via cfe-commits
python3kgae marked an inline comment as done. python3kgae added inline comments. Comment at: clang/include/clang/Sema/HLSLExternalSemaSource.h:58 +/// them before we initialize the ExternalSemaSource base class. +struct ChainedHLSLExternalSemaSourceMembers { +

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-08-31 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 457081. python3kgae added a comment. Move reuse decl in PCH into BuiltinTypeDeclBuilder. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132421/new/ https://reviews.llvm.org/D132421 Files:

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-08-31 Thread Xiang Li via Phabricator via cfe-commits
python3kgae added inline comments. Comment at: clang/lib/Sema/HLSLExternalSemaSource.cpp:297 + } + IdentifierInfo = AST.Idents.get("hlsl", tok::TokenKind::identifier); beanz wrote: > I think the core of what you'e doing here is not far off, but I think this

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-08-30 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/include/clang/Sema/HLSLExternalSemaSource.h:58 +/// them before we initialize the ExternalSemaSource base class. +struct ChainedHLSLExternalSemaSourceMembers { + ChainedHLSLExternalSemaSourceMembers(ExternalSemaSource *ExtSema)

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-08-29 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 456387. python3kgae added a comment. Fix format. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132421/new/ https://reviews.llvm.org/D132421 Files: clang/include/clang/Sema/HLSLExternalSemaSource.h

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-08-26 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 456046. python3kgae added a comment. Fix build error Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132421/new/ https://reviews.llvm.org/D132421 Files: clang/include/clang/Sema/HLSLExternalSemaSource.h

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-08-24 Thread Xiang Li via Phabricator via cfe-commits
python3kgae updated this revision to Diff 455389. python3kgae added a comment. Reuse decls already in PCH when initailize HLSLExternalSemaSource. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132421/new/ https://reviews.llvm.org/D132421 Files:

[PATCH] D132421: [HLSL] Support PCH for cc1 mode

2022-08-23 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: clang/test/SemaHLSL/pch.hlsl:5 +// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -x hlsl \ +// RUN: -finclude-default-header -include-pch %t -ast-dump-all /dev/null \ +// RUN: | FileCheck %s I want to make