public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Some improvements in ctf-reader.
@ 2021-11-18  3:01 Guillermo E. Martinez
  2021-11-18  3:01 ` [PATCH 1/3] ctf-reader: Use argument by reference reading the context Guillermo E. Martinez
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Guillermo E. Martinez @ 2021-11-18  3:01 UTC (permalink / raw)
  To: libabigail

Hello libabigail team,

These patches contains some possible improvements for
the ctf-reader.

I really appreciate your comments :-).

Kind regards,
Guillermo

Guillermo E. Martinez (3):
  ctf-reader: Use argument by reference reading the context
  ctf-reader: Use smart pointers in create_read_context
  ctf-reader: Use ABG_ASSERT instead of assert

 include/abg-ctf-reader.h | 11 +++++++----
 src/abg-ctf-reader.cc    | 10 ++++++----
 tools/abidiff.cc         | 22 ++++++++++++----------
 tools/abilint.cc         | 10 +++++-----
 4 files changed, 30 insertions(+), 23 deletions(-)

-- 
2.33.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] ctf-reader: Use argument by reference reading the context
  2021-11-18  3:01 [PATCH 0/3] Some improvements in ctf-reader Guillermo E. Martinez
@ 2021-11-18  3:01 ` Guillermo E. Martinez
  2021-11-18  3:01 ` [PATCH 2/3] ctf-reader: Use smart pointers in create_read_context Guillermo E. Martinez
  2021-11-18  3:01 ` [PATCH 3/3] ctf-reader: Use ABG_ASSERT instead of assert Guillermo E. Martinez
  2 siblings, 0 replies; 9+ messages in thread
From: Guillermo E. Martinez @ 2021-11-18  3:01 UTC (permalink / raw)
  To: libabigail

  * src/abg-ctf-reader.cc (read_context): Use const argument
  pass by reference.
  (create_read_context): Likewise.
---
 include/abg-ctf-reader.h | 8 ++++----
 src/abg-ctf-reader.cc    | 5 +++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/abg-ctf-reader.h b/include/abg-ctf-reader.h
index c0d8bb2b..56b2bf91 100644
--- a/include/abg-ctf-reader.h
+++ b/include/abg-ctf-reader.h
@@ -25,10 +25,10 @@ namespace ctf_reader
 {
 
 class read_context;
-read_context *create_read_context (std::string elf_path,
-                                   ir::environment *env);
-corpus_sptr read_corpus (read_context *ctxt,
-                         elf_reader::status& status);
+read_context *create_read_context(const std::string& elf_path,
+                                  ir::environment *env);
+corpus_sptr read_corpus(read_context *ctxt,
+                        elf_reader::status& status);
 
 } // end namespace ctf_reader
 } // end namespace abigail
diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc
index 0370c8aa..2c2c204d 100644
--- a/src/abg-ctf-reader.cc
+++ b/src/abg-ctf-reader.cc
@@ -102,7 +102,7 @@ public:
   /// Constructor.
   ///
   /// @param elf_path the path to the ELF file.
