From d4f99c8bac8b28f18c864a717d8833db6a1c872d Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 22 Mar 2023 12:04:33 -0400 Subject: Source map obfuscation (#2717) * #include an absolute path didn't work - because paths were taken to always be relative. * WIP source map. * Split out handling of RttiTypeFuncs to a map type. * Make RttiTypeFuncsMap hold default impls. * Slightly more sophisticated RttiTypeFuncsMap * Source map decoding. * Fix tabs. * Fix asserts due to negative values. * Use less obscure mechanisms in SourceMap. * Source map decoding. Simplifying SourceMap usage. * First attempt at ouputting a source map as part of emit. * Added support for -source-map option. SourceMap is added to the artifact. * Small improvements around column calculation in SourceWriter. * Source Loc obuscation WIP. * Fix some issues around SourceMap obfuscation. * Split out obfuscation into its own file. * Keep obfuscated SourceMap even through serialization bottleneck. --- source/core/slang-char-encode.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/core/slang-char-encode.h') diff --git a/source/core/slang-char-encode.h b/source/core/slang-char-encode.h index a778cc3c9..2bb4cba29 100644 --- a/source/core/slang-char-encode.h +++ b/source/core/slang-char-encode.h @@ -195,6 +195,16 @@ protected: static CharEncoding*const g_encoding[Index(CharEncodeType::CountOf)]; }; +struct UTF8Util +{ + /// Given a slice calculate the number of code points (unicode chars) + /// + /// NOTE! This doesn't check the *validity* of code points/encoding. + /// Non valid utf8 input or ending starting in partial characters, will produce + /// undefined results without error. + static Index calcCodePointCount(const UnownedStringSlice& in); +}; + } #endif -- cgit v1.2.3