[flang] Create Message instances with provenance range.
authorTim Keith <tkeith@nvidia.com>
Mon, 23 Apr 2018 23:18:48 +0000 (16:18 -0700)
committerTim Keith <tkeith@nvidia.com>
Mon, 23 Apr 2018 23:18:48 +0000 (16:18 -0700)
This allows the message to point to the full name or statement
rather than just the first character.

Original-commit: flang-compiler/f18@9cf41b13358f45e03338789b968113c347acd895
Reviewed-on: https://github.com/flang-compiler/f18/pull/67

flang/lib/semantics/resolve-names.cc

index f02ca68..a535613 100644 (file)
@@ -681,18 +681,18 @@ void MessageHandler::Say(Message &&x) { messages_.Put(std::move(x)); }
 
 void MessageHandler::Say(parser::MessageFixedText &&x) {
   CHECK(currStmtSource_);
-  messages_.Put(Message{currStmtSource_->begin(), std::move(x)});
+  messages_.Put(Message{*currStmtSource_, std::move(x)});
 }
 
 void MessageHandler::Say(parser::MessageFormattedText &&x) {
   CHECK(currStmtSource_);
-  messages_.Put(Message{currStmtSource_->begin(), std::move(x)});
+  messages_.Put(Message{*currStmtSource_, std::move(x)});
 }
 
 void MessageHandler::Say(
     const parser::CharBlock &source, parser::MessageFixedText &&msg) {
-  Say(parser::Message{source.begin(),
-      parser::MessageFormattedText{msg, source.ToString().c_str()}});
+  Say(parser::Message{
+      source, parser::MessageFormattedText{msg, source.ToString().c_str()}});
 }
 void MessageHandler::Say(
     const parser::Name &name, parser::MessageFixedText &&msg) {