diff options
author | graydon <graydon> | 2005-07-13 04:47:54 +0000 |
---|---|---|
committer | graydon <graydon> | 2005-07-13 04:47:54 +0000 |
commit | f8220a7b945a3be7975fb2610ca1c79119594534 (patch) | |
tree | d733adba9033184c8250971ce096e51b3dade156 /elaborate.cxx | |
parent | 6f0257ecf703373555ef06044cc25c8083859616 (diff) | |
download | systemtap-steved-f8220a7b945a3be7975fb2610ca1c79119594534.tar.gz systemtap-steved-f8220a7b945a3be7975fb2610ca1c79119594534.tar.xz systemtap-steved-f8220a7b945a3be7975fb2610ca1c79119594534.zip |
2005-07-12 Graydon Hoare <graydon@redhat.com>
* elaborate.cxx
(semantic_pass_symbols): Only enter body if non-null.
(semantic_pass_types): Likewise.
(semantic_pass): Pass session to register_standard_tapsets.
* translate.cxx
(builtin_collector): New struct.
(hookup_builtins): New function.
(translate_pass): Only translate functions with bodies.
(c_unparser::emit_common_header): Likewise, and call hookup_builtins.
* tapsets.hh (builtin_function): New class.
(register_standard_tapsets): Change parameter to session.
* tapsets.cc (bultin_function::*): Implement class.
(register_standard_tapsets): Register printk, log, warn.
* testsuite/transok/six.stp: New test.
Diffstat (limited to 'elaborate.cxx')
-rw-r--r-- | elaborate.cxx | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/elaborate.cxx b/elaborate.cxx index e38cef51..5cac937b 100644 --- a/elaborate.cxx +++ b/elaborate.cxx @@ -420,9 +420,12 @@ semantic_pass_symbols (systemtap_session& s) try { - sym.current_function = fd; - sym.current_probe = 0; - fd->body->visit (& sym); + if (fd->body) + { + sym.current_function = fd; + sym.current_probe = 0; + fd->body->visit (& sym); + } } catch (const semantic_error& e) { @@ -478,7 +481,7 @@ int semantic_pass (systemtap_session& s) { s.register_library_aliases(); - register_standard_tapsets(s.pattern_root); + register_standard_tapsets(s); int rc = semantic_pass_symbols (s); if (rc == 0) rc = semantic_pass_types (s); @@ -794,15 +797,18 @@ semantic_pass_types (systemtap_session& s) for (unsigned j=0; j<s.functions.size(); j++) { functiondecl* fn = s.functions[j]; - ti.current_function = fn; - ti.t = pe_unknown; - fn->body->visit (& ti); - // NB: we don't have to assert a known type for - // functions here, to permit a "void" function. - // The translator phase will omit the "retvalue". - // - // if (fn->type == pe_unknown) - // ti.unresolved (fn->tok); + if (fn->body) + { + ti.current_function = fn; + ti.t = pe_unknown; + fn->body->visit (& ti); + // NB: we don't have to assert a known type for + // functions here, to permit a "void" function. + // The translator phase will omit the "retvalue". + // + // if (fn->type == pe_unknown) + // ti.unresolved (fn->tok); + } } for (unsigned j=0; j<s.probes.size(); j++) |