]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/d/imports.cc
Update copyright years.
[thirdparty/gcc.git] / gcc / d / imports.cc
index 2e3eb7408b76d17992ad556cee489d29632612a6..d3a3099ce764164677a295aceba44f76b5848a66 100644 (file)
@@ -1,5 +1,5 @@
 /* imports.cc -- Build imported modules/declarations.
-   Copyright (C) 2014-2020 Free Software Foundation, Inc.
+   Copyright (C) 2014-2022 Free Software Foundation, Inc.
 
 GCC is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -68,7 +68,7 @@ public:
   void visit (Module *m)
   {
     Loc loc = (m->md != NULL) ? m->md->loc
-      : Loc (m->srcfile->toChars (), 1, 0);
+      : Loc (m->srcfile.toChars (), 1, 0);
 
     m->isym = build_decl (make_location_t (loc), NAMESPACE_DECL,
                          get_identifier (m->toPrettyChars ()),
@@ -130,12 +130,12 @@ public:
        /* Type imports should really be part of their own visit method.  */
        if (type != NULL)
          {
-           if (type->ty == Tenum)
-             dsym = ((TypeEnum *) type)->sym;
-           else if (type->ty == Tstruct)
-             dsym = ((TypeStruct *) type)->sym;
-           else if (type->ty == Tclass)
-             dsym = ((TypeClass *) type)->sym;
+           if (type->ty == TY::Tenum)
+             dsym = type->isTypeEnum ()->sym;
+           else if (type->ty == TY::Tstruct)
+             dsym = type->isTypeStruct ()->sym;
+           else if (type->ty == TY::Tclass)
+             dsym = type->isTypeClass ()->sym;
          }
       }
 
@@ -202,7 +202,7 @@ build_import_decl (Dsymbol *d)
       input_location = saved_location;
     }
 
-  /* Not all visitors set 'isym'.  */
+  /* Not all visitors set `isym'.  */
   return d->isym ? d->isym : NULL_TREE;
 }