aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/file.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-09-02 08:45:01 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-09-02 08:45:01 +0200
commite2e2001260406bcfa0c636e00be3bc34808f8968 (patch)
tree4bbbb33d9d8f11f9e309f52aaf9cb1449c73d0e7 /libbuild2/file.cxx
parent5ce1f438decd05e01a16445da4703c2193447428 (diff)
Add diag_frame around export stub loading
This gives the location of the importer in case the export stub issues any diagnostics.
Diffstat (limited to 'libbuild2/file.cxx')
-rw-r--r--libbuild2/file.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/libbuild2/file.cxx b/libbuild2/file.cxx
index 0977895..1eb20ad 100644
--- a/libbuild2/file.cxx
+++ b/libbuild2/file.cxx
@@ -2575,8 +2575,17 @@ namespace build2
// @@ Should we verify these are all unqualified names? Or maybe there
// is a use-case for the export stub to return a qualified name?
//
- parser p (ctx);
- names v (p.parse_export_stub (ifs, path_name (es), gs, ts));
+ names v;
+ {
+ auto df = make_diag_frame (
+ [&tgt, &loc] (const diag_record& dr)
+ {
+ dr << info (loc) << "while loading export stub for " << tgt;
+ });
+
+ parser p (ctx);
+ v = p.parse_export_stub (ifs, path_name (es), gs, ts);
+ }
// If there were no export directive executed in an export stub,
// assume the target is not exported.