-  read_context(string elf_path, ir::environment *env)
+  read_context(const string& elf_path, ir::environment *env)
   {
     types_map.clear();
     filename = elf_path;
@@ -1060,7 +1060,8 @@ slurp_elf_info(read_context *ctxt, corpus_sptr corp)
 /// @param env a libabigail IR environment.
 
 read_context *
-create_read_context(std::string elf_path, ir::environment *env)
+create_read_context(const std::string& elf_path,
+                    ir::environment *env)
 {
   return new read_context(elf_path, env);
 }
-- 
2.33.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 2/3] ctf-reader: Use smart pointers in create_read_context
  2021-11-18  3:01 [PATCH 0/3] Some improvements in ctf-reader Guillermo E. Martinez
  2021-11-18  3:01 ` [PATCH 1/3] ctf-reader: Use argument by reference reading the context Guillermo E. Martinez
@ 2021-11-18  3:01 ` Guillermo E. Martinez
  2021-11-18  3:01 ` [PATCH 3/3] ctf-reader: Use ABG_ASSERT instead of assert Guillermo E. Martinez
  2 siblings, 0 replies; 9+ messages in thread
From: Guillermo E. Martinez @ 2021-11-18  3:01 UTC (permalink / raw)
  To: libabigail

  * include/abg-ctf-reader.h (read_context_sptr): New typedef.
  (create_read_context): Use smart pointer as return value.
  * src/abg-ctf-reader.cc: Likewise.
  * tools/abidiff.cc (main): Use read_context_sptr.
  * tools/abilint.cc: Likewise.
---
 include/abg-ctf-reader.h |  7 +++++--
 src/abg-ctf-reader.cc    |  5 +++--
 tools/abidiff.cc         | 18 ++++++++++--------
 tools/abilint.cc         |  8 ++++----
 4 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/include/abg-ctf-reader.h b/include/abg-ctf-reader.h
index 56b2bf91..c527c2ff 100644
--- a/include/abg-ctf-reader.h
+++ b/include/abg-ctf-reader.h
@@ -25,8 +25,11 @@ namespace ctf_reader
 {
 
 class read_context;
-read_context *create_read_context(const std::string& elf_path,
-                                  ir::environment *env);
+typedef shared_ptr<read_context> read_context_sptr;
+
+read_context_sptr
+create_read_context(const std::string& elf_path,
+                    ir::environment *env);
 corpus_sptr read_corpus(read_context *ctxt,
                         elf_reader::status& status);
 
diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc
index 2c2c204d..3e17e049 100644
--- a/src/abg-ctf-reader.cc
+++ b/src/abg-ctf-reader.cc
@@ -1059,11 +1059,12 @@ slurp_elf_info(read_context *ctxt, corpus_sptr corp)
 /// @param elf_path the patch of some ELF file.
 /// @param env a libabigail IR environment.
 
-read_context *
+read_context_sptr
 create_read_context(const std::string& elf_path,
                     ir::environment *env)
 {
-  return new read_context(elf_path, env);
+  read_context_sptr result(new read_context(elf_path, env));
+  return result;
 }
 
 /// Read the CTF information from some source described by a given
diff --git a/tools/abidiff.cc b/tools/abidiff.cc
index f145f4f1..30959616 100644
--- a/tools/abidiff.cc
+++ b/tools/abidiff.cc
@@ -1169,12 +1169,13 @@ main(int argc, char* argv[])
 #ifdef WITH_CTF
             if (opts.use_ctf)
               {
-                abigail::ctf_reader::read_context *ctxt
-                  = abigail::ctf_reader::create_read_context (opts.file1,
-                                                              env.get());
+                abigail::ctf_reader::read_context_sptr ctxt
+                  = abigail::ctf_reader::create_read_context(opts.file1,
+                                                             env.get());
 
                 assert (ctxt);
-                c1 = abigail::ctf_reader::read_corpus (ctxt, c1_status);
+                c1 = abigail::ctf_reader::read_corpus(ctxt.get(),
+                                                      c1_status);
               }
             else
 #endif
@@ -1252,12 +1253,13 @@ main(int argc, char* argv[])
 #ifdef WITH_CTF
             if (opts.use_ctf)
               {
-                abigail::ctf_reader::read_context *ctxt
-                  = abigail::ctf_reader::create_read_context (opts.file2,
-                                                              env.get());
+                abigail::ctf_reader::read_context_sptr ctxt
+                  = abigail::ctf_reader::create_read_context(opts.file2,
+                                                             env.get());
 
                 assert (ctxt);
-                c2 = abigail::ctf_reader::read_corpus (ctxt, c2_status);
+                c2 = abigail::ctf_reader::read_corpus (ctxt.get(),
+                                                       c2_status);
               }
             else
 #endif
diff --git a/tools/abilint.cc b/tools/abilint.cc
index 49643b66..2e9bae49 100644
--- a/tools/abilint.cc
+++ b/tools/abilint.cc
@@ -370,12 +370,12 @@ main(int argc, char* argv[])
 #ifdef WITH_CTF
             if (opts.use_ctf)
               {
-                abigail::ctf_reader::read_context *ctxt
-                  = abigail::ctf_reader::create_read_context (opts.file_path,
-                                                              env.get());
+                abigail::ctf_reader::read_context_sptr ctxt
+                  = abigail::ctf_reader::create_read_context(opts.file_path,
+                                                             env.get());
 
                 assert (ctxt);
-                corp = abigail::ctf_reader::read_corpus (ctxt, s);
+                corp = abigail::ctf_reader::read_corpus (ctxt.get(), s);
               }
             else
 #endif
-- 
2.33.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 3/3] ctf-reader: Use ABG_ASSERT instead of assert
  2021-11-18  3:01 [PATCH 0/3] Some improvements in ctf-reader Guillermo E. Martinez
  2021-11-18  3:01 ` [PATCH 1/3] ctf-reader: Use argument by reference reading the context Guillermo E. Martinez
  2021-11-18  3:01 ` [PATCH 2/3] ctf-reader: Use smart pointers in create_read_context Guillermo E. Martinez
@ 2021-11-18  3:01 ` Guillermo E. Martinez
  2 siblings, 0 replies; 9+ messages in thread
