summaryrefslogtreecommitdiff
path: root/source/diagnostic.h
AgeCommit message (Collapse)AuthorFilesLines
2018-08-03Rewrite include guards (#1793)dan sinclair1-3/+3
This CL rewrites the include guards to make PRESUBMIT.py include guard check happy.
2018-07-07Change libspirv to spvtools namespace (#1678)dan sinclair1-5/+4
This CL changes all of the libspirv namespace code to spvtools to match the rest of the code base.
2018-06-19[val] Add extra context to error messages. (#1600)dan sinclair1-1/+6
[val] Add extra context to error messages. This CL extends the error messages produced by the validator to output the disassembly of the errored line. The validation_id messages have also been updated to print the line number of the error instead of the word number. Note, the error number is from the start of the SPIR-V, it does not include any headers printed in the disassembled code. Fixes #670, #1581
2017-10-03DiagnosticStream move ctor moves output duties to new objectDavid Neto1-7/+9
- Take over contents of the expiring message stream - Prevent the expiring object from emitting anything during destruction
2016-09-22Clean up header dependency.Lei Zhang1-1/+1
2016-09-21Publish the C++ interface.Lei Zhang1-3/+1
2016-09-15Add a callback mechanism for communicating messages to callers.Lei Zhang1-10/+15
Every time an event happens in the library that the user should be aware of, the callback will be invoked. The existing diagnostic mechanism is hijacked internally by a callback that creates an diagnostic object each time an event happens.
2016-09-02Relicense SPIRV-Tools under Apache 2.0David Neto1-21/+9
Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/383 Finalize v2016.4
2016-09-02Kill diagnostic_helper & the wrapping DIAGNOSTIC macro.Lei Zhang1-26/+0
2016-08-24Remove some unused macros and functions.Lei Zhang1-22/+0
2016-06-08Split validate_types file into multiple classesUmar Arshad1-1/+22
Creates separate files for the ValidationState, Function and BasicBlock classes.
2016-02-17Rearrange headersDavid Neto1-1/+1
Now we have public headers arranged as follows: $SPIRV_TOOLS_ROOT/include/spirv-tools/libspirv.h $SPIRV_TOOLS_ROOT/include/spirv/spirv.h $SPIRV_TOOLS_ROOT/include/spirv/GLSL.std.450.h $SPIRV_TOOLS_ROOT/include/spirv/OpenCL.std.h A project should use -I$SPIRV_TOOLS_ROOT/include and then #include "spirv-tools/libspirv.h" The headers from the SPIR-V Registry can be accessed as "spirv/spirv." for example. The install target should also install the headers from the SPIR-V Registry. The libspirv.h header is broken otherwise. The SPIRV-Tools library depends on the headers from the SPIR-V Registry. The util/bitutils.h and util/hex_float.h are pulled into the internal source tree. Those are not part of the public API to SPIRV-Tools.
2016-01-13Function and block layout checks. very basic CFG.Umar Arshad1-0/+2
This adds function and block layout checks to the validator. Very basic CFG code has been added to make sure labels and branches are correctly ordered. Also: * MemoryModel and Variable instruction checks/tests * Use spvCheckReturn instead of CHECK_RESULT * Fix invalid SSA tests * Created libspirv::spvResultToString in diagnostic.h * Documented various functions and classes * Fixed error messages * Fixed using declaration for FunctionDecl enum class
2016-01-07Extend copyright to 2016.Dejan Mircevski1-1/+1
2016-01-06Avoid parameter shadowing in source/diagnostic.hDavid Neto1-9/+10
Change the offending class to more closely follow Google C++ style: - Member names have a trailing underscore. - Use an accessor method for the stream_ member.
2015-11-20Put DiagnosticStream and clr exports in libspirv namespaceDavid Neto1-2/+6
Each exported functions either has an "spv" prefix, or is inthe libspirv namespace. Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/18
2015-11-12Use quotation for libspirv.h and sort headers.Lei Zhang1-2/+2
2015-11-10DiagnosticStream keeps a copy of the position.David Neto1-2/+2
Don't store the pointer, as the underlying storage could disappear. This a bit more flexible and robust.
2015-11-10Run clang-format to enforce Google style globally.Lei Zhang1-7/+7
Note that we are more strict than Google style for one aspect: pointer/reference indicators are adjacent to their types, not their variables. find . -name "*.h" -exec clang-format -i {} \; find . -name "*.cpp" -exec clang-format -i {} \;
2015-11-02Inclusion guards follow Google C++ styleDavid Neto1-3/+3
Follow the scheme in http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#The__define_Guard except: - 'include/' is dropped from the guard token - 'source/' is dropped from the guard token
2015-10-26SPV_FAILED_MATCH error mutes DiagnosticStream.David Neto1-1/+2
The DiagnosticStream will not emit the accumulated message text if the error is SPV_FAILED_MATCH. Change various interfaces to accept the intended error code instead of a boolean "is_optional". This allows us to avoid repeating the following type of logic deep inside helper methods: if (is_optional) return SPV_FAILED_MATCH; return diagnostic() << " message text ";
2015-10-26DiagnosticStream can convert to a stored error codeDavid Neto1-8/+19
Use this to shorten error return code in the assembler. For example, change this: if (error = something()) { diagnostic() << " Bad integer literal " << value; return SPV_ERROR_INVALID_VALUE; } to this: if (error = something()) return diagnostic() << " Bad integer literal " << value; Also shorten code due to the fact that binaryEncodeU32 and binaryCodeU64 can't fail (short of failure to expand a std::vector).
2015-10-26Refactored dynamic and static state out of text processing.Andrew Woloszyn1-2/+33
This reduces the number of arguments required to be passed to every single function. This is in preparation for adding id tracking.
2015-05-22Code drop of the Codeplay spirv-tools source.Kenneth Benzie (Benie)1-0/+59
This commit contains the source for the SPIRV static library, spirv-as, spirv-dis, and spirv-val tools.