1 // 2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 7 #include "compiler/translator/InfoSink.h" 8 9 namespace sh 10 { 11 prefix(Severity severity)12void TInfoSinkBase::prefix(Severity severity) 13 { 14 switch (severity) 15 { 16 case SH_WARNING: 17 sink.append("WARNING: "); 18 break; 19 case SH_ERROR: 20 sink.append("ERROR: "); 21 break; 22 default: 23 sink.append("UNKOWN ERROR: "); 24 break; 25 } 26 } 27 location(int file,int line)28void TInfoSinkBase::location(int file, int line) 29 { 30 TPersistStringStream stream; 31 if (line) 32 stream << file << ":" << line; 33 else 34 stream << file << ":? "; 35 stream << ": "; 36 37 sink.append(stream.str()); 38 } 39 40 } // namespace sh 41