[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Use inline for small operations.
From: |
Akim Demaille |
Subject: |
[PATCH] Use inline for small operations. |
Date: |
Sun, 09 Nov 2008 18:54:32 -0000 |
* data/lalr1.cc (symbol_base_type, symbol_type)
(stack_symbol_type): Declare constructor and other operations as
inline.
(yy_destroy_): Inline.
---
ChangeLog | 8 ++++++++
data/lalr1.cc | 22 +++++++++++-----------
2 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ef18884..40127fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2008-11-09 Akim Demaille <address@hidden>
+ Use inline for small operations.
+ * data/lalr1.cc (symbol_base_type, symbol_type)
+ (stack_symbol_type): Declare constructor and other operations as
+ inline.
+ (yy_destroy_): Inline.
+
+2008-11-09 Akim Demaille <address@hidden>
+
Introduce a hierarchy for symbols.
* data/lalr1.cc (symbol_base_type, symbol_type): New.
(data_type): Rename as...
diff --git a/data/lalr1.cc b/data/lalr1.cc
index 40ba2e2..dc39780 100644
--- a/data/lalr1.cc
+++ b/data/lalr1.cc
@@ -462,10 +462,10 @@ m4_ifdef([b4_stype],
struct symbol_base_type
{
/// Default constructor.
- symbol_base_type ();
+ inline symbol_base_type ();
/// Constructor.
- symbol_base_type (const semantic_type& v, const location_type& l);
+ inline symbol_base_type (const semantic_type& v, const location_type& l);
/// Return the type of this symbol.
virtual int type_get () const = 0;
@@ -488,40 +488,40 @@ m4_ifdef([b4_stype],
/// \param yymsg Why this token is reclaimed.
/// If null, print nothing.
/// \param s The symbol.
- void yy_destroy_ (const char* yymsg, symbol_base_type& yysym) const;
+ inline void yy_destroy_ (const char* yymsg, symbol_base_type& yysym) const;
/// Element of the stack: a state and its attributes.
struct symbol_type : symbol_base_type
{
/// Default constructor.
- symbol_type ();
+ inline symbol_type ();
/// Constructor.
- symbol_type (state_type s,
- const semantic_type& v, const location_type& l);
+ inline symbol_type (int t,
+ const semantic_type& v, const location_type& l);
/// The symbol type.
int type;
/// Return the type corresponding to this state.
- virtual int type_get () const;
+ virtual inline int type_get () const;
};
/// Element of the stack: a state and its attributes.
struct stack_symbol_type : symbol_base_type
{
/// Default constructor.
- stack_symbol_type ();
+ inline stack_symbol_type ();
/// Constructor.
- stack_symbol_type (state_type s,
- const semantic_type& v, const location_type& l);
+ inline stack_symbol_type (state_type s,
+ const semantic_type& v, const location_type&
l);
/// The state.
state_type state;
/// Return the type corresponding to this state.
- virtual int type_get () const;
+ virtual inline int type_get () const;
};
/// Stack type.
--
1.6.0.2.588.g3102
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] Use inline for small operations.,
Akim Demaille <=