summaryrefslogtreecommitdiffstats
path: root/elaborate.cxx
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-07-10 11:17:03 -0400
committerDave Brolley <brolley@redhat.com>2009-07-10 11:17:03 -0400
commit5739030625d3f1697c264e3d8f04e932d1e0773d (patch)
tree0ed2d10376f2bf9bb009e31357d7913277d29bfc /elaborate.cxx
parentbdf70a5d466fa9c1559a93ab71603981f1c0d753 (diff)
parent1e9ab8199dff90c1b6e7290f0f7b4eb424a9ff9f (diff)
downloadsystemtap-steved-5739030625d3f1697c264e3d8f04e932d1e0773d.tar.gz
systemtap-steved-5739030625d3f1697c264e3d8f04e932d1e0773d.tar.xz
systemtap-steved-5739030625d3f1697c264e3d8f04e932d1e0773d.zip
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'elaborate.cxx')
-rw-r--r--elaborate.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/elaborate.cxx b/elaborate.cxx
index e7ea7b23..88c5deb9 100644
--- a/elaborate.cxx
+++ b/elaborate.cxx
@@ -1512,9 +1512,9 @@ systemtap_session::print_token (ostream& o, const token* tok)
tmpo << *tok;
string ts = tmpo.str();
// search & replace the file name with nothing
- size_t idx = ts.find (tok->location.file);
+ size_t idx = ts.find (tok->location.file->name);
if (idx != string::npos)
- ts.replace (idx, tok->location.file.size(), "");
+ ts.replace (idx, tok->location.file->name.size(), "");
o << ts;
}
@@ -1581,16 +1581,16 @@ systemtap_session::print_error_source (std::ostream& message,
std::string& align, const token* tok)
{
unsigned i = 0;
- unsigned line = tok->location.line;
- unsigned col = tok->location.column;
- string file_contents;
assert (tok);
- if (tok->location.stap_file)
- file_contents = tok->location.stap_file->file_contents;
- else
+ if (!tok->location.file)
//No source to print, silently exit
return;
+
+ unsigned line = tok->location.line;
+ unsigned col = tok->location.column;
+ const string &file_contents = tok->location.file->file_contents;
+
size_t start_pos = 0, end_pos = 0;
//Navigate to the appropriate line
while (i != line && end_pos != std::string::npos)
@@ -1958,7 +1958,7 @@ void semantic_pass_opt1 (systemtap_session& s, bool& relaxed_p)
functiondecl* fd = it->second;
if (ftv.traversed.find(fd) == ftv.traversed.end())
{
- if (fd->tok->location.file == s.user_file->name && // !tapset
+ if (fd->tok->location.file->name == s.user_file->name && // !tapset
! s.suppress_warnings)
s.print_warning ("eliding unused function '" + fd->name + "'", fd->tok);
else if (s.verbose>2)
@@ -2014,7 +2014,7 @@ void semantic_pass_opt2 (systemtap_session& s, bool& relaxed_p, unsigned iterati
if (vut.read.find (l) == vut.read.end() &&
vut.written.find (l) == vut.written.end())
{
- if (l->tok->location.file == s.user_file->name && // !tapset
+ if (l->tok->location.file->name == s.user_file->name && // !tapset
! s.suppress_warnings)
s.print_warning ("eliding unused variable '" + l->name + "'", l->tok);
else if (s.verbose>2)
@@ -2058,7 +2058,7 @@ void semantic_pass_opt2 (systemtap_session& s, bool& relaxed_p, unsigned iterati
if (vut.read.find (l) == vut.read.end() &&
vut.written.find (l) == vut.written.end())
{
- if (l->tok->location.file == s.user_file->name && // !tapset
+ if (l->tok->location.file->name == s.user_file->name && // !tapset
! s.suppress_warnings)
s.print_warning ("eliding unused variable '" + l->name + "'", l->tok);
else if (s.verbose>2)
@@ -2104,7 +2104,7 @@ void semantic_pass_opt2 (systemtap_session& s, bool& relaxed_p, unsigned iterati
if (vut.read.find (l) == vut.read.end() &&
vut.written.find (l) == vut.written.end())
{
- if (l->tok->location.file == s.user_file->name && // !tapset
+ if (l->tok->location.file->name == s.user_file->name && // !tapset
! s.suppress_warnings)
s.print_warning ("eliding unused variable '" + l->name + "'", l->tok);
else if (s.verbose>2)