diff options
| author | Tor Aamodt <[email protected]> | 2020-07-04 16:26:52 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-07-04 16:26:52 -0700 |
| commit | 673f8a9f0056b456871642f4d25be5c598fcba6e (patch) | |
| tree | a9f379ae6ff144e8f3eccd3d510a36c2c0983edd /src/cuda-sim/ptxinfo.y | |
| parent | c9cc4281bf84ad6cff77d20389b59d14a534ad6b (diff) | |
| parent | 9d3caa1cb2c70a3be186d4704ecab0fe13277516 (diff) | |
Merge pull request #1 from gpgpu-sim/dev
Dev
Diffstat (limited to 'src/cuda-sim/ptxinfo.y')
| -rw-r--r-- | src/cuda-sim/ptxinfo.y | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/cuda-sim/ptxinfo.y b/src/cuda-sim/ptxinfo.y index d241d8c..b303958 100644 --- a/src/cuda-sim/ptxinfo.y +++ b/src/cuda-sim/ptxinfo.y @@ -27,6 +27,17 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +%{ +typedef void * yyscan_t; +#include "ptx_loader.h" +%} + +%define api.pure full +%parse-param {yyscan_t scanner} +%parse-param {ptxinfo_data* ptxinfo} +%lex-param {yyscan_t scanner} +%lex-param {ptxinfo_data* ptxinfo} + %union { int int_value; char * string_value; @@ -66,15 +77,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. static unsigned g_declared; static unsigned g_system; - int ptxinfo_lex(void); - void ptxinfo_addinfo(); + int ptxinfo_lex(YYSTYPE * yylval_param, yyscan_t yyscanner, ptxinfo_data* ptxinfo); + void yyerror(yyscan_t yyscanner, ptxinfo_data* ptxinfo, const char* msg); void ptxinfo_function(const char *fname ); void ptxinfo_regs( unsigned nregs ); void ptxinfo_lmem( unsigned declared, unsigned system ); void ptxinfo_gmem( unsigned declared, unsigned system ); void ptxinfo_smem( unsigned declared, unsigned system ); void ptxinfo_cmem( unsigned nbytes, unsigned bank ); - int ptxinfo_error(const char*); void ptxinfo_linenum( unsigned ); void ptxinfo_dup_type( const char* ); %} @@ -93,7 +103,7 @@ line: HEADER INFO COLON line_info ; line_info: function_name - | function_info { ptxinfo_addinfo(); } + | function_info { ptxinfo->ptxinfo_addinfo(); } | gmem_info ; |
