[clang] [HLSL][NFC] Add missing includes for standalone header compilation (PR #161473)

Jordan Rupprecht via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 30 20:53:35 PDT 2025


https://github.com/rupprecht created https://github.com/llvm/llvm-project/pull/161473

HLSLResource.h added by #161254 builds in the context of a .cpp file (e.g. CGHLSLRuntime.cpp) but not when doing a header compilation, e.g.:

```
clang/include/clang/AST/Attrs.inc:12:45: error: unknown type name 'raw_ostream'; did you mean 'clang::raw_ostream'?
   12 | static inline void DelimitAttributeArgument(raw_ostream& OS, bool& IsFirst) {
```

>From a113b908a7ce6be63b339d55cf1d97abab260412 Mon Sep 17 00:00:00 2001
From: Jordan Rupprecht <rupprecht at google.com>
Date: Tue, 30 Sep 2025 20:47:44 -0700
Subject: [PATCH] Add missing includes

---
 clang/include/clang/AST/HLSLResource.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/clang/include/clang/AST/HLSLResource.h b/clang/include/clang/AST/HLSLResource.h
index e3ee0b136cec3..9cdd81b2d8dab 100644
--- a/clang/include/clang/AST/HLSLResource.h
+++ b/clang/include/clang/AST/HLSLResource.h
@@ -15,9 +15,12 @@
 #define LLVM_CLANG_AST_HLSLRESOURCE_H
 
 #include "clang/AST/ASTContext.h"
+#include "clang/AST/Attr.h"
 #include "clang/AST/Attrs.inc"
 #include "clang/AST/DeclBase.h"
 #include "clang/Basic/TargetInfo.h"
+#include "clang/Support/Compiler.h"
+#include "llvm/Support/raw_ostream.h"
 
 namespace clang {
 



More information about the cfe-commits mailing list