================
@@ -1472,5 +1473,38 @@ IdentifierInfo *ParseHLSLRootSignature(Sema &Actions,
return DeclIdent;
}
+void HandleRootSignatureTarget(Sema &S, StringRef EntryRootSig) {
+ ASTConsumer *Consumer = &S.getASTConsumer();
+
+ // Minimally initalize the parser. This does a couple things:
+ // - initializes Sema scope handling
+ // - invokes HLSLExternalSemaSource
+ // - invokes the preprocessor to lex the macros in the file
+ std::unique_ptr<Parser> P(new Parser(S.getPreprocessor(), S, true));
+ S.getPreprocessor().EnterMainSourceFile();
+
+ bool HaveLexer = S.getPreprocessor().getCurrentLexer();
+ if (HaveLexer) {
+ P->Initialize();
+ S.ActOnStartOfTranslationUnit();
+
+ // Skim through the file to parse to find the define
+ while (P->getCurToken().getKind() != tok::eof)
+ P->ConsumeAnyToken();
+
----------------
bogner wrote:
I don't think we can remove `-finclude-default-header` because that may cause
the input file to have parse errors, which could impede finding the define. I
agree that consuming the file seems necessary here.
https://github.com/llvm/llvm-project/pull/156373
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits