r329784 - [Tooling] Optimize memory usage in InMemoryToolResults.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 11 04:24:19 PDT 2018


On Wed, Apr 11, 2018 at 10:16 AM Haojian Wu via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: hokein
> Date: Wed Apr 11 01:13:07 2018
> New Revision: 329784
> ...
>
> ==============================================================================
> --- cfe/trunk/include/clang/Tooling/Execution.h (original)
> +++ cfe/trunk/include/clang/Tooling/Execution.h Wed Apr 11 01:13:07 2018
>
> @@ -45,20 +46,30 @@ class ToolResults {
>  public:
>    virtual ~ToolResults() = default;
>    virtual void addResult(StringRef Key, StringRef Value) = 0;
> -  virtual std::vector<std::pair<std::string, std::string>> AllKVResults()
> = 0;
> +  virtual std::vector<std::pair<llvm::StringRef, llvm::StringRef>>
> +  AllKVResults() = 0;
>

I would add a comment re: lifetime of the strings pointed by the return
value.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180411/f26547b4/attachment.html>


More information about the cfe-commits mailing list