aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/go-linemap.h
AgeCommit message (Collapse)AuthorFilesLines
2018-10-29compiler: add location_fileIan Lance Taylor1-2/+14
Add support for getting the file name from a Location value. This will be used by later work. Reviewed-on: https://go-review.googlesource.com/c/145318 * go-linemap.cc (Gcc_linemap::location_file): New method. From-SVN: r265598
2016-10-11compiler: move Backend/Linemap creation out of front end.Than McIntosh1-4/+0
Push the calls to create Backend and Linemap object out of the front end into the back end, and instead pass pointers to these objects in the go_create_gogo_args struct. This allows for more flexibility in the interfaces used to create the objects. Reviewed-on: https://go-review.googlesource.com/30698 * go-gcc.h: New file. * go-c.h (struct go_create_gogo_args): Add backend and linemap fields. * go-lang.c: Include "go-gcc.h". (go_langhook_init): Set linemap and backend fields of args. * go-gcc.cc: Include "go-gcc.h". * go-linemap.cc: Include "go-gcc.h". From-SVN: r240959
2016-10-10compiler: prune away gcc-specific linemap usageThan McIntosh1-0/+12
Add an interface to the go Linemap class to allow clients to ask for the line number for a Location (for debugging dumps), so as to move some gcc-specific location code into the back end. Reviewed-on: https://go-review.googlesource.com/30699 * go-linemap.cc (Gcc_linemap::location_line): New method. From-SVN: r240942
2016-09-27compiler: add src information to AST dumps (part 1 of 2).Than McIntosh1-1/+14
When emitting AST dumps, tag the end of selected statements with with source file and line number information where available. Example: tmp.76832448 = 0 // p.go:6 Requires a corresponding change in gcc/go as well as this change to gofrontend. Reviewed-on: https://go-review.googlesource.com/29856 * go-linemap.cc (Gcc_linemap::to_string): New method. From-SVN: r240558
2011-11-29compiler: Define and use backend-independent Location class.Sanjoy Das1-0/+131
From Sanjoy Das. * go-location.h: New file. * go-linemap.cc: New file. * go-gcc.cc: Change all uses of source_location to Location. * Make-lang.in (GO_OBJS): Add go/go-linemap.o. (GO_LINEMAP_H): New variable. (GO_LEX_H): Use $(GO_LINEMAP_H). (GO_GOGO_H, GO_TYPES_H, GO_IMPORT_H): Likewise. (go/go-linemap.o): New target. Co-Authored-By: Ian Lance Taylor <iant@google.com> From-SVN: r181813