Tue, 06 May 2014 09:56:55 -0400
8041620: Solaris Studio 12.4 C++ 5.13 change in behavior for placing friend declarations within surrounding scope.
Summary: Remove adlc's unused class FileBuffRegion.
Reviewed-by: coleenp, dholmes, kvn
duke@435 | 1 | /* |
lfoltan@9816 | 2 | * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
duke@435 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | * |
duke@435 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | * published by the Free Software Foundation. |
duke@435 | 8 | * |
duke@435 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | * accompanied this code). |
duke@435 | 14 | * |
duke@435 | 15 | * You should have received a copy of the GNU General Public License version |
duke@435 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | * |
trims@1907 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
trims@1907 | 20 | * or visit www.oracle.com if you need additional information or have any |
trims@1907 | 21 | * questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
stefank@2314 | 25 | #ifndef SHARE_VM_ADLC_FILEBUFF_HPP |
stefank@2314 | 26 | #define SHARE_VM_ADLC_FILEBUFF_HPP |
stefank@2314 | 27 | |
duke@435 | 28 | // FILEBUFF.HPP - Definitions for parser file buffering routines |
xlu@664 | 29 | #include <iostream> |
duke@435 | 30 | |
xlu@664 | 31 | using namespace std; |
twisti@1038 | 32 | |
duke@435 | 33 | // STRUCTURE FOR HANDLING INPUT AND OUTPUT FILES |
kvn@4161 | 34 | |
kvn@4161 | 35 | class BufferedFile { |
kvn@4161 | 36 | public: |
duke@435 | 37 | const char *_name; |
duke@435 | 38 | FILE *_fp; |
kvn@4161 | 39 | inline BufferedFile() { _name = NULL; _fp = NULL; }; |
kvn@4161 | 40 | inline ~BufferedFile() {}; |
kvn@4161 | 41 | }; |
duke@435 | 42 | |
duke@435 | 43 | class ArchDesc; |
duke@435 | 44 | |
duke@435 | 45 | //------------------------------FileBuff-------------------------------------- |
duke@435 | 46 | // This class defines a nicely behaved buffer of text. Entire file of text |
twisti@1040 | 47 | // is read into buffer at creation, with sentinels at start and end. |
duke@435 | 48 | class FileBuff { |
duke@435 | 49 | private: |
duke@435 | 50 | long _bufferSize; // Size of text holding buffer. |
duke@435 | 51 | long _offset; // Expected filepointer offset. |
duke@435 | 52 | long _bufoff; // Start of buffer file offset |
duke@435 | 53 | |
duke@435 | 54 | char *_buf; // The buffer itself. |
twisti@1040 | 55 | char *_bigbuf; // The buffer plus sentinels; actual heap area |
twisti@1040 | 56 | char *_bufmax; // A pointer to the buffer end sentinel |
duke@435 | 57 | char *_bufeol; // A pointer to the last complete line end |
duke@435 | 58 | |
duke@435 | 59 | int _err; // Error flag for file seek/read operations |
duke@435 | 60 | long _filepos; // Current offset from start of file |
never@850 | 61 | int _linenum; |
duke@435 | 62 | |
duke@435 | 63 | ArchDesc& _AD; // Reference to Architecture Description |
duke@435 | 64 | |
duke@435 | 65 | // Error reporting function |
duke@435 | 66 | void file_error(int flag, int linenum, const char *fmt, ...); |
duke@435 | 67 | |
duke@435 | 68 | public: |
duke@435 | 69 | const BufferedFile *_fp; // File to be buffered |
duke@435 | 70 | |
duke@435 | 71 | FileBuff(BufferedFile *fp, ArchDesc& archDesc); // Constructor |
duke@435 | 72 | ~FileBuff(); // Destructor |
duke@435 | 73 | |
duke@435 | 74 | // This returns a pointer to the start of the current line in the buffer, |
duke@435 | 75 | // and increments bufeol and filepos to point at the end of that line. |
duke@435 | 76 | char *get_line(void); |
never@850 | 77 | int linenum() const { return _linenum; } |
jrose@910 | 78 | void set_linenum(int line) { _linenum = line; } |
duke@435 | 79 | |
duke@435 | 80 | // This converts a pointer into the buffer to a file offset. It only works |
duke@435 | 81 | // when the pointer is valid (i.e. just obtained from getline()). |
ohair@1204 | 82 | long getoff(const char* s) { return _bufoff + (long)(s - _buf); } |
duke@435 | 83 | }; |
stefank@2314 | 84 | #endif // SHARE_VM_ADLC_FILEBUFF_HPP |