//1// Copyright (C) 2016 Google, Inc.2//3// All rights reserved.4//5// Redistribution and use in source and binary forms, with or without6// modification, are permitted provided that the following conditions7// are met:8//9// Redistributions of source code must retain the above copyright10// notice, this list of conditions and the following disclaimer.11//12// Redistributions in binary form must reproduce the above13// copyright notice, this list of conditions and the following14// disclaimer in the documentation and/or other materials provided15// with the distribution.16//17// Neither the name of Google Inc. nor the names of its18// contributors may be used to endorse or promote products derived19// from this software without specific prior written permission.20//21// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS22// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT23// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS24// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE25// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,26// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,27// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;28// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER29// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT30// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN31// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE32// POSSIBILITY OF SUCH DAMAGE.3334#ifndef GLSLANG_SPIRV_LOGGER_H35#define GLSLANG_SPIRV_LOGGER_H3637#include <string>38#include <vector>3940namespace spv {4142// A class for holding all SPIR-V build status messages, including43// missing/TBD functionalities, warnings, and errors.44class SpvBuildLogger {45public:46SpvBuildLogger() {}4748// Registers a TBD functionality.49void tbdFunctionality(const std::string& f);50// Registers a missing functionality.51void missingFunctionality(const std::string& f);5253// Logs a warning.54void warning(const std::string& w) { warnings.push_back(w); }55// Logs an error.56void error(const std::string& e) { errors.push_back(e); }5758// Returns all messages accumulated in the order of:59// TBD functionalities, missing functionalities, warnings, errors.60std::string getAllMessages() const;6162private:63SpvBuildLogger(const SpvBuildLogger&);6465std::vector<std::string> tbdFeatures;66std::vector<std::string> missingFeatures;67std::vector<std::string> warnings;68std::vector<std::string> errors;69};7071} // end spv namespace7273#endif // GLSLANG_SPIRV_LOGGER_H747576