1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/angle/src/compiler/Diagnostics.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 1.4 +// 1.5 +// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. 1.6 +// Use of this source code is governed by a BSD-style license that can be 1.7 +// found in the LICENSE file. 1.8 +// 1.9 + 1.10 +#ifndef COMPILER_DIAGNOSTICS_H_ 1.11 +#define COMPILER_DIAGNOSTICS_H_ 1.12 + 1.13 +#include "compiler/preprocessor/DiagnosticsBase.h" 1.14 + 1.15 +class TInfoSink; 1.16 + 1.17 +class TDiagnostics : public pp::Diagnostics 1.18 +{ 1.19 + public: 1.20 + TDiagnostics(TInfoSink& infoSink); 1.21 + virtual ~TDiagnostics(); 1.22 + 1.23 + TInfoSink& infoSink() { return mInfoSink; } 1.24 + 1.25 + int numErrors() const { return mNumErrors; } 1.26 + int numWarnings() const { return mNumWarnings; } 1.27 + 1.28 + void writeInfo(Severity severity, 1.29 + const pp::SourceLocation& loc, 1.30 + const std::string& reason, 1.31 + const std::string& token, 1.32 + const std::string& extra); 1.33 + 1.34 + void writeDebug(const std::string& str); 1.35 + 1.36 + protected: 1.37 + virtual void print(ID id, 1.38 + const pp::SourceLocation& loc, 1.39 + const std::string& text); 1.40 + 1.41 + private: 1.42 + TInfoSink& mInfoSink; 1.43 + int mNumErrors; 1.44 + int mNumWarnings; 1.45 +}; 1.46 + 1.47 +#endif // COMPILER_DIAGNOSTICS_H_