<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/source/slang/lexer.h, branch master</title>
<subtitle>Making it easier to work with shaders</subtitle>
<id>https://git.yummers.dev/slang.git/atom?h=master</id>
<link rel='self' href='https://git.yummers.dev/slang.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/'/>
<updated>2019-05-31T21:20:37+00:00</updated>
<entry>
<title>Use slang- prefix on slang compiler and core source (#973)</title>
<updated>2019-05-31T21:20:37+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2019-05-31T21:20:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=6cbc3929a54d37bd23cb5efa8e3320ba02f78b2f'/>
<id>urn:sha1:6cbc3929a54d37bd23cb5efa8e3320ba02f78b2f</id>
<content type='text'>
* Prefixing source files in source/slang with slang-

* Prefix source in source/slang with slang- prefix.

* Rename core source files with slang- prefix.

* Update project files.

* Fix problems from automatic merge.
</content>
</entry>
<entry>
<title>Allow generics to close with &gt;&gt;</title>
<updated>2019-02-06T00:14:14+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@google.com</email>
</author>
<published>2019-02-05T22:20:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=c198eaba351850fcb3d82c2f5117efc0e2e2bf1e'/>
<id>urn:sha1:c198eaba351850fcb3d82c2f5117efc0e2e2bf1e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Feature/lex memory reduction (#762)</title>
<updated>2018-12-20T18:23:58+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2018-12-20T18:23:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=02e44bade6370309c0292e84178095c2bae299be'/>
<id>urn:sha1:02e44bade6370309c0292e84178095c2bae299be</id>
<content type='text'>
* Only do scrubbing if needed. When allocating content try to limit size (with scrubbing each token takes up 1k), now it's 16 bytes min size.

* Don't allocate for every call to write on the CallbackWriter - use the m_appendBuffer.

* Don't allocate memory for CallbackWriter use m_appendBuffer.

* Use UnownedStringSlice for suffix output for parsing float/int literals.
Fix typo in invalidFloatingPointLiteralSuffix

* Using memory arena to hold tokens that are not in SourceManager.

* Improve comment on lexing.

* Make UnownedStringSlice allocation simpler on SourceManager.

* Fix error on gcc around UnownedStringSlice - because VC converted string + UnownedStringSlice automatically into a String.

* Fix generateName needing concat string for gcc.

* When constructing a Token in parseAttributeName - because it's a Identifier, we have to set the Name.

* Remove translation through String on getIntrinsicOp

* Make func-cbuffer-param disablable with -exclude compatibility-issue

* Move memory leak in render-test.

* From review - can just use "?:" instead of performing a concat.
</content>
</entry>
<entry>
<title>Feature/source loc review (#672)</title>
<updated>2018-10-13T02:02:09+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2018-10-13T02:02:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=a7a87cec8c98872299e5dbe4c47a852a954b692b'/>
<id>urn:sha1:a7a87cec8c98872299e5dbe4c47a852a954b692b</id>
<content type='text'>
* Fixes/improvements based around review comments.

* SourceUnit -&gt; SourceView

* * Removed the HumaneSourceLoc as it's POD-like ness seemed to make that unnecessary
* Made exposed member variables in SourceManager protected - so make clear where/how can be accesed
* Improved description about SourceLoc and associated structures

* Changed SourceLocType to 'Actual' and 'Nominal'.

* Improved a comment.
</content>
</entry>
<entry>
<title>Feature/source loc refactor (#668)</title>
<updated>2018-10-10T17:56:25+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2018-10-10T17:56:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=879ec1b385d290a4375682ec613a9e7a1967fc7d'/>
<id>urn:sha1:879ec1b385d290a4375682ec613a9e7a1967fc7d</id>
<content type='text'>
* * Remove the need for IRHighLevelDecoration in Emit
* Use the IRLayoutDecoration for GeometryShaderPrimitiveTypeModifier

* Initial look at at variable byte encoding, and simple unit test.

* Fixing problems with comparison due to naming differences with slang/fxc.

* * More tests and perf improvements for byte encoding.
* Mechanism to detect processor and processor features in main slang header.

* Split out cpu based defines into slang-cpu-defines.h so do not polute slang.h

* Support for variable byte encoding on serialization.

* Removed unused flag.

* Fix warning.

* Fix calcMsByte32 for 0 values without using intrinsic.

* Fix a mistake in calculating maximum instruction size.

* Introduced the idea of SourceUnit.

* Small improvements around naming.
Add more functionality - including getting the HumaneLoc.

* Add support for #line default

* Compiling with new SourceLoc handling.

* Fix off by one on #line directives.

* Can use 32bits for SourceLoc. Fix serialize to use that.

* Small fixes and comment on usage.

* Premake run.

* Fix signed warning.

* Fix typo on StringSlicePool::has found in review.
</content>
</entry>
<entry>
<title>Preprocessor cleanups (#484)</title>
<updated>2018-04-13T00:08:52+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2018-04-13T00:08:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=021a4923f429278b1d7434e01cbf83edcdf43da4'/>
<id>urn:sha1:021a4923f429278b1d7434e01cbf83edcdf43da4</id>
<content type='text'>
* For a `#error` or `#warning`, read the rest of the line as raw text to include in the error message

* When skipping tokens (e.g., in an `#ifdef`d out block), don't emit errors on invalid characters
  * TODO: we could clearly get more efficient and skip whole raw lines in the future

* Fix an issue when a macro invocation that expands to nothing (zero tokens) is the last thing before a directive. The preprocessor was returning the `#` as an ordinary token, because it has already gone past its test for directives.</content>
</entry>
<entry>
<title>First attempt at a Linux build (#193)</title>
<updated>2017-09-27T18:17:39+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2017-09-27T18:17:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=74f2f47cb63b02638270beecd20acea1a0f5665e'/>
<id>urn:sha1:74f2f47cb63b02638270beecd20acea1a0f5665e</id>
<content type='text'>
* First attempt at a Linux build

- Fix up places where C++ idioms were written assuming lenient behavior of Microsoft's compiler

- Add a few more alternatives for platform-specific behavior where Windows was the only platform accounted for.

- Add a basic Makefile that can at least invoke our build, even if it isn't going good dependency tracking, etc.

- Build `libslang.so` and `slangc` that depends on it, using a relative `RPATH` to make the binary portable (I hope)

- Add an initial `.travis.yml` to see if we can trigger their build process.

* Fixup: const bug in `List::Sort`

I'm not clear why this gets picked up by the gcc *and* clang that Travis uses, but not the (newer) gcc I'm using on Ubuntu here, but I'm hoping it is just some missing `const` qualifiers.

* Fixup: reorder specialization of "class info"

Clang complains about things being specialized after being instantiated (implicilty), and I hope it is just the fact that I generate the class info for the roots of the hierarchy after the other cases. We'll see.

* Fixup: add `platform.cpp` to unified/lumped build

* Fixup: Windows uses `FreeLibrary`

and not `UnloadLibrary`

* Fixup: fix Windows project file to include new source file

This obviously points to the fact that we are going to need to be generating these files sooner or later.
</content>
</entry>
<entry>
<title>Add an explicit `Name` type</title>
<updated>2017-08-14T21:48:37+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoley@nvidia.com</email>
</author>
<published>2017-08-14T21:48:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=9885c972a6bfa6f856e505cdd90d9b71fdbdadaf'/>
<id>urn:sha1:9885c972a6bfa6f856e505cdd90d9b71fdbdadaf</id>
<content type='text'>
Fixes #23

Up to this point, the compiler has used the ordinary `String` type to represent declaration names, which means a bunch of lookup structures throughout the compiler were string-to-whatever maps, which can reduce efficiency.
It also means that things like the `Token` type end up carying a `String` by value and paying for things like reference-counting.

This change adds a `Name` type that is used to represent names of variables, types, macros, etc.
Names are cached and unique'd globally for a session, and the string-to-name mapping gets done during lexing.
From that point on, most mapping is from pointers, which should make all the various table lookups faster.

More importantly (possibly), this brings us one step closer to being able to pool-allocate the AST nodes.
</content>
</entry>
<entry>
<title>Make source location lightweight</title>
<updated>2017-08-10T20:05:04+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoley@nvidia.com</email>
</author>
<published>2017-08-09T19:57:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=a5a436c4783fb75a0d089a6483219c06db91f593'/>
<id>urn:sha1:a5a436c4783fb75a0d089a6483219c06db91f593</id>
<content type='text'>
Fixes #24

So far the code has used a representation for source locations that is heavy-weight, but typical of research or hobby compilers: a `struct` type containing a line number and a (heap-allocated) string.
This is actually very convenient for debugging, but it means that any data structure that might contain a source location needs careful memory management (because of those strings) and has a tendency to bloat.

The new represnetation is that a source location is just a pointer-sized integer.
In the simplest mental model, you can think of this as just counting every byte of source text that is passed in, and using those to name locations.

Finding the path and line number that corresponds to a location involves a lookup step, but we can arrange to store all the files in an array sorted by their start locations, and do a binary search.
Finding line numbers inside a file is similarly fast (one you pay a one-time cost to build an array of starting offsets for lines).

More advanced compilers like clang actually go further and create a unique range of source locations to represent a file each time it gets included, so that they can track the include stack and reproduce it in diagnostic messages.
I'm not doing anything that clever here.
</content>
</entry>
<entry>
<title>Store integer literals at high precision in AST</title>
<updated>2017-06-28T18:51:23+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoley@nvidia.com</email>
</author>
<published>2017-06-28T18:39:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=ff53669ed918c87d15ddea2d07fda84d4c8eff5d'/>
<id>urn:sha1:ff53669ed918c87d15ddea2d07fda84d4c8eff5d</id>
<content type='text'>
The lexer was creating an `unsigned long long` value, and then the AST was storing it in an `int`.
This change makes both use a `long long`.

This is obviously still a stopgap until I can get arbitrary precisions in here.
</content>
</entry>
</feed>
