summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--translate.cxx32
1 files changed, 17 insertions, 15 deletions
diff --git a/translate.cxx b/translate.cxx
index 135830df..655937d7 100644
--- a/translate.cxx
+++ b/translate.cxx
@@ -4954,21 +4954,23 @@ translate_pass (systemtap_session& s)
s.op->newline() << s.embeds[i]->code << "\n";
}
- s.op->newline() << "static struct {";
- s.op->indent(1);
- for (unsigned i=0; i<s.globals.size(); i++)
- {
- s.up->emit_global (s.globals[i]);
- }
- s.op->newline(-1) << "} global = {";
- s.op->newline(1);
- for (unsigned i=0; i<s.globals.size(); i++)
- {
- if (pending_interrupts) return 1;
- s.up->emit_global_init (s.globals[i]);
- }
- s.op->newline(-1) << "};";
- s.op->assert_0_indent();
+ if (s.globals.size()>0) {
+ s.op->newline() << "static struct {";
+ s.op->indent(1);
+ for (unsigned i=0; i<s.globals.size(); i++)
+ {
+ s.up->emit_global (s.globals[i]);
+ }
+ s.op->newline(-1) << "} global = {";
+ s.op->newline(1);
+ for (unsigned i=0; i<s.globals.size(); i++)
+ {
+ if (pending_interrupts) return 1;
+ s.up->emit_global_init (s.globals[i]);
+ }
+ s.op->newline(-1) << "};";
+ s.op->assert_0_indent();
+ }
for (map<string,functiondecl*>::iterator it = s.functions.begin(); it != s.functions.end(); it++)
{