From: Guillermo E. Martinez @ 2021-11-18  3:01 UTC (permalink / raw)
  To: libabigail

  * tools/abidiff.cc (main): Use ABG_ASSERT.
  * tools/abilint.cc: Likewise.
---
 tools/abidiff.cc | 4 ++--
 tools/abilint.cc | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/abidiff.cc b/tools/abidiff.cc
index 30959616..7f766d16 100644
--- a/tools/abidiff.cc
+++ b/tools/abidiff.cc
@@ -1173,7 +1173,7 @@ main(int argc, char* argv[])
                   = abigail::ctf_reader::create_read_context(opts.file1,
                                                              env.get());
 
-                assert (ctxt);
+                ABG_ASSERT(ctxt);
                 c1 = abigail::ctf_reader::read_corpus(ctxt.get(),
                                                       c1_status);
               }
@@ -1257,7 +1257,7 @@ main(int argc, char* argv[])
                   = abigail::ctf_reader::create_read_context(opts.file2,
                                                              env.get());
 
-                assert (ctxt);
+                ABG_ASSERT(ctxt);
                 c2 = abigail::ctf_reader::read_corpus (ctxt.get(),
                                                        c2_status);
               }
diff --git a/tools/abilint.cc b/tools/abilint.cc
index 2e9bae49..e3e8b079 100644
--- a/tools/abilint.cc
+++ b/tools/abilint.cc
@@ -374,7 +374,7 @@ main(int argc, char* argv[])
                   = abigail::ctf_reader::create_read_context(opts.file_path,
                                                              env.get());
 
-                assert (ctxt);
+                ABG_ASSERT(ctxt);
                 corp = abigail::ctf_reader::read_corpus (ctxt.get(), s);
               }
             else
-- 
2.33.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] ctf-reader: Use argument by reference reading the context
  2021-11-18 23:23   ` [PATCH 1/3] ctf-reader: Use argument by reference reading the context Guillermo E. Martinez
@ 2021-11-23 14:26     ` Dodji Seketeli
  0 siblings, 0 replies; 9+ messages in thread
From: Dodji Seketeli @ 2021-11-23 14:26 UTC (permalink / raw)
  To: Guillermo E. Martinez via Libabigail

"Guillermo E. Martinez via Libabigail" <libabigail@sourceware.org> a
écrit:

>  	* include/abg-ctf-reader.h (create_read_context): Pass the string
>           by reference.
> 	* src/abg-ctf-reader.cc (ctf_reader::read_context): Likewise.
> 	(create_read_context): Likewise.
>
> Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>

Applied to master.  Thanks!

[...]

Cheers,

