From f8220a7b945a3be7975fb2610ca1c79119594534 Mon Sep 17 00:00:00 2001 From: graydon Date: Wed, 13 Jul 2005 04:47:54 +0000 Subject: 2005-07-12 Graydon Hoare * 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. --- tapsets.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'tapsets.h') diff --git a/tapsets.h b/tapsets.h index 774fa59b..e2f5a8db 100644 --- a/tapsets.h +++ b/tapsets.h @@ -13,8 +13,26 @@ #include "staptree.h" #include "elaborate.h" + +// Helper class for describing builtin functions. Calls to builtins +// are typechecked and emitted, but the builtin definitions are *not* +// emitted by the translator (in fact, they have no definitions in +// systemtap language); they are assumed to exist outside the +// translator, in the runtime library. + +class +builtin_function +{ + functiondecl *f; + token *id(std::string const & name); + public: + builtin_function(exp_type e, std::string const & name); + builtin_function & arg(exp_type e, std::string const & name); + void bind(systemtap_session & sess); +}; + void -register_standard_tapsets(match_node * root); +register_standard_tapsets(systemtap_session & sess); #endif // TAPSETS_H -- cgit