diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2020-05-07 15:00:33 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-07 15:00:33 -0400 |
| commit | c16abd4fe1bda5ebcd50dbb22f30c6be43bb885f (patch) | |
| tree | d127a9bd48708d909ab36efdd2ac0d9956f7541b /source/slang/slang-diagnostics.h | |
| parent | 9245460adaf739c5a4d85f7f477b65fcd07d595b (diff) | |
Enhanced C++ extractor (#1340)
* Extractor builds without any reference to syntax (as it will be helping to produce this!).
* Change macros to include the super class.
* Added indexOf(const UnownedSubString& in) to UnownedSubString.
Refactored extractor
* Output a macro for each type with the extracted info - can be used during injection in class
* Simplify the header file - as can get super type and last from macro now
* Store the 'origin' of a definition
* Some small tidy ups to the extractor.
* Improve comments on the extractor options.
* Made CPPExtractor own SourceOrigins
* Small fixes around SourceOrigin.
* Small tidy up around macroOrign
Diffstat (limited to 'source/slang/slang-diagnostics.h')
| -rw-r--r-- | source/slang/slang-diagnostics.h | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/source/slang/slang-diagnostics.h b/source/slang/slang-diagnostics.h index 8ab860708..80e14d1c1 100644 --- a/source/slang/slang-diagnostics.h +++ b/source/slang/slang-diagnostics.h @@ -69,15 +69,11 @@ namespace Slang }; class Name; - class Decl; - struct QualType; - class Type; - struct TypeExp; - class Val; - enum class CodeGenTarget; - enum class Stage : SlangStage; - enum class ProfileVersion; + //enum class CodeGenTarget; + + //enum class Stage : SlangStage; + //enum class ProfileVersion; void printDiagnosticArg(StringBuilder& sb, char const* str); @@ -92,15 +88,11 @@ namespace Slang void printDiagnosticArg(StringBuilder& sb, Slang::String const& str); void printDiagnosticArg(StringBuilder& sb, Slang::UnownedStringSlice const& str); void printDiagnosticArg(StringBuilder& sb, Name* name); - void printDiagnosticArg(StringBuilder& sb, Decl* decl); - void printDiagnosticArg(StringBuilder& sb, Type* type); - void printDiagnosticArg(StringBuilder& sb, TypeExp const& type); - void printDiagnosticArg(StringBuilder& sb, QualType const& type); + void printDiagnosticArg(StringBuilder& sb, TokenType tokenType); void printDiagnosticArg(StringBuilder& sb, Token const& token); - void printDiagnosticArg(StringBuilder& sb, CodeGenTarget val); - void printDiagnosticArg(StringBuilder& sb, Val* val); - + + template<typename T> void printDiagnosticArg(StringBuilder& sb, RefPtr<T> ptr) { @@ -109,13 +101,8 @@ namespace Slang inline SourceLoc const& getDiagnosticPos(SourceLoc const& pos) { return pos; } - class SyntaxNode; - SourceLoc const& getDiagnosticPos(SyntaxNode const* syntax); SourceLoc const& getDiagnosticPos(Token const& token); - SourceLoc const& getDiagnosticPos(TypeExp const& typeExp); - - struct IRInst; - SourceLoc const& getDiagnosticPos(IRInst* inst); + template<typename T> SourceLoc getDiagnosticPos(RefPtr<T> const& ptr) |