-- 
		Dodji

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] ctf-reader: Use argument by reference reading the context
  2021-11-18 23:23 ` [PATCH v2 0/3] Some improvements in ctf-reader Guillermo E. Martinez
@ 2021-11-18 23:23   ` Guillermo E. Martinez
  2021-11-23 14:26     ` Dodji Seketeli
  0 siblings, 1 reply; 9+ messages in thread
From: Guillermo E. Martinez @ 2021-11-18 23:23 UTC (permalink / raw)
  To: libabigail

 	* include/abg-ctf-reader.h (create_read_context): Pass the string
          by reference.
	* src/abg-ctf-reader.cc (ctf_reader::read_context): Likewise.
	(create_read_context): Likewise.

Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
---
 include/abg-ctf-reader.h | 8 ++++----
 src/abg-ctf-reader.cc    | 5 +++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/abg-ctf-reader.h b/include/abg-ctf-reader.h
index c0d8bb2b..56b2bf91 100644
--- a/include/abg-ctf-reader.h
+++ b/include/abg-ctf-reader.h
@@ -25,10 +25,10 @@ namespace ctf_reader
 {
 
 class read_context;
-read_context *create_read_context (std::string elf_path,
-                                   ir::environment *env);
-corpus_sptr read_corpus (read_context *ctxt,
-                         elf_reader::status& status);
+read_context *create_read_context(const std::string& elf_path,
+                                  ir::environment *env);
+corpus_sptr read_corpus(read_context *ctxt,
+                        elf_reader::status& status);
 
 } // end namespace ctf_reader
 } // end namespace abigail
diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc
index 0370c8aa..2c2c204d 100644
--- a/src/abg-ctf-reader.cc
+++ b/src/abg-ctf-reader.cc
@@ -102,7 +102,7 @@ public:
   /// Constructor.
   ///
   /// @param elf_path the path to the ELF file.
-  read_context(string elf_path, ir::environment *env)
+  read_context(const string& elf_path, ir::environment *env)
   {
     types_map.clear();
     filename = elf_path;
@@ -1060,7 +1060,8 @@ slurp_elf_info(read_context *ctxt, corpus_sptr corp)
 /// @param env a libabigail IR environment.
 
 read_context *
-create_read_context(std::string elf_path, ir::environment *env)
+create_read_context(const std::string& elf_path,
+                    ir::environment *env)
 {
   return new read_context(elf_path, env);
 }
-- 
2.33.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] ctf-reader: Use argument by reference reading the context
  2021-11-18 17:26   ` Dodji Seketeli
@ 2021-11-18 23:09     ` Guillermo Martinez
  0 siblings, 0 replies; 9+ messages in thread
From: Guillermo Martinez @ 2021-11-18 23:09 UTC (permalink / raw)
  To: Guillermo E. Martinez via Libabigail, Dodji Seketeli

On Thursday, November 18, 2021 11:26:41 AM CST Dodji Seketeli wrote:
> Hello Guillermo,
Hello Dodji
> Thanks for your patch!
> 
> I just have some small nits to pick.
> 
> Please find my comments below:
Thanks!

> "Guillermo E. Martinez via Libabigail" <libabigail@sourceware.org> a
> écrit:
> 
> >   * src/abg-ctf-reader.cc (read_context): Use const argument
> >   pass by reference.
> >   (create_read_context): Likewise.
> 
> Here each line should be prefixed by a "tab", as explained in the
> COMMIT-LOG-GUIDELINES file in the source tree at
> https://sourceware.org/git/?p=libabigail.git;a=blob_plain;f=COMMIT-LOG-GUIDELINES;hb=HEAD.
> 
> Also, there are some changes in the the file include/abg-ctf-reader.h.
> I added them to this ChangeLog part of the commit log.
Thanks!
 
> You'll find my updated version of your patch below.  Would you please
> sign it off by adding a line starting by "Signed-off-by:" with your name
> and email, as explained in the file CONTRIBUTING at
> https://sourceware.org/git/?p=libabigail.git;a=blob_plain;f=CONTRIBUTING;hb=HEAD
> ?  I need that sign-off before committing the patch.
Ok,  I will do.

> Thanks a lot!
Thanks to you for the comments! 
> From ee0308d607b36fc4c5e3e4d815deb7ecf8884ad6 Mon Sep 17 00:00:00 2001
> From: "Guillermo E. Martinez via Libabigail" <libabigail@sourceware.org>
> Date: Wed, 17 Nov 2021 20:56:04 -0600
> Subject: [PATCH] ctf-reader: Use argument by reference reading the context
> 
> 	* include/abg-ctf-reader.h (create_read_context): Pass the string
> 	by reference.
> 	* src/abg-ctf-reader.cc (ctf_reader::read_context): Likewise.
> 	(create_read_context): Likewise.
> 
> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
> ---
>  include/abg-ctf-reader.h | 8 ++++----
>  src/abg-ctf-reader.cc    | 5 +++--
>  2 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/include/abg-ctf-reader.h b/include/abg-ctf-reader.h
> index c0d8bb2b..56b2bf91 100644
> --- a/include/abg-ctf-reader.h
> +++ b/include/abg-ctf-reader.h
> @@ -25,10 +25,10 @@ namespace ctf_reader
>  {
>  
>  class read_context;
> -read_context *create_read_context (std::string elf_path,
> -                                   ir::environment *env);
> -corpus_sptr read_corpus (read_context *ctxt,
> -                         elf_reader::status& status);
> +read_context *create_read_context(const std::string& elf_path,
> +                                  ir::environment *env);
> +corpus_sptr read_corpus(read_context *ctxt,
> +                        elf_reader::status& status);
>  
>  } // end namespace ctf_reader
>  } // end namespace abigail
> diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc
> index 0370c8aa..2c2c204d 100644
> --- a/src/abg-ctf-reader.cc
> +++ b/src/abg-ctf-reader.cc
> @@ -102,7 +102,7 @@ public:
>    /// Constructor.
>    ///
>    /// @param elf_path the path to the ELF file.
> -  read_context(string elf_path, ir::environment *env)
> +  read_context(const string& elf_path, ir::environment *env)
>    {
>      types_map.clear();
>      filename = elf_path;
> @@ -1060,7 +1060,8 @@ slurp_elf_info(read_context *ctxt, corpus_sptr corp)
>  /// @param env a libabigail IR environment.
>  
>  read_context *
> -create_read_context(std::string elf_path, ir::environment *env)
> +create_read_context(const std::string& elf_path,
> +                    ir::environment *env)
>  {
>    return new read_context(elf_path, env);
>  }
Cheers,
Guillermo


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] ctf-reader: Use argument by reference reading the context
  2021-11-18  2:56 ` [PATCH 1/3] ctf-reader: Use argument by reference reading the context Guillermo E. Martinez
