aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-02-01 10:58:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-02-01 10:58:07 +0200
commitae4485ca4f926a0d7f2fc91e9e17a18fc0e83097 (patch)
tree749d380982bacf8d378415bbb18d1d2044e94c75
parent81b48dc3a7480c3df87d4293722b5a3d5f0de2c2 (diff)
Don't use CLI to handle service options
-rw-r--r--odb/options.cli6
-rw-r--r--odb/plugin.cxx17
2 files changed, 11 insertions, 12 deletions
diff --git a/odb/options.cli b/odb/options.cli
index 9be8198..562daa6 100644
--- a/odb/options.cli
+++ b/odb/options.cli
@@ -343,10 +343,4 @@ class options
database-default engine, pass \cb{default} as the value for this
option."
};
-
- //
- // Undocumented options that are used to pass service information
- // between the frontend and the plugin.
- //
- std::string --svc-file;
};
diff --git a/odb/plugin.cxx b/odb/plugin.cxx
index a611dfe..47a524d 100644
--- a/odb/plugin.cxx
+++ b/odb/plugin.cxx
@@ -33,6 +33,7 @@ typedef vector<path> paths;
int plugin_is_GPL_compatible;
auto_ptr<options const> options_;
paths profile_paths_;
+path file_; // File being compiled.
// A prefix of the _cpp_file struct. This struct is not part of the
// public interface so we have to resort to this technique (based on
@@ -64,8 +65,7 @@ start_unit_callback (void*, void*)
&& fp->path == p // Our prefix corresponds to the actual type.
&& fp->dir_name == 0) // The directory part hasn't been initialized.
{
- path p (options_->svc_file ());
- path d (p.directory ());
+ path d (file_.directory ());
char* s;
if (d.empty ())
@@ -104,14 +104,13 @@ gate_callback (void*, void*)
try
{
- path file (options_->svc_file ());
parser p (*options_, loc_pragmas_, decl_pragmas_);
- auto_ptr<unit> u (p.parse (global_namespace, file));
+ auto_ptr<unit> u (p.parse (global_namespace, file_));
//
//
validator v;
- if (!v.validate (*options_, *u, file))
+ if (!v.validate (*options_, *u, file_))
r = 1;
//
@@ -119,7 +118,7 @@ gate_callback (void*, void*)
if (r == 0)
{
generator g;
- g.generate (*options_, *u, file);
+ g.generate (*options_, *u, file_);
}
}
catch (parser::failed const&)
@@ -171,6 +170,12 @@ plugin_init (plugin_name_args* plugin_info, plugin_gcc_version*)
continue;
}
+ if (strcmp (a.key, "svc-file") == 0)
+ {
+ file_ = path (a.value);
+ continue;
+ }
+
string opt (strlen (a.key) > 1 ? "--" : "-");
opt += a.key;