Skip to content

Commit 29cde65

Browse files
committed
nfc, self-review: simplify diag reporting with helper function
1 parent d4cf62d commit 29cde65

File tree

2 files changed

+46
-114
lines changed

2 files changed

+46
-114
lines changed

clang/include/clang/Parse/ParseHLSLRootSignature.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ class RootSignatureParser {
194194
/// StringLiterals
195195
SourceLocation getTokenLocation(RootSignatureToken Tok);
196196

197+
/// Construct a diagnostics at the location of the current token
198+
DiagnosticBuilder reportDiag(unsigned DiagID) {
199+
return getDiags().Report(getTokenLocation(CurToken), DiagID);
200+
}
201+
197202
private:
198203
llvm::dxbc::RootSignatureVersion Version;
199204
SmallVector<llvm::hlsl::rootsig::RootElement> &Elements;

0 commit comments

Comments
 (0)