aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-05-17 15:13:16 -0400
committerBoris Kolpackov <boris@codesynthesis.com>2013-05-17 15:13:16 -0400
commit479d624a3abfdc81633b682e648bdc2582cde1b6 (patch)
tree3df90b46b80d0763e003fb962abb25bccf175872
parent1e115641e1929cbec63fe26a2fe0801bcd82b1ce (diff)
Implement more robust detection of before/after main file inclusion
-rw-r--r--odb/include.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/odb/include.cxx b/odb/include.cxx
index e333a1e..152cee8 100644
--- a/odb/include.cxx
+++ b/odb/include.cxx
@@ -70,7 +70,7 @@ namespace
struct class_: traversal::class_, context
{
- class_ (include_map& map): trailing_ (false), map_ (map) {}
+ class_ (include_map& map): main_file_loc_ (0), map_ (map) {}
virtual void
traverse (type& c)
@@ -122,7 +122,8 @@ namespace
//
if (f == unit.file ())
{
- trailing_ = true;
+ if (main_file_loc_ == 0)
+ main_file_loc_ = l;
return;
}
}
@@ -144,7 +145,7 @@ namespace
if (map_.find (f) == map_.end ())
{
includes& i (map_[f]);
- i.trailing = trailing_;
+ i.trailing = (main_file_loc_ != 0 && l > main_file_loc_);
i.map[lm] = include_directive ();
}
}
@@ -152,7 +153,7 @@ namespace
}
private:
- bool trailing_;
+ location_t main_file_loc_;
include_map& map_;
};