Convert to /* */ style and lightly edit some language.
/* Header file for GDB compile C-language support.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2017 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
gcc_type convert_type (struct type *type);
- // Plug-in forwards
+ /* Plug-in forwards */
unsigned int c_version () const;
private:
- // The GCC C context.
+ /* The GCC C context. */
struct gcc_c_context *m_context;
};
extern char *c_symbol_substitution_name (struct symbol *sym);
-#endif // GDB_COMPILE_C_H
+#endif /* GDB_COMPILE_C_H */
/* Convert symbols from GDB to GCC
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2017 Free Software Foundation, Inc.
This file is part of GDB.
#include "dwarf2loc.h"
#include "cp-support.h"
#include "gdbcmd.h"
-#include "compile-c.h" // !!keiths FIXME for c_get_range_decl_name
+#include "compile-c.h" /* !!keiths FIXME for c_get_range_decl_name */
\f
using namespace compile;
-// See description in compile-internal.h.
+/* See description in compile-internal.h. */
int debug_compile_oracle = 0;
std::string name;
char *symbol_name = NULL;
- // Add a null cleanup for templates. !!keiths: remove!
+ /* Add a null cleanup for templates. !!keiths: remove! */
struct cleanup *back_to
= make_cleanup (free_current_contents, &symbol_name);
symbol_name, addr, filename, line);
}
- // Pop scope for non-local symbols.
+ /* Pop scope for non-local symbols. */
if (!is_local)
instance->leave_scope ();
}
sym_type = instance->convert_type (type);
instance->push_namespace ("");
- // FIXME: push (and, after the call, pop) any other namespaces, if
- // any, and drop the above when defining a class member. drop any
- // namespace and class names from before the symbol name, and any
- // function signatures from after it. -lxo
+ /* FIXME: push (and, after the call, pop) any other namespaces, if
+ any, and drop the above when defining a class member. drop any
+ namespace and class names from before the symbol name, and any
+ function signatures from after it. -lxo */
/* !!keiths: I don't see how we could do this. We have NO debug
information for the symbol. While we have access to the demangled
name, we still don't know what A::B::C::D::E::F means without debug
/* Template support for compile.
- Copyright (C) 2016 Free Software Foundation, Inc.
+ Copyright (C) 2016, 2017 Free Software Foundation, Inc.
This file is part of GDB.
enum template_parameter_type_modifier
{
- // The abstract parameter type is not qualified at all.
+ /*/ The abstract parameter type is not qualified at all. */
PARAMETER_NONE,
- // The abstract parameter type was declared `const', const T.
+ /* The abstract parameter type was declared `const', const T. */
PARAMETER_CONST,
- // The abstract parameter type was declared `volatile', volatile T.
+ /* The abstract parameter type was declared `volatile', volatile T. */
PARAMETER_VOLATILE,
- // The abstract parameter type was declared `restrict', restrict T.
+ /* The abstract parameter type was declared `restrict', restrict T. */
PARAMETER_RESTRICT,
- // The abstract parameter type was declared as a pointer, T*.
+ /* The abstract parameter type was declared as a pointer, T*. */
PARAMETER_POINTER,
- // The abstract parameter type was declared as a reference, T&.
+ /* The abstract parameter type was declared as a reference, T&. */
PARAMETER_LVALUE_REFERENCE,
- // The abstract parameter type was declared as rvalue reference, T&&.
+ /* The abstract parameter type was declared as rvalue reference,
+ T&&. */
PARAMETER_RVALUE_REFERENCE
};
typedef enum template_parameter_type_modifier template_parameter_modifier;
-// Forward declarations
+/* Forward declarations. */
static void print_template_parameter_list
(struct ui_file *stream, const struct template_argument_info *arg_info);
(const struct demangle_component *comp,
const struct template_symbol *tsymbol, struct ui_file *stream);
-// See description in compile-cplus-templates.h.
+/* See description in compile-cplus-templates.h. */
function_template_defn::function_template_defn
(std::string generic, parsed_demangle_info info,
return str;
}
-// Compute the generic used by the given function template definition.
+/* Compute the generic used by the given function template
+ definition. */
static std::string
compute_function_template_generic (struct template_symbol *tsymbol,
{
gdb_assert (info.tree () != NULL);
- // Make sure template arguments have been decoded.
+ /* Ensure template arguments have been decoded. */
cp_decode_template_type_indices (tsymbol, info.info ());
- // Output the template generic.
+ /* Output the template generic. */
char *generic_c = function_template_decl (tsymbol, info.info ());
std::string generic (generic_c);
xfree (generic_c);
return generic;
}
-// See description in compile-cplus.h.
+/* See description in compile-cplus.h. */
void
compile_cplus_instance::maybe_define_new_function_template
- (const struct symbol *sym, struct type *parent_type, int f_idx, int m_idx)
+ (const struct symbol *sym, struct type *parent_type, int f_idx,
+ int m_idx)
+
{
if (sym != NULL && SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION (sym))
{
if (pos == m_function_template_defns->end ())
{
- // New template definition -- insert it into the cache.
+ /* Create the new template definition and insert it into
+ the cache. */
defn = new function_template_defn (generic, info, tsym, parent_type,
f_idx, m_idx);
m_function_template_defns->insert
}
else
{
- // Use the existing definition.
+ /* Or use the existing definition. */
defn = pos->second.get ();
}
}
}
-// See description in compile-cplus-templates.h.
+/* See description in compile-cplus-templates.h. */
void
compile::define_templates (compile_cplus_instance *instance,
instance->emit_class_template_decls ();
}
-// See description in compile-cplus-templates.h.
+/* See description in compile-cplus-templates.h. */
function_template_defn *
compile_cplus_instance::find_function_template_defn
= m_function_template_defns->find (generic);
if (pos != m_function_template_defns->end ())
{
- // A template generic for this was already defined.
+ /* A template generic for this was already defined. */
return pos->second.get ();
}
- // No generic for this template was found.
+ /* No generic for this template was found. */
return NULL;
}
-// Compute the generic used by the given function template definition.
+/* Compute the generic used by the given function template
+ definition. */
static std::string
compute_class_template_generic (std::string name, struct type *type)
struct ui_file *stream = mem_fileopen ();
struct cleanup *back_to = make_cleanup_ui_file_delete (stream);
- // Format: class|struct|union NAME<parameters>
+ /* Format: class|struct|union NAME<parameters> */
if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
{
if (TYPE_DECLARED_CLASS (type))
return string_generic;
}
-// See description in compile-cplus-templates.h.
+/* See description in compile-cplus-templates.h. */
class_template_defn *
compile_cplus_instance::find_class_template_defn (struct type *type)
return NULL;
}
-// A class providing printing for a single parameter type modifier.
+/* A class providing printing for a single parameter type modifier. */
class one_template_type_modifier_printer
{
public:
- // Construct a new printer which outputs to STREAM.
+ /* Construct a new printer which outputs to STREAM. */
explicit one_template_type_modifier_printer (struct ui_file *stream)
: m_stream (stream)
{
}
- // Unary function to output the modifier.
+ /* Unary function to output the modifier. */
void operator() (template_parameter_modifier modifier)
{
switch (modifier)
}
private:
- // The stream to which to print the modifier.
+ /* The stream to which to print the modifier. */
struct ui_file *m_stream;
};
-// Print the type modifiers MODIFIERS to STREAM.
+/* Print the type modifiers MODIFIERS to STREAM. */
static void
print_template_type_modifiers
const struct template_symbol *tsymbol,
struct ui_file *stream)
{
- // Get the template parameter and modifiers.
+ /* Get the template parameter and modifiers. */
std::vector<template_parameter_modifier> modifiers;
comp = get_template_type (comp, modifiers);
print_template_type_modifiers (modifiers, stream);
}
-// Print the template parameter list of a type/symbol to STREAM.
+/* Print the template parameter list of a type/symbol to STREAM. */
static void
print_template_parameter_list (struct ui_file *stream,
tidx = tsymbol->template_argument_indices[i - artificials];
if (tidx == -1)
{
- // A concrete type was used to define this argument.
+ /* A concrete type was used to define this argument. */
c_print_type (TYPE_FIELD_TYPE (ttype, i), "", stream, -1, 0,
&type_print_raw_options);
continue;
/* The type of this argument was specified by a template parameter,
possibly with added CV and ref qualifiers. */
- // Get the next ARGLIST node and print it.
+ /* Get the next ARGLIST node and print it. */
comp = d_right (comp);
gdb_assert (comp != NULL);
gdb_assert (comp->type == DEMANGLE_COMPONENT_ARGLIST);
case DEMANGLE_COMPONENT_QUAL_NAME:
{
- // Print out the qualified name.
+ /* Print out the qualified name. */
struct cleanup *back_to;
char *ret = cp_comp_to_string (d_left (comp), 10);
fprintf_unfiltered (stream, "%s::", ret);
do_cleanups (back_to);
- // Follow the rest of the name.
+ /* Follow the rest of the name. */
comp = d_right (comp);
}
break;
}
}
-// See description in compile-cplus-templates.h.
+/* See description in compile-cplus-templates.h. */
void
compile_cplus_instance::maybe_define_new_class_template
if (pos == m_class_template_defns->end ())
{
- // New template definition -- insert it into the cache.
+ /* Insert the new template definition into the cache. */
defn
= new class_template_defn (decl_name, generic, type);
m_class_template_defns->insert (std::make_pair (generic, defn));
}
else
{
- // Existing definition. Use the existing definition.
+ /* If there is an existing definition, use that definition. */
defn = pos->second.get ();
}
- // Loop over the template arguments, noting any default values.
+ /* Loop over the template arguments, noting any default values. */
for (unsigned int i = 0; i < TYPE_N_TEMPLATE_ARGUMENTS (type); ++i)
{
if (defn->default_argument (i) == NULL
}
}
-// See description in compile-cplus-templates.h.
+/* See description in compile-cplus-templates.h. */
void
compile::scan_type_for_function_templates (compile_cplus_instance *instance,
break;
case template_parameter:
- // GDB doesn't support template-template parameters.
+ /* GDB doesn't support template-template parameters. */
break;
case variadic_parameter:
- // GDB doesn't support variadic templates.
+ /* GDB doesn't support variadic templates. */
break;
default:
}
}
-// Fill in the `kinds' member of DEST from ARG_INFO.
+/* Populate the `kinds' member of DEST from ARG_INFO. */
static void
enumerate_template_parameter_kinds
}
}
-// See description in compile-cplus-templates.h.
+/* See description in compile-cplus-templates.h. */
void
compile_cplus_instance::enumerate_template_arguments
}
}
-// A class to add type modifiers to a given compiler type.
+/* A class to add type modifiers to a given compiler type. */
class template_parameter_type_modifier_adder
{
}
}
- // Returns the modified type.
+ /* Returns the modified type. */
gcc_type type () const
{
}
private:
- // The compiler instance into which to define the new type(s).
+ /* The compiler instance into which to define the new type(s). */
compile_cplus_instance *m_instance;
- // The qualifier flags.
+ /* The qualifier flags. */
gcc_cp_qualifiers_flags m_flags;
- // The type we are modifying.
+ /* The type we are modifying. */
gcc_type m_type;
};
-// Add the modifiers given by MODIFIERS to TYPE.
+/* Add the modifiers given by MODIFIERS to TYPE. */
static gcc_type
add_template_type_modifiers
return adder.type ();
}
-// Add the type modifiers described in COMP to BASE_TYPE.
+/* Add the type modifiers described in COMP to BASE_TYPE. */
static gcc_type
add_type_modifiers (compile_cplus_instance *instance,
return;
}
- // Make sure we only do this once.
+ /* Ensure this is one-time operation. */
defn->set_defined (true);
struct fn_field *method_field;
if (name != id)
sym_kind |= GCC_CP_FLAG_SPECIAL_FUNCTION;
- // Define any default value types.
+ /* Define any default value types. */
define_default_template_parameter_types (m_instance, defn,
tsym->template_arguments);
- // Assess the processing context.
+ /* Assess the processing context. */
gcc_type result;
compile_scope scope
= m_instance->new_scope (SYMBOL_NATURAL_NAME (&tsym->base),
return;
}
- // Start the new template declaration.
+ /* Start the new template declaration. */
m_instance->enter_scope (scope);
m_instance->start_new_template_decl (defn->generic ().c_str ());
- // Get the parameters' generic kinds and types.
+ /* Get the parameters' generic kinds and types. */
define_template_parameters_generic (m_instance, defn,
tsym->template_arguments,
symbol_symtab (&tsym->base)->filename,
SYMBOL_LINE (&tsym->base));
- // Find the function node describing this template function.
+ /* Find the function node describing this template function. */
gdb_assert (defn->demangle_info ()->tree ()->type
== DEMANGLE_COMPONENT_TYPED_NAME);
struct demangle_component *comp = d_right (defn->demangle_info ()->tree ());
return_type = m_instance->convert_type (temp);
}
- // Get the parameters' definitions, and put them into ARRAY.
+ /* Get the parameters' definitions, and put them into ARRAY. */
struct type *templ_type = SYMBOL_TYPE (&tsym->base);
int is_varargs = is_varargs_p (templ_type);
struct gcc_type_array array;
int artificials = 0;
- // d_right (info->tree) is FUNCTION_TYPE (assert above).
+ /* d_right (info->tree) is FUNCTION_TYPE (assert above). */
comp = d_right (d_right (defn->demangle_info ()->tree ()));
gdb_assert (comp != NULL && comp->type == DEMANGLE_COMPONENT_ARGLIST);
if (tidx == -1)
{
- // The parameter's type is a concrete type.
+ /* The parameter's type is a concrete type. */
array.elements[i - artificials]
= m_instance->convert_type (arg_type);
}
else
{
- // The parameter's type is a template parameter.
+ /* The parameter's type is a template parameter. */
gcc_type result = defn->parameter_abstract_type (tidx);
array.elements[i - artificials]
cache. */
class_type = m_instance->convert_type (defn->parent_type ());
- // Add any virtuality flags.
+ /* Add any virtuality flags. */
if (TYPE_FN_FIELD_VIRTUAL_P (methods, defn->midx ()))
{
sym_kind |= GCC_CP_FLAG_VIRTUAL_FUNCTION;
}
}
- // Add access flags.
+ /* Add access flags. */
sym_kind |= get_method_access_flag (defn->parent_type (),
defn->fidx (), defn->midx ());
- // Create the method type.
+ /* Create the method type. */
if (!TYPE_FN_FIELD_STATIC_P (methods, defn->midx ()))
{
gcc_cp_qualifiers_flags quals;
gcc_cp_ref_qualifiers_flags rquals;
- quals = (enum gcc_cp_qualifiers) 0; // !!keiths FIXME
- rquals = GCC_CP_REF_QUAL_NONE; // !!keiths FIXME
+ quals = (enum gcc_cp_qualifiers) 0; /* !!keiths FIXME */
+ rquals = GCC_CP_REF_QUAL_NONE; /* !!keiths FIXME */
func_type
= m_instance->build_method_type (class_type, func_type, quals,
rquals);
}
}
- // Finally, define the new generic template declaration.
+ /* Finally, define the new generic template declaration. */
gcc_decl decl
= m_instance->new_decl ("function template", name, sym_kind,
func_type, 0, 0,
private:
- // The compiler instance to use.
+ /* The compiler instance to use. */
compile_cplus_instance *m_instance;
};
-// See description in compile-cplus-templates.h.
+/* See description in compile-cplus-templates.h. */
void
compile_cplus_instance::emit_function_template_decls ()
definer (item.second.get ());
}
-// A class to define and fill-in class template definitions.
+/* A class to define and fill-in class template definitions. */
class class_template_definer
{
return;
}
- // Make sure this is only done once!
+ /* Make sure this is only done once! */
defn->set_defined (true);
- // Define any default value types.
+ /* Define any default value types. */
const struct template_argument_info *arg_info
= TYPE_TEMPLATE_ARGUMENT_INFO (defn->type ());
define_default_template_parameter_types (m_instance, defn, arg_info);
- // Create/push new scope.
+ /* Create/push new scope. */
compile_scope scope
= m_instance->new_scope (defn->decl_name (), defn->type ());
}
m_instance->enter_scope (scope);
- // Now start a new template list for this template.
+ /* Start a new template list for this template. */
m_instance->start_new_template_decl (defn->generic ().c_str ());
- // Get the parameters' generic kinds and types.
+ /* Get the parameters' generic kinds and types. */
define_template_parameters_generic (m_instance, defn, arg_info,
- /* filename */ NULL, // !!keiths FIXME
- /* line */ 0); // !!keiths FIXME
+ /* filename */ NULL, /*
+ !!keiths FIXME */
+ /* line */ 0
+ /* !!keiths FIXME */
+ );
- // Define the new generic template declaration.
+
+ /* Define the new generic template declaration. */
if (TYPE_CODE (defn->type ()) == TYPE_CODE_STRUCT)
{
gcc_decl decl
0, NULL, 0, /*filename*/ NULL, /*line*/ 0);
defn->set_decl (decl);
- }
+ }
else
{
gdb_assert (TYPE_CODE (defn->type ()) == TYPE_CODE_UNION);
private:
- // The compiler instance to use.
+ /* The compiler instance to use. */
compile_cplus_instance *m_instance;
};
-// See description in compile-cplus-templates.h.
+/* See description in compile-cplus-templates.h. */
void
compile_cplus_instance::emit_class_template_decls ()
definer (item.second.get ());
}
-// A command to test function_template_decl.
+/* A command to test function_template_decl. */
static void
print_template_defn_command (char *arg, int from_tty)
/* Template support for compile.
- Copyright (C) 2016 Free Software Foundation, Inc.
+ Copyright (C) 2016, 2017 Free Software Foundation, Inc.
This file is part of GDB.
class class_template_defn;
class compile_cplus_instance;
- // Types used for tracking template definitions.
+ /* Types used for tracking template definitions. */
typedef std::unique_ptr<function_template_defn> function_template_defn_up;
typedef std::unique_ptr<class_template_defn> class_template_defn_up;
typedef std::pair<std::string, function_template_defn_up>
typedef std::unordered_map<std::string, class_template_defn_up>
class_template_defn_map_t;
- // A base class holding data common to all template definitions.
+ /* A base class holding data common to all template definitions. */
class template_defn
{
public:
- // Return the declaration name of this definition.
+ /* Return the declaration name of this definition. */
const char *
decl_name () const
return m_decl_name.c_str ();
}
- // Return the compiler plug-in's decl for this definition.
+ /* Return the compiler plug-in's decl for this definition. */
gcc_decl
decl () const
return m_decl;
}
- // Set the compiler plug-in's decl for this definition.
+ /* Set the compiler plug-in's decl for this definition. */
void
set_decl (gcc_decl decl)
m_decl = decl;
}
- // Return the generic string for this template definition.
+ /* Return the generic string for this template definition. */
const std::string
generic (void) const
return m_abstract_types[idx];
}
- // Set the IDX'th template parameter's abstract type.
+ /* Set the IDX'th template parameter's abstract type. */
void
set_parameter_abstract_type (unsigned int idx, gcc_type type)
m_abstract_types[idx] = type;
}
- // Has this template already been defined in the compiler plug-in?
+ /* Has this template already been defined in the compiler plug-in? */
bool
defined (void) const
return m_defined;
}
- // Mark this definition as defined in the compiler plug-in.
+ /* Mark this definition as defined in the compiler plug-in. */
void
set_defined (bool val)
return m_default_arguments[arg_num];
}
- // Record the value of the ARG_NUM'th template parameter.
+ /* Record the value of the ARG_NUM'th template parameter. */
void
set_default_argument (unsigned int arg_num, struct symbol *value)
private:
- // The declaration name of the template, excluding any parameters.
+ /* The declaration name of the template, excluding any
+ parameters. */
std::string m_decl_name;
- // A string representation of the generic template definition.
+ /* A string representation of the generic template definition. */
std::string m_generic;
- // The abstract template parameter types.
+ /* The abstract template parameter types. */
std::vector<gcc_type> m_abstract_types;
- // The decl associated with this template definition.
+ /* The decl associated with this template definition. */
gcc_decl m_decl;
- // A list of default values for the parameters of this template.
+ /* A list of default values for the parameters of this template. */
std::vector<struct symbol *> m_default_arguments;
/* Has this template already been defined? This is a necessary evil
bool m_defined;
};
- // A function template definition.
+ /* A function template definition. */
class function_template_defn
: public template_defn
const struct template_symbol *tsymbol,
struct type *parent_type, int fidx, int midx);
- // Return the demangle information for this template.
+ /* Return the demangle information for this template. */
const parsed_demangle_info *demangle_info (void) const
{
return &m_demangle_info;
}
- // Return the concrete instance used to define this template.
+ /* Return the concrete instance used to define this template. */
const struct template_symbol *template_symbol (void) const
{
const struct template_symbol *m_tsymbol;
- // The parent type or NULL if this does not represent a method.
+ /* The parent type or NULL if this does not represent a method. */
struct type *m_parent_type;
int m_fidx;
int m_midx;
- // Demangle tree for the template defining this generic.
+ /* Demangle tree for the template defining this generic. */
parsed_demangle_info m_demangle_info;
};
- // A class template definition.
+ /* A class template definition. */
class class_template_defn
: public template_defn
{
public:
- // A unary function to delete map items.
+ /* A unary function to delete map items. */
static void destroy (class_template_map_item_t p);
{
}
- // Return concrete instance that this template definition was based on.
+ /* Return concrete instance that this template definition was
+ based on. */
struct type *type (void) const
{
void scan_type_for_function_templates (compile_cplus_instance *instance,
struct type *type);
};
-#endif // COMPILE_CPLUS_TEMPLATES_H
+#endif /* COMPILE_CPLUS_TEMPLATES_H */
/* Convert types from GDB to GCC
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2017 Free Software Foundation, Inc.
This file is part of GDB.
#include "block.h"
#include "gdbcmd.h"
#include "c-lang.h"
-#include "compile-c.h" // for c_get_range_decl_name et al
+#include "compile-c.h" /* Included for c_get_range_decl_name
+ et al. */
#include <algorithm>
static gcc_type ccp_convert_func (compile_cplus_instance *instance,
struct type *type, int strip_artificial);
-// See description in compile-cplus.h.
+/* See description in compile-cplus.h. */
char *
compile::decl_name (const char *natural)
return name;
}
-// See description in compile-cplus.h.
+/* See description in compile-cplus.h. */
int
compile::is_varargs_p (const struct type *type)
while (1)
{
- // Create a string token of the first component of TYPE_NAME.
+ /* Create a string token of the first component of TYPE_NAME. */
int len = cp_find_first_component (p);
std::string s (p, len);
- // Advance past the last token.
+ /* Advance past the last token. */
p += len;
- // Look up the symbol and decide when to stop.
+ /* Look up the symbol and decide when to stop. */
if (!lookup_name.empty ())
lookup_name += "::";
lookup_name += s;
- // Lookup the resulting name.
+ /* Look up the resulting name. */
struct block_symbol bsymbol
= lookup_symbol (lookup_name.c_str (), block, VAR_DOMAIN, NULL);
return false;
}
-// See description in compile-cplus.h.
+/* See description in compile-cplus.h. */
void
compile_cplus_instance::enter_scope (compile_scope &new_scope)
new_scope.m_pushed = must_push;
- // Save the new scope.
+ /* Save the new scope. */
m_scopes.push_back (new_scope);
if (must_push)
if (debug_compile_cplus_scopes)
printf_unfiltered ("entering new scope %p\n", new_scope);
- // Push the global namespace.
+ /* Push the global namespace. */
push_namespace ("");
/* Push all other namespaces. Note that we do not push the last
}
}
-// See description in compile-cplus.h.
+/* See description in compile-cplus.h. */
void
compile_cplus_instance::leave_scope ()
{
- // Get the current scope and remove it from the internal list of scopes.
+ /* Get the current scope and remove it from the internal list of
+ scopes. */
compile_scope current = m_scopes.back ();
m_scopes.pop_back ();
this->pop_namespace (comp.name.c_str ());
});
- // Pop global namespace.
+ /* Pop global namespace. */
pop_namespace ("");
}
else
}
}
-// See description in compile-cplus.h.
+/*See description in compile-cplus.h. */
compile_scope
compile_cplus_instance::new_scope (const char *type_name, struct type *type)
{
if (TYPE_NAME (type) == NULL)
{
- // Anonymous type
+ /* Anonymous type */
/* We don't have a qualified name for this to look up, but
we need a scope. We have to assume, then, that it is the same
}
}
- // There had better be at least one component in the scope!
+ /* Ensure least one component in the scope. */
gdb_assert (scope.size () > 0);
return scope;
}
-// !!keiths: not RVALUE REFERENCES!
+/* !!keiths: not RVALUE REFERENCES! */
gcc_type
compile::convert_reference_base (compile_cplus_instance *instance,
return convert_reference_base (instance, target);
}
-// See description in compile-cplus.h.
+/* See description in compile-cplus.h. */
gcc_type
compile::convert_pointer_base (compile_cplus_instance *instance,
make_cleanup (xfree, name);
}
- // Make sure the scope for this type has been pushed.
+ /* Make sure the scope for this type has been pushed. */
instance->enter_scope (scope);
- // Convert the typedef's real type.
+ /* Convert the typedef's real type. */
gcc_type typedef_type = instance->convert_type (check_typedef (type));
instance->new_decl ("typedef", name,
GCC_CP_SYMBOL_TYPEDEF | nested_access,
typedef_type,
- 0, 0, // !!keiths: Wow. More of this!
+ 0, 0,
+ /* !!keiths: Wow. More of this! */
NULL, 0);
- // Done with this scope.
+ /* Completed this scope. */
instance->leave_scope ();
do_cleanups (cleanups);
return typedef_type;
(GCC_CP_SYMBOL_VARIABLE
| get_field_access_flag (type, i)),
field_type, NULL, physaddr,
- // FIXME: do we have
- // location info for
- // static data members?
- // -lxo
NULL, 0);
}
break;
quals |= GCC_CP_QUALIFIER_VOLATILE;
if (TYPE_RESTRICT (method_type))
quals |= GCC_CP_QUALIFIER_RESTRICT;
- rquals = GCC_CP_REF_QUAL_NONE; // !!keiths FIXME
+ rquals = GCC_CP_REF_QUAL_NONE;
+ /* !!keiths FIXME */
result = instance->build_method_type (class_type, func_type, quals, rquals);
return result;
}
-// Convert a member or method pointer represented by TYPE.
+/* Convert a member or method pointer represented by TYPE. */
static gcc_type
ccp_convert_memberptr (compile_cplus_instance *instance, struct type *type)
struct block_symbol sym;
const char *filename;
unsigned int line;
- const char *kind; //debug
+ const char *kind;
gcc_cp_symbol_kind_flags sym_kind = GCC_CP_SYMBOL_FUNCTION;
const char *name;
char *special_name;
const char *filename = NULL; /* !!keiths: FIXME */
unsigned short line = 0;
- // Get the decl name of this type.
+ /* Get the decl name of this type. */
std::string name;
if (TYPE_NAME (type) != NULL)
{
instance->maybe_define_new_class_template (type, name.c_str ());
instance->emit_class_template_decls ();
- // Create a new scope for TYPE.
+ /* Create a new scope for TYPE. */
compile_scope scope = instance->new_scope (TYPE_NAME (type), type);
if (scope.nested_type () != GCC_TYPE_NONE)
return scope.nested_type ();
}
- // Push all scopes.
+ /* Push all scopes. */
instance->enter_scope (scope);
/* First we create the resulting type and enter it into our hash
/* Add members. */
ccp_convert_struct_or_union_members (instance, type, result);
- /* FIXME: add friend declarations. -lxo */
-
/* All finished. */
instance->finish_record_or_union (name.c_str (), TYPE_LENGTH (type));
- // Pop all scopes.
+ /* Pop all scopes. */
instance->leave_scope ();
return result;
}
being unable to convert enum values from '(MyEnum)0' to 'int'. */
int scoped_enum_p = /*TYPE_DECLARED_CLASS (type) ? TRUE :*/ FALSE;
- // Create a new scope for this type.
+ /* Create a new scope for this type. */
compile_scope scope = instance->new_scope (TYPE_NAME (type), type);
if (scope.nested_type () != GCC_TYPE_NONE)
return scope.nested_type ();
}
- // Create an empty cleanup chain.
+ /* Create an empty cleanup chain. */
cleanups = make_cleanup (null_cleanup, NULL);
if (TYPE_NAME (type) != NULL)
else
name = "anonymous enum";
- // Push all scopes.
+ /* Push all scopes. */
instance->enter_scope (scope);
int_type = instance->int_type (TYPE_UNSIGNED (type),
instance->finish_enum_type (result);
- // Pop all scopes.
+ /* Pop all scopes. */
instance->leave_scope ();
do_cleanups (cleanups);
return result;
return instance->bool_type ();
}
-// See description in compile-cplus.h.
+/* See description in compile-cplus.h. */
gcc_type
compile::convert_qualified_base (compile_cplus_instance *instance,
else
name = "";
- // Push scope.
+ /* Push scope. */
instance->enter_scope (scope);
- // Convert this namespace.
+ /* Convert this namespace. */
instance->push_namespace (name);
instance->pop_namespace (name);
- // Pop scope.
+ /* Pop scope. */
instance->leave_scope ();
do_cleanups (cleanups);
- // Namespaces are non-cacheable "types."
+ /* Namespaces are non-cacheable types. */
return DONT_CACHE_TYPE;
}
\f
-// See compile-cplus.h.
+/* See compile-cplus.h. */
compile_cplus_instance::compile_cplus_instance (struct gcc_cp_context *gcc_fe)
: compile_instance (&gcc_fe->base,
- "-std=gnu++11"
- /* We don't need this any more,
- the user expression function
- is regarded as a friend of
- every class, so that GDB users
- get to access private and
- protected members.
-
- " -fno-access-control"
-
- */
- /* Otherwise the .o file may need
- "_Unwind_Resume" and
- "__gcc_personality_v0".
-
- ??? Why would that be a
- problem? -lxo
-
- " -fno-exceptions"
- */),
+ "-std=gnu++11"),
m_context (gcc_fe),
m_function_template_defns (new function_template_defn_map_t ()),
m_class_template_defns (new class_template_defn_map_t ())
this);
}
-// Plug-in forwards
+/* Plug-in forwards. */
-// A result printer for plug-in calls that return a boolean result.
+/* A result printer for plug-in calls that return a boolean result. */
static void
ccp_output_result (int result)
printf_unfiltered ("%s\n", result ? "true" : "false");
}
-// A result printer for plug-in calls that return a gcc_type or gcc_decl.
+/* A result printer for plug-in calls that return a gcc_type or
+ gcc_decl. */
static void
ccp_output_result (gcc_type result)
return result; \
};
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
bool
compile_cplus_instance::build_constant (gcc_type type, const char *name,
return forward ("\"%s\"", name);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_decl
compile_cplus_instance::specialize_function_template
function_template_defn *defn
= find_function_template_defn (concrete);
- // A generic should already have been defined.
+ /* A generic should already have been defined at this point. */
gdb_assert (defn != NULL);
struct gcc_cp_template_args targs;
return result;
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_decl
compile_cplus_instance::specialize_class_template (struct type *concrete,
class_template_defn *defn
= find_class_template_defn (concrete);
- // A generic should have already been defined.
+ /* A generic should have already been defined at this point. */
gdb_assert (defn != NULL);
struct gcc_cp_template_args targs;
return result;
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_decl
compile_cplus_instance::new_decl (const char *decl_type,
substitution_name);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
bool
compile_cplus_instance::push_namespace (const char *name)
return forward ("\"%s\"", name);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
bool
compile_cplus_instance::pop_namespace (const char *opt_name)
return forward ("\"%s\"", opt_name);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::error (const char *message)
return forward ("%s", message);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
+
gcc_type
compile_cplus_instance::build_reference_type (gcc_type base_type,
return forward ("");
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::build_pointer_type (gcc_type base_type)
return forward ("");
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::build_vla_array_type (gcc_type element_type,
return forward ("");
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::build_vector_type (gcc_type element_type,
return forward ("");
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::build_array_type (gcc_type element_type,
return forward ("");
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_decl
compile_cplus_instance::new_field (const char *field_name, gcc_type field_type,
return forward ("%s %lld", field_name, field_type);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::build_method_type (gcc_type class_type,
return forward ("");
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::start_class_definition
return forward ("%s", name);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
bool
compile_cplus_instance::finish_record_or_union (const char *name,
return forward ("%s (%ld)", name, size_in_bytes);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::int_type (bool is_unsigned, unsigned long size_in_bytes,
return forward ("%d %ld %s", is_unsigned, size_in_bytes, builtin_name);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::start_new_enum_type (const char *name,
return forward ("%s", name);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_decl
compile_cplus_instance::build_add_enum_constant (gcc_type enum_type,
return forward ("%s = %ld", name, value);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
bool
compile_cplus_instance::finish_enum_type (gcc_type enum_type)
return forward ("");
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::build_function_type
return forward ("%lld %d", return_type, is_varargs);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::char_type ()
return forward ("");
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::float_type (unsigned long size_in_bytes,
return forward ("%ld %s", size_in_bytes, builtin_name);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::void_type ()
return forward ("");
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::bool_type ()
return forward ("");
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::build_qualified_type (gcc_type unqualified_type,
return forward ("");
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::build_complex_type (gcc_type element_type)
return forward ("%lld", element_type);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_expr
compile_cplus_instance::literal_expr (gcc_type type, unsigned long value)
return forward ("%lld %ld", type, value);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::new_template_typename_parm (const char *id, bool pack_p,
filename, line_number);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_decl
compile_cplus_instance::new_template_value_parm (gcc_type type, const char *id,
filename, line_number);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
bool
compile_cplus_instance::start_new_template_decl (const char *generic)
return forward ("for generic %s\n", generic);
}
-// See description in gcc-cp-fe.def.
+/* See description in gcc-cp-fe.def. */
gcc_type
compile_cplus_instance::build_pointer_to_member_type (gcc_type class_type,
/* Header file for GDB compile C++ language support.
- Copyright (C) 2016 Free Software Foundation, Inc.
+ Copyright (C) 2016, 2017 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
struct type;
struct block;
-// enum-flags wrapper
+/* enum-flags wrapper */
DEF_ENUM_FLAGS_TYPE (enum gcc_cp_qualifiers, gcc_cp_qualifiers_flags);
DEF_ENUM_FLAGS_TYPE (enum gcc_cp_ref_qualifiers, gcc_cp_ref_qualifiers_flags);
DEF_ENUM_FLAGS_TYPE (enum gcc_cp_symbol_kind, gcc_cp_symbol_kind_flags);
struct scope_component
{
- // The unqualified name of this scope.
+ /* The unqualified name of this scope. */
std::string name;
- // The block symbol for this type/scope.
+ /* The block symbol for this type/scope. */
struct block_symbol bsymbol;
};
- // Comparison operators for scope_components.
+ /* Comparison operators for scope_components. */
bool operator== (const scope_component &lhs, const scope_component &rhs);
bool operator!= (const scope_component &lhs, const scope_component &rhs);
bool m_pushed;
};
- // Comparison operators for compile_scopes.
+ /* Comparison operators for compile_scopes. */
bool operator== (const compile_scope &lhs, const compile_scope &rhs);
bool operator!= (const compile_scope &lhs, const compile_scope &rhs);
- // A subclass of compile_instance that is specific to the C++ front end.
+ /* A subclass of compile_instance that is specific to the C++ front
+ end. */
class compile_cplus_instance
: public compile_instance
class_template_defn *find_class_template_defn (struct type *type);
- // Emit any new function template definitions to the compiler plug-in.
+ /* Emit any new function template definitions to the compiler
+ plug-in. */
void emit_function_template_decls ();
- // Emit any new class template definitions to the compiler plug-in.
+ /* Emit any new class template definitions to the compiler
+ plug-in. */
void emit_class_template_decls ();
compile_scope new_scope (const char *type_name, struct type *type);
- // Enter the given NEW_SCOPE.
+ /* Enter the given NEW_SCOPE. */
void enter_scope (compile_scope &scope);
- // Leave the current scope.
+ /* Leave the current scope. */
void leave_scope ();
- // !!keiths: YUCK!
- // Plug-in forwards
+ /* !!keiths: YUCK!
+ Plug-in forwards */
gcc_type bool_type ();
bool finish_enum_type (gcc_type enum_type);
- // NAME for debugging
+ /* NAME for debugging */
bool finish_record_or_union (const char *name, unsigned long size_in_bytes);
gcc_type float_type (unsigned long size_in_bytes, const char *builtin_name);
gcc_expr literal_expr (gcc_type type, unsigned long value);
- // DECL_DESC for debugging only
+ /* DECL_DESC for debugging only */
gcc_decl new_decl (const char *decl_desc, const char *name,
enum gcc_cp_symbol_kind sym_kind,
gcc_type sym_type, const char *substitution_name,
const char *filename,
unsigned int line_number);
- // NAME is for debugging only
+ /* NAME is for debugging only */
bool pop_namespace (const char *name);
bool push_namespace (const char *name);
const char *filename,
unsigned int line_number);
- // NAME only for debugging
+ /* NAME only for debugging */
gcc_type start_class_definition (const char *name, gcc_decl typedecl,
const struct gcc_vbase_array *base_classes,
const char *filename,
const char *filename,
unsigned int line_number);
- // GENERIC only for debugging
+ /* GENERIC only for debugging */
bool start_new_template_decl (const char *generic);
gcc_type void_type ();
private:
- // Enumerate the template arguments of template DEFN into DEST.
+ /* Enumerate the template arguments of template DEFN into DEST. */
void enumerate_template_arguments
(struct gcc_cp_template_args *dest, const template_defn *defn,
const struct template_argument_info *arg_info);
- // The C++ compile plug-in context.
+ /* The C++ compile plug-in context. */
struct gcc_cp_context *m_context;
- // A cache of function template definitions.
+ /* A cache of function template definitions. */
std::unique_ptr<function_template_defn_map_t> m_function_template_defns;
- // A cache of class template definitions.
+ /* A cache of class template definitions. */
std::unique_ptr<class_template_defn_map_t> m_class_template_defns;
- // A list of scopes we are processing.
+ /* A list of scopes we are processing. */
std::vector<compile_scope> m_scopes;
};
char *decl_name (const char *natural);
- // Add the qualifiers given by QUALS to BASE.
+ /* Add the qualifiers given by QUALS to BASE. */
gcc_type convert_qualified_base (compile_cplus_instance *instance,
gcc_type base,
gcc_cp_qualifiers_flags quals);
- // Convert TARGET into a pointer type in the given compiler INSTANCE.
+ /* Convert TARGET into a pointer type in the given compiler
+ INSTANCE. */
gcc_type convert_pointer_base (compile_cplus_instance *instance,
gcc_type target);
- // Convert BASE into a reference type in the given compile INSTANCE.
+ /* Convert BASE into a reference type in the given compile
+ INSTANCE. */
gcc_type convert_reference_base (compile_cplus_instance *instance,
gcc_type base);
extern gcc_cp_enter_leave_user_expr_scope_function gcc_cplus_enter_scope;
extern gcc_cp_enter_leave_user_expr_scope_function gcc_cplus_leave_scope;
-#endif // GDB_COMPILE_CPLUS_H
+#endif /* GDB_COMPILE_CPLUS_H */
/* Header file for GDB compile command and supporting functions.
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2017 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
{
}
- // Returns the GCC options to be passed during compilation.
+ /* Returns the GCC options to be passed during compilation. */
const std::string &gcc_target_options () const
{
void insert_type (struct type *type, gcc_type gcc_type);
- // Associate SYMBOL with some error text.
+ /* Associate SYMBOL with some error text. */
void insert_symbol_error (const struct symbol *sym, std::string text);
/* These currently just forward to the underlying ops
vtable. */
- // Set the plug-in print callback.
+ /* Set the plug-in print callback. */
void set_print_callback (void (*print_function) (void *, const char *),
void *datum);
- // Return the plug-in's front-end version.
+ /* Return the plug-in's front-end version. */
unsigned int version () const;
- // Set the plug-in's verbosity level.
+ /* Set the plug-in's verbosity level. */
void set_verbose (int level);
- // Set the plug-in driver program.
+ /* Set the plug-in driver program. */
void set_driver_filename (const char *filename);
void set_triplet_regexp (const char *regexp);
- // Set compilation arguments.
+ /* Set compilation arguments. */
char *set_arguments (int argc, char **argv);
- // !!keiths: YUCK!
+ /* !!keiths: YUCK! */
char *set_arguments (const char *regexp, int argc, char **argv);
- // Set the filename of the program to compile.
+ /* Set the filename of the program to compile. */
void set_source_file (const char *filename);
- // Compile the previously specified source file to FILENAME.
+ /* Compile the previously specified source file to FILENAME. */
bool compile (const char *filename);
- // Same as above, but for earlier protocol versions.
+ /* Same as above, but for earlier protocol versions. */
bool compile (const char *filename, int verbose_level);
- // Set the scope type for this compile.
+ /* Set the scope type for this compile. */
void set_scope (enum compile_i_scope_types scope)
{
m_scope = scope;
}
- // Return the scope type.
+ /* Return the scope type. */
enum compile_i_scope_types scope () const
{
return m_scope;
}
- // Set the block to be used for symbol searches.
+ /* Set the block to be used for symbol searches. */
void set_block (const struct block *block)
{
m_block = block;
}
- // Return the search block.
+ /* Return the search block. */
const struct block *block () const
{
typedef std::unordered_map<const struct symbol *, std::string>
symbol_err_map_t;
- // The GCC front end.
+ /* The GCC front end. */
struct gcc_base_context *m_gcc_fe;
- // The "scope" of this compilation.
+ /* The "scope" of this compilation. */
enum compile_i_scope_types m_scope;
- // The block in which an expression is being parsed.
+ /* The block in which an expression is being parsed. */
const struct block *m_block;
/* Specify "-std=gnu11", "-std=gnu++11" or similar. These options are put
after CU's DW_AT_producer compilation options to override them. */
std::string m_gcc_target_options;
- // Map from gdb types to gcc types.
+ /* Map from gdb types to gcc types. */
type_map_t m_type_map;
- // Map from gdb symbols to gcc error messages to emit.
+ /* Map from gdb symbols to gcc error messages to emit. */
symbol_err_map_t m_symbol_err_map;
};
-// Define header and footers for different scopes.
+/* Define the headers and footers for different scopes. */
/* A simple scope just declares a function named "_gdb_expr", takes no
arguments and returns no value. */
#define COMPILE_I_EXPR_VAL "__gdb_expr_val"
#define COMPILE_I_EXPR_PTR_TYPE "__gdb_expr_ptr_type"
-// A "type" to indicate a NULL type.
+/* A "type" to indicate a NULL type. */
const gcc_type GCC_TYPE_NONE = (gcc_type) -1;
/* General Compile and inject code
- Copyright (C) 2014-2016 Free Software Foundation, Inc.
+ Copyright (C) 2014-2017 Free Software Foundation, Inc.
This file is part of GDB.
get_args (compiler, gdbarch, &argc, &argv);
make_cleanup_freeargv (argv);
- // !!keiths: This should be hidden at this level!
+ /* !!keiths: This should be hidden at this level! */
if (compiler->version ()>= GCC_FE_VERSION_1)
error_message = compiler->set_arguments (argc, argv);
else
error (_("Cannot find gdbarch register \"%s\"."), regname);
}
-// See description in compile-internal.h.
+/* See description in compile-internal.h. */
void
compile_instance::insert_type (struct type *type, gcc_type gcc_type)
m_type_map.insert (std::make_pair (type, gcc_type));
}
-// See description in compile-internal.h.
+/* See description in compile-internal.h. */
void
compile_instance::insert_symbol_error (const struct symbol *sym,
m_symbol_err_map.insert (std::make_pair (sym, text));
}
-// See description in compile-internal.h.
+/* See description in compile-internal.h. */
void
compile_instance::error_symbol_once (const struct symbol *sym)
::error (_("%s"), message.c_str ());
}
-// Forwards to the plug-in.
+/* Forwards to the plug-in. */
#define FORWARD(OP,...) (m_gcc_fe->ops->OP (m_gcc_fe, ##__VA_ARGS__))
-// Set the plug-in print callback.
+/* Set the plug-in print callback. */
void
compile_instance::set_print_callback
FORWARD (set_print_callback, print_function, datum);
}
-// Return the plug-in's front-end version.
+/* Return the plug-in's front-end version. */
unsigned int
compile_instance::version () const
return m_gcc_fe->ops->version;
}
-// Set the plug-in's verbosity level.
+/* Set the plug-in's verbosity level. */
void
compile_instance::set_verbose (int level)
FORWARD (set_verbose, level);
}
-// Set the plug-in driver program.
+/* Set the plug-in driver program. */
void
compile_instance::set_driver_filename (const char *filename)
{
- // !!keiths: Possible leak???
+ /* !!keiths: Possible leak??? */
FORWARD (set_driver_filename, filename);
}
-// Set the regular expression used to match the configury triplet
-// prefix to the compiler.
+/* Set the regular expression used to match the configury triplet
+ prefix to the compiler. */
void
compile_instance::set_triplet_regexp (const char *regexp)
{
- // !!keiths: Leak?
+ /* !!keiths: Leak? */
FORWARD (set_triplet_regexp, regexp);
}
-// Set compilation arguments.
+/* Set compilation arguments. */
char *
compile_instance::set_arguments (int argc, char **argv)
return FORWARD (set_arguments, argc, argv);
}
-// !!keiths: YUCK!
+/* !!keiths: YUCK! */
char *
compile_instance::set_arguments (const char *regexp, int argc, char **argv)
return FORWARD (set_arguments_v0, regexp, argc, argv);
}
-// Set the filename of the program to compile.
+/* Set the filename of the program to compile. */
void
compile_instance::set_source_file (const char *filename)
FORWARD (set_source_file, filename);
}
-// Compile the previously specified source file to FILENAME.
+/* Compile the previously specified source file to FILENAME. */
bool
compile_instance::compile (const char *filename)
return FORWARD (compile, filename);
}
-// Like above, but for an earlier compile protocol.
+/* As above, but for an earlier compile protocol. */
bool
compile_instance::compile (const char *filename, int verbose_level)