@ 2021-11-18 17:26   ` Dodji Seketeli
  2021-11-18 23:09     ` Guillermo Martinez
  0 siblings, 1 reply; 9+ messages in thread
From: Dodji Seketeli @ 2021-11-18 17:26 UTC (permalink / raw)
  To: Guillermo E. Martinez via Libabigail

Hello Guillermo,

Thanks for your patch!

I just have some small nits to pick.

Please find my comments below:

"Guillermo E. Martinez via Libabigail" <libabigail@sourceware.org> a
écrit:

>   * src/abg-ctf-reader.cc (read_context): Use const argument
>   pass by reference.
>   (create_read_context): Likewise.

Here each line should be prefixed by a "tab", as explained in the
COMMIT-LOG-GUIDELINES file in the source tree at
https://sourceware.org/git/?p=libabigail.git;a=blob_plain;f=COMMIT-LOG-GUIDELINES;hb=HEAD.

Also, there are some changes in the the file include/abg-ctf-reader.h.
I added them to this ChangeLog part of the commit log.

You'll find my updated version of your patch below.  Would you please
sign it off by adding a line starting by "Signed-off-by:" with your name
and email, as explained in the file CONTRIBUTING at
https://sourceware.org/git/?p=libabigail.git;a=blob_plain;f=CONTRIBUTING;hb=HEAD
?  I need that sign-off before committing the patch.

Thanks a lot!

From ee0308d607b36fc4c5e3e4d815deb7ecf8884ad6 Mon Sep 17 00:00:00 2001
From: "Guillermo E. Martinez via Libabigail" <libabigail@sourceware.org>
Date: Wed, 17 Nov 2021 20:56:04 -0600
Subject: [PATCH] ctf-reader: Use argument by reference reading the context

	* include/abg-ctf-reader.h (create_read_context): Pass the string
	by reference.
	* src/abg-ctf-reader.cc (ctf_reader::read_context): Likewise.
	(create_read_context): Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 include/abg-ctf-reader.h | 8 ++++----
 src/abg-ctf-reader.cc    | 5 +++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/abg-ctf-reader.h b/include/abg-ctf-reader.h
index c0d8bb2b..56b2bf91 100644
--- a/include/abg-ctf-reader.h
+++ b/include/abg-ctf-reader.h
@@ -25,10 +25,10 @@ namespace ctf_reader
 {
 
 class read_context;
-read_context *create_read_context (std::string elf_path,
-                                   ir::environment *env);
-corpus_sptr read_corpus (read_context *ctxt,
-                         elf_reader::status& status);
+read_context *create_read_context(const std::string& elf_path,
+                                  ir::environment *env);
+corpus_sptr read_corpus(read_context *ctxt,
+                        elf_reader::status& status);
 
 } // end namespace ctf_reader
 } // end namespace abigail
diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc
index 0370c8aa..2c2c204d 100644
--- a/src/abg-ctf-reader.cc
+++ b/src/abg-ctf-reader.cc
@@ -102,7 +102,7 @@ public:
   /// Constructor.
   ///
   /// @param elf_path the path to the ELF file.
