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

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 30 20:54:03 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Jordan Rupprecht (rupprecht)

<details>
<summary>Changes</summary>

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) {
```

---
Full diff: https://github.com/llvm/llvm-project/pull/161473.diff


1 Files Affected:

- (modified) clang/include/clang/AST/HLSLResource.h (+3) 


``````````diff
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 {
 

``````````

</details>


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


More information about the cfe-commits mailing list