Commit graph

33 commits

Author SHA1 Message Date
ReinUsesLisp
22cc6f6c1b cmake: Always treat warnings as errors
Enable cast warnings in gcc and clang and always treat warnings as
errors.

GetWordCount now returns std::size_t for simplicity and the word count
is asserted and casted in WordCount (now called CalculateTotalWords.

Silence warnings.
2019-11-27 05:25:35 -03:00
ReinUsesLisp
b4eeadfd9b operand: Use pure virtual functions 2019-11-01 06:07:53 -03:00
ReinUsesLisp
4c2981eab5 operand: Move operand_type initialization to constructor 2019-11-01 05:52:49 -03:00
ReinUsesLisp
53d572ae7d Drop usage of dynamic_cast in favour of static_cast 2019-11-01 05:44:27 -03:00
ReinUsesLisp
de91660f3c op: Replace owning star pointers with unique_ptr 2019-11-01 05:33:53 -03:00
ReinUsesLisp
8cf3d225db Assemble uint32_t instead of uint8_t
Vulkan receives SPIR-V modules with a uint32_t alignment. Returning
uint8_t forced users to invoke undefined behaviour (reinterpret_cast)
or copy.
2019-10-18 03:46:47 -03:00
ReinUsesLisp
6e14d37386 Add asserts against nullptr operands 2019-09-11 01:19:53 -03:00
ReinUsesLisp
d24685ebd3 Revert "operand: Implement operand hashing and use hashed set for declarations"
This reverts commit 1e665afa36.
2019-09-09 16:48:05 -03:00
ReinUsesLisp
60a856d266 Relicense to The BSD 3-clause license 2019-07-14 18:50:44 -03:00
ReinUsesLisp
1e665afa36 operand: Implement operand hashing and use hashed set for declarations
Instead of manually searching each element in the declarations vector,
use an unordered_set to emplace new declarations avoiding repetition.
2019-06-08 05:23:15 -03:00
Lioncash
47d85b81a7 CMakeLists: Apply compilation flags to the sirit target
Previously this wasn't utilizing any of the compiler flags, meaning it
wasn't applying any of the specified warnings.

Since applying the warnings to the target, this uncovered a few warning
cases, such as shadowing class variables on MSVC, etc, which have been fixed.
2019-03-14 19:30:54 -03:00
Lioncash
f6f5913b5f op: Use std::vector's insert member function within vector variant of Add()
While looping here does work fine, it's mildly inefficient, particularly
if the number of members being added is large, because it can result in
multiple allocations over the period of the insertion, depending on how
much extra memory push_back may allocate for successive elements.

Instead, we can just tell the std::vector that we want to slap the whole
contained sequence at the back of it with insert, which lets it allocate
the whole memory block in one attempt.
2019-03-14 04:31:14 -03:00
Lioncash
6fd44e494c Pass std::string by value where applicable.
By taking the std::string by value in the constructor, this allows for
certain situations where copies can be elided entirely (when moving an
instance into the constructor)

e.g.

std::string var = ...

...

... = LiteralString(std::move(var)) // Or whatever other initialization
                                    // is done.

No copy will be done in this case, the move transfers it into the
constructor, and then the move within the initializer list transfers it
into the member variable.

tl;dr: This allows the calling code to potentially construct less
std::string instances by allowing moving into the parameters themselves.
2019-03-14 04:30:39 -03:00
Lioncash
984b731e17 op: Amend constructor initializer list order
Amends the order of the initializer list to be structured the same way
the members are ordered.

Silences a -Wreorder warning.
2019-03-14 02:45:57 -04:00
ReinUsesLisp
73595f4588 Change clang-format settings 2019-03-11 03:26:21 -03:00
ReinUsesLisp
9d787510d3 Fixup assert formatting 2018-11-16 04:21:01 -03:00
ReinUsesLisp
f5944d61a6 Upgrade from LGPLv2.1 to LGPLv3 2018-11-16 04:10:10 -03:00
ReinUsesLisp
91e0769db5 Fixup build issues 2018-11-01 05:13:30 -03:00
ReinUsesLisp
63ca1b5243 Rename Ref alias to Id 2018-10-31 22:20:49 -03:00
ReinUsesLisp
a08aeec982 Add Op* prefix to instructions that have to be emited 2018-10-31 21:23:27 -03:00
ReinUsesLisp
00fc8daf56 Use variant instead of creating an object for literals 2018-10-28 14:57:49 -03:00
ReinUsesLisp
3f845b7c48 Fixup build errors 2018-10-28 04:59:15 -03:00
ReinUsesLisp
8c1ab76ce5 Fix "for" incosistencies 2018-10-23 05:09:17 -03:00
ReinUsesLisp
f581df0935 Resolve leaks moving from Add to Sink 2018-10-23 05:02:18 -03:00
ReinUsesLisp
951ef21f17 Rename bad overload Add to Sink 2018-10-23 04:52:07 -03:00
ReinUsesLisp
1458bd2c1c Add OpDecorate 2018-10-23 04:45:56 -03:00
ReinUsesLisp
0485e1877c Use some C++17 features 2018-10-03 00:32:45 -03:00
ReinUsesLisp
014c6ab586 Split literal files 2018-08-28 04:16:52 -03:00
ReinUsesLisp
954774f9e8 Alias "const Op*" -> "Ref". 2018-08-28 04:01:21 -03:00
ReinUsesLisp
48cbe695f0 Add OpConstant 2018-08-27 00:29:40 -03:00
ReinUsesLisp
f68dbb20fc Fixup License header 2 -> 2.1 2018-08-26 23:28:39 -03:00
ReinUsesLisp
c0d61d32d4 Fixup License 2018-08-26 22:27:33 -03:00
ReinUsesLisp
1de01c95ae Rename Ref -> Op 2018-08-25 20:34:06 -03:00
Renamed from src/ref.cpp (Browse further)