-  read_context(string elf_path, ir::environment *env)
+  read_context(const string& elf_path, ir::environment *env)
   {
     types_map.clear();
     filename = elf_path;
@@ -1060,7 +1060,8 @@ slurp_elf_info(read_context *ctxt, corpus_sptr corp)
 /// @param env a libabigail IR environment.
 
 read_context *
-create_read_context(std::string elf_path, ir::environment *env)
+create_read_context(const std::string& elf_path,
+                    ir::environment *env)
 {
   return new read_context(elf_path, env);
 }
-- 
2.32.0

[...]

Cheers,

-- 
		Dodji

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] ctf-reader: Use argument by reference reading the context
  2021-11-18  2:56 [PATCH 0/3] Some improvements in ctf-reader Guillermo E. Martinez
@ 2021-11-18  2:56 ` Guillermo E. Martinez
  2021-11-18 17:26   ` Dodji Seketeli
  2021-11-18 23:23 ` [PATCH v2 0/3] Some improvements in ctf-reader Guillermo E. Martinez
  1 sibling, 1 reply; 9+ messages in thread
From: Guillermo E. Martinez @ 2021-11-18  2:56 UTC (permalink / raw)
  To: libabigail

  * src/abg-ctf-reader.cc (read_context): Use const argument
  pass by reference.
  (create_read_context): Likewise.
---
 include/abg-ctf-reader.h | 8 ++++----
 src/abg-ctf-reader.cc    | 5 +++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/include/abg-ctf-reader.h b/include/abg-ctf-reader.h
index c0d8bb2b..56b2bf91 100644
--- a/include/abg-ctf-reader.h
+++ b/include/abg-ctf-reader.h
@@ -25,10 +25,10 @@ namespace ctf_reader
 {
 
 class read_context;
-read_context *create_read_context (std::string elf_path,
-                                   ir::environment *env);
-corpus_sptr read_corpus (read_context *ctxt,
-                         elf_reader::status& status);
+read_context *create_read_context(const std::string& elf_path,
+                                  ir::environment *env);
+corpus_sptr read_corpus(read_context *ctxt,
+                        elf_reader::status& status);
 
 } // end namespace ctf_reader
 } // end namespace abigail
diff --git a/src/abg-ctf-reader.cc b/src/abg-ctf-reader.cc
index 0370c8aa..2c2c204d 100644
--- a/src/abg-ctf-reader.cc
+++ b/src/abg-ctf-reader.cc
@@ -102,7 +102,7 @@ public:
   /// Constructor.
   ///
   /// @param elf_path the path to the ELF file.
-  read_context(string elf_path, ir::environment *env)
+  read_context(const string& elf_path, ir::environment *env)
   {
     types_map.clear();
     filename = elf_path;
@@ -1060,7 +1060,8 @@ slurp_elf_info(read_context *ctxt, corpus_sptr corp)
 /// @param env a libabigail IR environment.
 
 read_context *
-create_read_context(std::string elf_path, ir::environment *env)
+create_read_context(const std::string& elf_path,
+                    ir::environment *env)
 {
   return new read_context(elf_path, env);
 }
-- 
2.33.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-11-23 14:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18  3:01 [PATCH 0/3] Some improvements in ctf-reader Guillermo E. Martinez
2021-11-18  3:01 ` [PATCH 1/3] ctf-reader: Use argument by reference reading the context Guillermo E. Martinez
2021-11-18  3:01 ` [PATCH 2/3] ctf-reader: Use smart pointers in create_read_context Guillermo E. Martinez
2021-11-18  3:01 ` [PATCH 3/3] ctf-reader: Use ABG_ASSERT instead of assert Guillermo E. Martinez
  -- strict thread matches above, loose matches on Subject: below --
2021-11-18  2:56 [PATCH 0/3] Some improvements in ctf-reader Guillermo E. Martinez
2021-11-18  2:56 ` [PATCH 1/3] ctf-reader: Use argument by reference reading the context Guillermo E. Martinez
2021-11-18 17:26   ` Dodji Seketeli
2021-11-18 23:09     ` Guillermo Martinez
2021-11-18 23:23 ` [PATCH v2 0/3] Some improvements in ctf-reader Guillermo E. Martinez
2021-11-18 23:23   ` [PATCH 1/3] ctf-reader: Use argument by reference reading the context Guillermo E. Martinez
2021-11-23 14:26     ` Dodji Seketeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).