Page MenuHomePhabricator

mgehre (Matthias Gehre)
User

Projects

User does not belong to any projects.

User Details

User Since
Sep 28 2015, 1:40 PM (224 w, 4 d)

Recent Activity

Thu, Jan 9

mgehre added inline comments to D72380: [DataFlow] Factor two worklist implementations out.
Thu, Jan 9, 12:44 PM · Restricted Project

Wed, Jan 8

mgehre added inline comments to D72380: [DataFlow] Factor two worklist implementations out.
Wed, Jan 8, 11:55 AM · Restricted Project

Nov 10 2019

mgehre added a comment to D70052: [clang-tidy] Add misc-mutating-copy check.

Did you consider to warn on copy constructors/assignment operators take a their arguments by non-const reference, and suggest the user to turn them into const references? This seems like a more useful (and easier) check to me.
The link above contains Ideally, the copy operator should have an idiomatic signature. For copy constructors, that is T(const T&); and for copy assignment operators, that is T& operator=(const T&);..

Nov 10 2019, 10:59 AM · Restricted Project, Restricted Project
mgehre added a comment to D70052: [clang-tidy] Add misc-mutating-copy check.

Have you run your check over the LLVM/clang source base and seen true positives/false positives?

Nov 10 2019, 8:36 AM · Restricted Project, Restricted Project

Nov 6 2019

MyDeveloperDay awarded rG24130d661ed4: [clang-tidy] Add readability-make-member-function-const a Like token.
Nov 6 2019, 12:35 AM
mgehre committed rG24130d661ed4: [clang-tidy] Add readability-make-member-function-const (authored by mgehre).
[clang-tidy] Add readability-make-member-function-const
Nov 6 2019, 12:32 AM
mgehre closed D68074: [clang-tidy] Add readability-make-member-function-const.
Nov 6 2019, 12:32 AM · Restricted Project, Restricted Project

Nov 2 2019

mgehre added a comment to D68074: [clang-tidy] Add readability-make-member-function-const.

Thanks, fixed!

Nov 2 2019, 2:54 PM · Restricted Project, Restricted Project

Oct 30 2019

mgehre added a comment to D68074: [clang-tidy] Add readability-make-member-function-const.

Friendly Ping

Oct 30 2019, 12:21 AM · Restricted Project, Restricted Project

Oct 20 2019

mgehre updated the diff for D68074: [clang-tidy] Add readability-make-member-function-const.
  • Update documentation
Oct 20 2019, 2:34 PM · Restricted Project, Restricted Project

Oct 19 2019

mgehre added inline comments to D69145: Give readability-redundant-member-init an option IgnoreBaseInCopyConstructors to avoid breaking code with gcc -Werror=extra.
Oct 19 2019, 4:17 AM · Restricted Project, Restricted Project
mgehre added a comment to D69145: Give readability-redundant-member-init an option IgnoreBaseInCopyConstructors to avoid breaking code with gcc -Werror=extra.

Exactly due to the issue you are fixing here, we ended up disabling the complete check because we didn't want to live with the warnings it produced on -Wextra.
Therefore, I'm actually strongly in favor to enable the option by default.

Oct 19 2019, 4:17 AM · Restricted Project, Restricted Project

Oct 11 2019

Herald updated subscribers of D59105: [RFC] Create an Arbitrary Precision Integer Type..
Oct 11 2019, 4:09 AM

Oct 9 2019

mgehre added inline comments to D68074: [clang-tidy] Add readability-make-member-function-const.
Oct 9 2019, 12:13 PM · Restricted Project, Restricted Project
mgehre added inline comments to D68074: [clang-tidy] Add readability-make-member-function-const.
Oct 9 2019, 12:04 PM · Restricted Project, Restricted Project

Sep 29 2019

mgehre added a comment to D68074: [clang-tidy] Add readability-make-member-function-const.

Awesome!
I believe i have asked this question in the convert-to-static diff - can ExprMutAnalyzer be used here?

I believe in this case, we can get away with a simpler analysis. Because this is an prvalue,
there are less operations that can be done to it, and it seems easy to just list those here. Also, we want
to conservatively disallow "const" access to non-public member variables/functions, and I don't see
how this would elegantly integrate with using the ExprMutationAnalyzer.

Sep 29 2019, 10:48 AM · Restricted Project, Restricted Project
mgehre updated the diff for D68074: [clang-tidy] Add readability-make-member-function-const.
  • Implement review comments
Sep 29 2019, 10:36 AM · Restricted Project, Restricted Project

Sep 26 2019

mgehre created D68074: [clang-tidy] Add readability-make-member-function-const.
Sep 26 2019, 12:55 AM · Restricted Project, Restricted Project

Sep 6 2019

mgehre committed rG4934f013b12b: [LifetimeAnalysis] don't use raw string literals in macros (authored by mgehre).
[LifetimeAnalysis] don't use raw string literals in macros
Sep 6 2019, 12:15 PM
mgehre committed rL371241: [LifetimeAnalysis] don't use raw string literals in macros.
[LifetimeAnalysis] don't use raw string literals in macros
Sep 6 2019, 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…
Sep 6 2019, 1:57 AM
mgehre committed rL371182: Reland [LifetimeAnalysis] Support more STL idioms (template forward declaration….
Reland [LifetimeAnalysis] Support more STL idioms (template forward declaration…
Sep 6 2019, 1:55 AM

Sep 5 2019

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).

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

Aug 27 2019

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.

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

Aug 26 2019

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:

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

Aug 24 2019

mgehre added inline comments to D66686: [LifetimeAnalysis] Make it possible to disable the new warnings.
Aug 24 2019, 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