[flang-commits] [flang] [flang] Get ProvenanceRange from CharBlock starting with expanded macro (PR #77791)

via flang-commits flang-commits at lists.llvm.org
Thu Jan 11 10:24:16 PST 2024


================
@@ -229,7 +233,8 @@ class CookedSource {
   void set_number(int n) { number_ = n; }
 
   CharBlock AsCharBlock() const { return CharBlock{data_}; }
-  std::optional<ProvenanceRange> GetProvenanceRange(CharBlock) const;
+  std::optional<ProvenanceRange> GetProvenanceRange(
----------------
jeanPerier wrote:

Looking at the lifetime of the objects AllSources lifetime > AllCookedSource lifetime > CookedSource lifetime, and the fact that the pointer duplication should be acceptable (not thousands of cooked source expected in normal Fortran programs), this seems possible and cleaner to me.

Done.

https://github.com/llvm/llvm-project/pull/77791


More information about the flang-commits mailing list