gdb: remove TYPE_CODE macro
[deliverable/binutils-gdb.git] / gdb / compile / compile-c-support.c
index 5c700bbac260bef9570491c78cec3b294e01d167..8499300179c06e121540a9743516c16a0a8874e2 100644 (file)
@@ -1,6 +1,6 @@
 /* C/C++ language support for compilation.
 
-   Copyright (C) 2014-2018 Free Software Foundation, Inc.
+   Copyright (C) 2014-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 #include "compile-c.h"
 #include "compile-cplus.h"
 #include "compile.h"
-#include "gdb-dlfcn.h"
 #include "c-lang.h"
 #include "macrotab.h"
 #include "macroscope.h"
 #include "regcache.h"
-#include "common/function-view.h"
-#include "common/preprocessor.h"
+#include "gdbsupport/function-view.h"
+#include "gdbsupport/gdb-dlfcn.h"
+#include "gdbsupport/preprocessor.h"
+#include "gdbarch.h"
 
 /* See compile-internal.h.  */
 
@@ -241,7 +242,7 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
               maximally-aligned array of the correct size.  */
 
            fputs_unfiltered ("  ", stream);
-           switch (TYPE_CODE (regtype))
+           switch (regtype->code ())
              {
              case TYPE_CODE_PTR:
                fprintf_filtered (stream, "__gdb_uintptr %s",
@@ -270,11 +271,11 @@ generate_register_struct (struct ui_file *stream, struct gdbarch *gdbarch,
 
              default:
                fprintf_unfiltered (stream,
-                                   "  unsigned char %s[%d]"
+                                   "  unsigned char %s[%s]"
                                    " __attribute__((__aligned__("
                                    "__BIGGEST_ALIGNMENT__)))",
                                    regname.c_str (),
-                                   TYPE_LENGTH (regtype));
+                                   pulongest (TYPE_LENGTH (regtype)));
              }
            fputs_unfiltered (";\n", stream);
          }
@@ -572,7 +573,7 @@ public:
           register struct before the function body.  This requires a
           temporary stream.  */
        gdb::unique_xmalloc_ptr<unsigned char> registers_used
-         = generate_c_for_variable_locations (m_instance, var_stream, m_arch,
+         = generate_c_for_variable_locations (m_instance, &var_stream, m_arch,
                                               expr_block, expr_pc);
 
        buf.puts ("typedef unsigned int"
This page took 0.044955 seconds and 4 git commands to generate.