Page MenuHomePhabricator

mgehre (Matthias Gehre)
User

Projects

User does not belong to any projects.

User Details

User Since
Sep 28 2015, 1:40 PM (207 w, 6 d)

Recent Activity

Fri, Sep 6

mgehre committed rG4934f013b12b: [LifetimeAnalysis] don't use raw string literals in macros (authored by mgehre).
[LifetimeAnalysis] don't use raw string literals in macros
Fri, Sep 6, 12:15 PM
mgehre committed rL371241: [LifetimeAnalysis] don't use raw string literals in macros.
[LifetimeAnalysis] don't use raw string literals in macros
Fri, Sep 6, 12:15 PM
mgehre committed rGf64f4886706b: Reland [LifetimeAnalysis] Support more STL idioms (template forward declaration… (authored by mgehre).
Reland [LifetimeAnalysis] Support more STL idioms (template forward declaration…
Fri, Sep 6, 1:57 AM
mgehre committed rL371182: Reland [LifetimeAnalysis] Support more STL idioms (template forward declaration….
Reland [LifetimeAnalysis] Support more STL idioms (template forward declaration…
Fri, Sep 6, 1:55 AM

Thu, Sep 5

mgehre abandoned D66365: [clang-tidy] [readability-convert-member-functions-to-static] ignore functions that hide base class methods.

The discussions on the bug did not provide further insight (until now).

Thu, Sep 5, 2:34 PM · Restricted Project, Restricted Project

Tue, Aug 27

mgehre added a comment to D66806: [LifetimeAnalysis] Fix some false positives.

Nice! Having no false-positives is most important because this is enabled by default.

Tue, Aug 27, 12:32 PM · Restricted Project, Restricted Project

Mon, Aug 26

mgehre added a comment to D63325: [Support][Time profiler] Make FE codegen blocks to be inside frontend blocks.

I'm seeing the same issue Not all CodeGen sections are inside any Frontend section! with python 3.7.1. Json:

Mon, Aug 26, 2:09 PM · Restricted Project, Restricted Project

Sat, Aug 24

mgehre added inline comments to D66686: [LifetimeAnalysis] Make it possible to disable the new warnings.
Sat, Aug 24, 12:56 AM · Restricted Project, Restricted Project

Aug 23 2019

mgehre added a comment to D66486: [LifetimeAnalysis] Detect more cases when the address of a local variable escapes.

Yes, it means that the automatic inference of Pointer/Owner from base classes has the same issues as all of those automatic inferences: Once can construct a case where they are not true.
So for having no false-positives at all, we should avoid this inference by default and not consider MutableArrayRef to be a gsl::Pointer.
Instead, we disable the analysis when it sees an unannotated class (like here, MutableArrayRef).

Aug 23 2019, 1:13 PM · Restricted Project
mgehre added a comment to D66486: [LifetimeAnalysis] Detect more cases when the address of a local variable escapes.

When I understand you correctly, you are thinking about
the cases

OwningArrayRef getRef();
Aug 23 2019, 12:38 PM · Restricted Project
mgehre added a comment to D66443: [LifetimeAnalysis] Add [[gsl::Pointer]] to llvm::StringRef.

Generally, ArrayRef is also a candidate. But there we have the complication that OwningArrayRef indirectly inherits from ArrayRef. One is a gsl::Owner, the other a gsl::Pointer, and we
need to make sure that we handle it correctly when OwningArrayRef is accessed through its base class which is then seen as a Pointer.
I would thus defer this part to a later PR.

Aug 23 2019, 12:01 PM · Restricted Project
mgehre added a comment to D66486: [LifetimeAnalysis] Detect more cases when the address of a local variable escapes.

Also it feels a bit weird to change the ownership semantics in a derived class, I bet that would violate the Liskov substitution principle.

And then we see that llvm::OwningArrayRef inherits from llvm::ArrayRef ... But maybe this direction (strengthening a Pointer into an Owner)
is okay. We'll need to go though the call rules, and see if something breaks when the caller passes an Owner to a function that takes a base class (i.e. Pointer).
My initial reaction is that this should work in general. An Owner is like a Pointer that points to {static}.

Aug 23 2019, 11:55 AM · Restricted Project

Aug 22 2019

mgehre added a comment to D66179: [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType).

Yes, for libc++ we could add the annotations to its source code, and eventually this would be the cleaner solution.
Currently, that is neither sufficient (because one could use libstdc++, MSVC or an older libc++ version) nor necessary (the inference we need for libstdc++ / MSVC also works for libc++),
so it's currently low on our priority list.

Aug 22 2019, 1:22 PM · Restricted Project, Restricted Project
mgehre added inline comments to D66179: [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType).
Aug 22 2019, 1:17 PM · Restricted Project, Restricted Project

Aug 21 2019

mgehre added inline comments to D66179: [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType).
Aug 21 2019, 3:58 PM · Restricted Project, Restricted Project
mgehre added a comment to D66486: [LifetimeAnalysis] Detect more cases when the address of a local variable escapes.

In the false-positive example, after the DerivedToBase, we see a constructor call which I think is the copy constructor.

  1. We should consider MutableArrayRef to be a gsl::Pointer according to the paper, because it publicly derives from one.
  2. Also in the paper, the copy constructor does should copies the pset of the argument instead of making the pointer point at the argument.

What do you think?

Aug 21 2019, 3:25 PM · Restricted Project
mgehre committed rGb1c78012900b: [LifetimeAnalysis] Support more STL idioms (template forward declaration and… (authored by mgehre).
[LifetimeAnalysis] Support more STL idioms (template forward declaration and…
Aug 21 2019, 3:14 PM
mgehre committed rL369591: [LifetimeAnalysis] Support more STL idioms (template forward declaration and….
[LifetimeAnalysis] Support more STL idioms (template forward declaration and…
Aug 21 2019, 3:11 PM
mgehre closed D66179: [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType).
Aug 21 2019, 3:10 PM · Restricted Project, Restricted Project
mgehre added inline comments to D66179: [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType).
Aug 21 2019, 3:07 PM · Restricted Project, Restricted Project

Aug 20 2019

mgehre added a comment to D66486: [LifetimeAnalysis] Detect more cases when the address of a local variable escapes.

This change might be the cause for the false-positive in https://github.com/mgehre/llvm-project/issues/45. Could you check?

Aug 20 2019, 2:21 PM · Restricted Project
mgehre added a comment to D66179: [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType).

I now add the attributes to all redeclarations to make the logic a bit easier to follow.

Aug 20 2019, 2:11 PM · Restricted Project, Restricted Project
mgehre updated the diff for D66179: [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType).
  • Put OwnerAttr/PointerAttr on all redeclarations
  • clang/lib/Sema/SemaAttr.cpp: Use Attribute::CreateImplicit as requested in review
Aug 20 2019, 2:11 PM · Restricted Project, Restricted Project

Aug 19 2019

mgehre committed rG5b3275e56f3c: [ORC] fix use-after-free detected by -Wreturn-stack-address (authored by mgehre).
[ORC] fix use-after-free detected by -Wreturn-stack-address
Aug 19 2019, 3:05 PM
mgehre committed rL369306: [ORC] fix use-after-free detected by -Wreturn-stack-address.
[ORC] fix use-after-free detected by -Wreturn-stack-address
Aug 19 2019, 2:58 PM
mgehre closed D66440: [ORC] fix use-after-free detected by -Wreturn-stack-address.
Aug 19 2019, 2:58 PM · Restricted Project
mgehre committed rG8b0d15e43f33: Fix use-after-free (authored by mgehre).
Fix use-after-free
Aug 19 2019, 2:40 PM
mgehre updated the summary of D66443: [LifetimeAnalysis] Add [[gsl::Pointer]] to llvm::StringRef.
Aug 19 2019, 2:39 PM · Restricted Project
mgehre committed rL369304: Fix use-after-free.
Fix use-after-free
Aug 19 2019, 2:38 PM
mgehre closed D66442: Fix use-after-free.
Aug 19 2019, 2:38 PM · Restricted Project, Restricted Project
mgehre updated subscribers of D66440: [ORC] fix use-after-free detected by -Wreturn-stack-address.
Aug 19 2019, 2:37 PM · Restricted Project
mgehre updated subscribers of D66442: Fix use-after-free.
Aug 19 2019, 2:36 PM · Restricted Project, Restricted Project
mgehre created D66443: [LifetimeAnalysis] Add [[gsl::Pointer]] to llvm::StringRef.
Aug 19 2019, 2:36 PM · Restricted Project
mgehre created D66442: Fix use-after-free.
Aug 19 2019, 2:23 PM · Restricted Project, Restricted Project
mgehre created D66440: [ORC] fix use-after-free detected by -Wreturn-stack-address.
Aug 19 2019, 2:13 PM · Restricted Project
mgehre added a comment to D66365: [clang-tidy] [readability-convert-member-functions-to-static] ignore functions that hide base class methods.

I struggle myself to fully understand the motivation behind the bug report. This is certainly not code that I would write.
So I don't really care about that kind of code and I didn't want to be in the way of other people's way of writing C++.

Aug 19 2019, 12:25 PM · Restricted Project, Restricted Project

Aug 16 2019

mgehre added a comment to D66179: [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType).

I now start to wonder if we should instead put the attribute on all declarations (instead of just the canonical). Later redeclarations automatically inherit the attributes.
This would make both the checking easier (just check any declaration, no need to obtain the canonical first), and remove the special
case for adding to the definition of templated record for ClassTemplateDecls.

Aug 16 2019, 1:39 PM · Restricted Project, Restricted Project
mgehre created D66365: [clang-tidy] [readability-convert-member-functions-to-static] ignore functions that hide base class methods.
Aug 16 2019, 1:32 PM · Restricted Project, Restricted Project

Aug 15 2019

mgehre added inline comments to D66303: [LifetimeAnalysis] Add support for free functions.
Aug 15 2019, 1:47 PM · Restricted Project, Restricted Project

Aug 14 2019

mgehre added inline comments to D66179: [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType).
Aug 14 2019, 3:19 PM · Restricted Project, Restricted Project
mgehre committed rG1bebc22bd94d: [LifetimeAnalysis] Support std::stack::top() and std::optional::value() (authored by mgehre).
[LifetimeAnalysis] Support std::stack::top() and std::optional::value()
Aug 14 2019, 3:00 PM
mgehre committed rL368929: [LifetimeAnalysis] Support std::stack::top() and std::optional::value().
[LifetimeAnalysis] Support std::stack::top() and std::optional::value()
Aug 14 2019, 2:55 PM
mgehre closed D66164: [LifetimeAnalysis] Support std::stack::top() and std::optional::value().
Aug 14 2019, 2:55 PM · Restricted Project, Restricted Project

Aug 13 2019

mgehre updated the diff for D66164: [LifetimeAnalysis] Support std::stack::top() and std::optional::value().

Add tests for rvalue-ref overloads

Aug 13 2019, 3:40 PM · Restricted Project, Restricted Project
mgehre added inline comments to D66164: [LifetimeAnalysis] Support std::stack::top() and std::optional::value().
Aug 13 2019, 3:40 PM · Restricted Project, Restricted Project
mgehre updated the diff for D66164: [LifetimeAnalysis] Support std::stack::top() and std::optional::value().

Fix commit

Aug 13 2019, 3:35 PM · Restricted Project, Restricted Project
mgehre created D66179: [LifetimeAnalysis] Support more STL idioms (template forward declaration and DependentNameType).
Aug 13 2019, 3:35 PM · Restricted Project, Restricted Project
mgehre added inline comments to D66164: [LifetimeAnalysis] Support std::stack::top() and std::optional::value().
Aug 13 2019, 3:30 PM · Restricted Project, Restricted Project
mgehre created D66164: [LifetimeAnalysis] Support std::stack::top() and std::optional::value().
Aug 13 2019, 2:02 PM · Restricted Project, Restricted Project

Aug 7 2019

mgehre committed rG23092ca9bac2: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types (authored by mgehre).
gsl::Owner/gsl::Pointer: Add implicit annotations for some std types
Aug 7 2019, 3:47 AM
mgehre committed rL368147: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types.
gsl::Owner/gsl::Pointer: Add implicit annotations for some std types
Aug 7 2019, 3:46 AM
mgehre closed D64448: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types.
Aug 7 2019, 3:46 AM · Restricted Project, Restricted Project

Jul 30 2019

mgehre updated the diff for D64448: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types.
  • Fix crash
Jul 30 2019, 2:56 PM · Restricted Project, Restricted Project
mgehre updated the diff for D64448: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types.
  • Add missing check
Jul 30 2019, 2:26 PM · Restricted Project, Restricted Project
mgehre updated the diff for D64448: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types.
  • Fix comments
  • Add Pointer via typedef on ClassTemplateDecl
Jul 30 2019, 2:24 PM · Restricted Project, Restricted Project
mgehre added inline comments to D64448: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types.
Jul 30 2019, 2:24 PM · Restricted Project, Restricted Project
mgehre added a comment to D63954: Add lifetime categories attributes.

I will include your latest comments into D64448

Jul 30 2019, 12:30 PM · Restricted Project, Restricted Project
mgehre added inline comments to D65127: Even more warnings utilizing gsl::Owner/gsl::Pointer annotations.
Jul 30 2019, 10:59 AM · Restricted Project, Restricted Project

Jul 25 2019

mgehre added a comment to D63954: Add lifetime categories attributes.

Thank you very much for dedicating your time for the review. It improved the code a lot!

Jul 25 2019, 10:56 AM · Restricted Project, Restricted Project
mgehre committed rGd293cbd5fd44: Add lifetime categories attributes (authored by mgehre).
Add lifetime categories attributes
Jul 25 2019, 10:53 AM
mgehre committed rL367040: Add lifetime categories attributes.
Add lifetime categories attributes
Jul 25 2019, 10:51 AM
mgehre closed D63954: Add lifetime categories attributes.
Jul 25 2019, 10:51 AM · Restricted Project, Restricted Project

Jul 24 2019

mgehre updated the diff for D63954: Add lifetime categories attributes.
  • Fix all comments
Jul 24 2019, 2:22 PM · Restricted Project, Restricted Project
mgehre added inline comments to D63954: Add lifetime categories attributes.
Jul 24 2019, 2:22 PM · Restricted Project, Restricted Project

Jul 23 2019

mgehre added inline comments to D63954: Add lifetime categories attributes.
Jul 23 2019, 3:57 PM · Restricted Project, Restricted Project
mgehre updated the diff for D63954: Add lifetime categories attributes.
  • Diagnose unions; improve other diagnostics; fix all comments
Jul 23 2019, 3:57 PM · Restricted Project, Restricted Project

Jul 21 2019

mgehre abandoned D15032: [clang-tidy] new checker cppcoreguidelines-pro-lifetime.

Upstreaming of this checker will happen with D63954 and following revisions.

Jul 21 2019, 2:55 PM
mgehre added a comment to D64448: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types.

Just passing-by thought:
These attributes that are being added implicitly, it will be possible to differentiate
whether an attribute was actually present in the code, or was added implicitly,
say for clang-tidy check purposes?
Is there some 'implicit' bit on these, or they have a location not in the source buffer?

Thanks for the question! The implicitly added attributes have an invalid source location.

Jul 21 2019, 2:51 PM · Restricted Project, Restricted Project
mgehre updated the diff for D64448: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types.
  • Remove type traits
Jul 21 2019, 2:42 PM · Restricted Project, Restricted Project
mgehre added a comment to D64448: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types.

This should fix all open comments.

Jul 21 2019, 2:29 PM · Restricted Project, Restricted Project
mgehre updated the diff for D64448: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types.
  • Merge branch 'lifetime-categories' into hardcode-lifetime-categories; Split test; Move test to AST dump; fix for comments;
Jul 21 2019, 2:29 PM · Restricted Project, Restricted Project
mgehre added a comment to D63954: Add lifetime categories attributes.

I think that I have addressed all open comments.

Jul 21 2019, 1:50 PM · Restricted Project, Restricted Project
mgehre updated the diff for D63954: Add lifetime categories attributes.
  • Disallow reference and array types as DerefType
  • Add example to documentation.
Jul 21 2019, 1:50 PM · Restricted Project, Restricted Project

Jul 16 2019

mgehre committed rGffca322266fc: [clang-tidy] initial version of readability-convert-member-functions-to-static (authored by mgehre).
[clang-tidy] initial version of readability-convert-member-functions-to-static
Jul 16 2019, 2:21 PM
mgehre committed rL366265: [clang-tidy] initial version of readability-convert-member-functions-to-static.
[clang-tidy] initial version of readability-convert-member-functions-to-static
Jul 16 2019, 2:20 PM
mgehre closed D61749: [clang-tidy] initial version of readability-convert-member-functions-to-static.
Jul 16 2019, 2:20 PM · Restricted Project, Restricted Project, Restricted Project
mgehre added a comment to D61749: [clang-tidy] initial version of readability-convert-member-functions-to-static.

Thank you for the review, Aaron!

Jul 16 2019, 2:20 PM · Restricted Project, Restricted Project, Restricted Project

Jul 14 2019

mgehre added inline comments to D63954: Add lifetime categories attributes.
Jul 14 2019, 3:31 PM · Restricted Project, Restricted Project
mgehre updated the diff for D63954: Add lifetime categories attributes.
  • Don't crash when pretty-printing an Attribute with optional type argument
  • Don't crash AST dump when Owner/Pointer has no Type argument
  • gsl::Owner/gsl::Pointer: Make DerefType parameter optional
  • Unify type and non-type attribute parsing; don't add OwnerAttr/PointerAttr twice
  • Improve documentation
Jul 14 2019, 3:31 PM · Restricted Project, Restricted Project

Jul 11 2019

mgehre added a comment to D64448: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types.

I don't know how various versions of libstdc++ differ.

The current implementation passed the (partial) test case
https://github.com/mgehre/llvm-project/blob/lifetime-ci/lifetime-attr-test.cpp
for different standard libraries, namely libc++ 7.1.0, libc++ 8.0.1rc2, libstdc++ 4.6.4, libstdc++ 4.8.5,
libstdc++ 4.9.4, libstdc++ 5.4.0, libstdc++ 6.5.0, libstdc++ 7.3.0,
libstdc++ 8.3.0 and libstdc++ 9.1.0.

Yes, I saw the testcase -- but how do different libstdc++ versions differ?

I didn't know whether they would differ, but the test tells me that they don't differ significantly (i.e. in introducing new techniques).
Would you like me to test with other standard libraries (besides MSVC, which I already planned)?

Jul 11 2019, 4:10 PM · Restricted Project, Restricted Project
mgehre updated the diff for D64448: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types.
  • Implement comments
Jul 11 2019, 4:09 PM · Restricted Project, Restricted Project
mgehre added a comment to D61749: [clang-tidy] initial version of readability-convert-member-functions-to-static.

This should address all remaining comments.

Jul 11 2019, 3:46 PM · Restricted Project, Restricted Project, Restricted Project
mgehre updated the diff for D61749: [clang-tidy] initial version of readability-convert-member-functions-to-static.

Implement comments

Jul 11 2019, 3:46 PM · Restricted Project, Restricted Project, Restricted Project
mgehre retitled D61749: [clang-tidy] initial version of readability-convert-member-functions-to-static from [clang-tidy] initial version of readability-const-method to [clang-tidy] initial version of readability-convert-member-functions-to-static.
Jul 11 2019, 3:26 PM · Restricted Project, Restricted Project, Restricted Project
mgehre added a comment to D64448: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types.

For example, libc++ wraps everything in std in an inline namespace.

I believed that I had written a test for inline namespaces, but seems that I shouldn't be working in the middle of the night.
I will add one.

Jul 11 2019, 3:26 PM · Restricted Project, Restricted Project

Jul 9 2019

mgehre added a parent revision for D64448: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types: D63954: Add lifetime categories attributes.
Jul 9 2019, 2:34 PM · Restricted Project, Restricted Project
mgehre added a child revision for D63954: Add lifetime categories attributes: D64448: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types.
Jul 9 2019, 2:34 PM · Restricted Project, Restricted Project
mgehre created D64448: gsl::Owner/gsl::Pointer: Add implicit annotations for some std types.
Jul 9 2019, 2:33 PM · Restricted Project, Restricted Project
mgehre retitled D61749: [clang-tidy] initial version of readability-convert-member-functions-to-static from [clang-tidy] initial version of readability-static-const-method to [clang-tidy] initial version of readability-const-method.
Jul 9 2019, 12:50 PM · Restricted Project, Restricted Project, Restricted Project
mgehre updated the diff for D61749: [clang-tidy] initial version of readability-convert-member-functions-to-static.

Move checks into AST matchers

Jul 9 2019, 12:49 PM · Restricted Project, Restricted Project, Restricted Project

Jul 8 2019

mgehre added inline comments to D61749: [clang-tidy] initial version of readability-convert-member-functions-to-static.
Jul 8 2019, 2:18 PM · Restricted Project, Restricted Project, Restricted Project
mgehre updated the diff for D61749: [clang-tidy] initial version of readability-convert-member-functions-to-static.
  • Address review comments
Jul 8 2019, 2:17 PM · Restricted Project, Restricted Project, Restricted Project

Jul 2 2019

mgehre added a comment to D61749: [clang-tidy] initial version of readability-convert-member-functions-to-static.

Friendly ping. Are there outstanding concerns that I could address?

Jul 2 2019, 1:08 PM · Restricted Project, Restricted Project, Restricted Project
mgehre updated the diff for D63954: Add lifetime categories attributes.
  • Make the list of attribute properties more consistent.
Jul 2 2019, 1:08 PM · Restricted Project, Restricted Project

Jul 1 2019

mgehre updated the diff for D63954: Add lifetime categories attributes.
  • Add newline at end of file
Jul 1 2019, 1:43 PM · Restricted Project, Restricted Project
mgehre added a comment to D63954: Add lifetime categories attributes.

I understand that putting types on forward declared header (standard libraries / third party libraries) is not a approach we should favor.
Thank you for your good arguments.
API notes seems like a really good approach for this (I would like to help with the upstreaming), and in the meanwhile
I will work on hard-coding attributes for standard library types in clang for a follow-up PR. I think we could have them always attached (I will measure performance),
so that -Wlifetime will not change the AST.

Jul 1 2019, 1:19 PM · Restricted Project, Restricted Project
mgehre updated the diff for D63954: Add lifetime categories attributes.
  • Address more review comments.
  • git-clang-format
Jul 1 2019, 11:26 AM · Restricted Project, Restricted Project

Jun 30 2019

mgehre added inline comments to D63954: Add lifetime categories attributes.
Jun 30 2019, 2:25 PM · Restricted Project, Restricted Project
mgehre updated the summary of D63954: Add lifetime categories attributes.
Jun 30 2019, 2:21 PM · Restricted Project, Restricted Project
mgehre updated the diff for D63954: Add lifetime categories attributes.

Address some review comments.

Jun 30 2019, 2:20 PM · Restricted Project, Restricted Project