diff options
author | Sanjoy Das <thedigitalangel@gmail.com> | 2011-11-29 19:10:50 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-11-29 19:10:50 +0000 |
commit | 8afa2bfbdc60088acd7f199245244890a6e7773e (patch) | |
tree | f79cf7c9d2d4e5b74c516201a60c5753fe79c93f /gcc/go/gofrontend/runtime.cc | |
parent | 09ad58e618b0145ed98ee081ffc8117824390972 (diff) | |
download | gcc-8afa2bfbdc60088acd7f199245244890a6e7773e.zip gcc-8afa2bfbdc60088acd7f199245244890a6e7773e.tar.gz gcc-8afa2bfbdc60088acd7f199245244890a6e7773e.tar.bz2 |
compiler: Define and use backend-independent Location class.
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
Diffstat (limited to 'gcc/go/gofrontend/runtime.cc')
-rw-r--r-- | gcc/go/gofrontend/runtime.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/go/gofrontend/runtime.cc b/gcc/go/gofrontend/runtime.cc index 2ecfbf5..42f1e78 100644 --- a/gcc/go/gofrontend/runtime.cc +++ b/gcc/go/gofrontend/runtime.cc @@ -82,7 +82,7 @@ runtime_function_type(Runtime_function_type bft) go_assert(bft < NUMBER_OF_RUNTIME_FUNCTION_TYPES); if (runtime_function_types[bft] == NULL) { - const source_location bloc = BUILTINS_LOCATION; + const Location bloc = Linemap::predeclared_location(); Type* t; switch (bft) { @@ -193,7 +193,7 @@ runtime_function_type(Runtime_function_type bft) static Expression* convert_to_runtime_function_type(Runtime_function_type bft, Expression* e, - source_location loc) + Location loc) { switch (bft) { @@ -295,7 +295,7 @@ Runtime::runtime_declaration(Function code) { const Runtime_function* pb = &runtime_functions[code]; - source_location bloc = BUILTINS_LOCATION; + Location bloc = Linemap::predeclared_location(); Typed_identifier_list* param_types = NULL; if (pb->parameter_types[0] != RFT_VOID) @@ -347,7 +347,7 @@ Runtime::runtime_declaration(Function code) // Make a call to a runtime function. Call_expression* -Runtime::make_call(Runtime::Function code, source_location loc, +Runtime::make_call(Runtime::Function code, Location loc, int param_count, ...) { go_assert(code < Runtime::NUMBER_OF_FUNCTIONS); @@ -387,7 +387,8 @@ Runtime::map_iteration_type() mpz_t ival; mpz_init_set_ui(ival, map_iteration_size); - Expression* iexpr = Expression::make_integer(&ival, NULL, BUILTINS_LOCATION); + Expression* iexpr = Expression::make_integer(&ival, NULL, + Linemap::predeclared_location()); mpz_clear(ival); return Type::make_array_type(runtime_function_type(RFT_POINTER), iexpr); |