Page MenuHomePhabricator

rsmith (Richard Smith - zygoloid)
User

Projects

User does not belong to any projects.

User Details

User Since
Jul 12 2012, 2:19 PM (340 w, 6 d)

Recent Activity

Today

rsmith added a comment to D56760: Add a new builtin: __builtin_dynamic_object_size.

So it seems like the GCC people want to keep __builtin_object_size static.

Wed, Jan 23, 11:57 AM

Yesterday

rsmith committed rC351924: [ubsan] Check the correct size when sanitizing array new..
[ubsan] Check the correct size when sanitizing array new.
Tue, Jan 22, 7:37 PM
rsmith committed rL351924: [ubsan] Check the correct size when sanitizing array new..
[ubsan] Check the correct size when sanitizing array new.
Tue, Jan 22, 7:37 PM
rsmith added a comment to D56723: [CodeComplete] Propagate preferred types through parser in more cases.

I'll try playing around with your idea, my initial plan is to store preferred type alongside the current token as a member of the Parser class and update it when advancing to next token, when the parser backtracks and in the places where we care about propagating the types.

Tue, Jan 22, 1:33 PM
rsmith added inline comments to D55676: [Modules] Fix decl order for DeclsInPrototype.
Tue, Jan 22, 11:22 AM

Mon, Jan 21

rsmith added a comment to D56723: [CodeComplete] Propagate preferred types through parser in more cases.

This seems to be introducing a requirement that enterUnknown is called on all paths through the parser where we recurse to parse a subexpression and don't have specific type information. That seems like an unfortunate requirement to me from a maintenance perspective; have you considered alternative approaches? For example, we could store the preferred type alongside the SourceLocation of the corresponding token (and propagate the information when we parse parentheses and any other completion-type-preserving construct), and only apply the information when the code completion token is at that location. That way, we only need to annotate cases where we know the preferred type, not when we don't.

Mon, Jan 21, 3:31 PM

Fri, Jan 18

rsmith accepted D54472: Disable invalid isPodLike<> specialization.

Thanks, looks great!

Fri, Jan 18, 3:02 PM

Thu, Jan 17

rsmith committed rC351487: Fix cleanup registration for lambda captures..
Fix cleanup registration for lambda captures.
Thu, Jan 17, 2:10 PM
rsmith committed rL351487: Fix cleanup registration for lambda captures..
Fix cleanup registration for lambda captures.
Thu, Jan 17, 2:10 PM
rsmith accepted D56731: Add -Wctad-maybe-unsupported to diagnose CTAD on types with no user defined deduction guides..
Thu, Jan 17, 11:24 AM

Wed, Jan 16

rsmith accepted D56731: Add -Wctad-maybe-unsupported to diagnose CTAD on types with no user defined deduction guides..
Wed, Jan 16, 3:53 PM
rsmith added a comment to D55741: Implementation Feature Test Macros for P0722R3.

@jwakely, we should come to a common understanding of the right behavior here :) (and then probably report back to SG-10).

Wed, Jan 16, 3:29 PM
rsmith updated subscribers of D55741: Implementation Feature Test Macros for P0722R3.
Wed, Jan 16, 3:25 PM
rsmith added inline comments to D54472: Disable invalid isPodLike<> specialization.
Wed, Jan 16, 2:14 PM
rsmith committed rL351382: PR40329: [adl] Fix determination of associated classes when searching a.
PR40329: [adl] Fix determination of associated classes when searching a
Wed, Jan 16, 2:05 PM
rsmith committed rC351382: PR40329: [adl] Fix determination of associated classes when searching a.
PR40329: [adl] Fix determination of associated classes when searching a
Wed, Jan 16, 2:05 PM

Tue, Jan 15

rsmith added a comment to D56731: Add -Wctad-maybe-unsupported to diagnose CTAD on types with no user defined deduction guides..

[This discussion should probably move to cfe-dev@, since it's not directly relevant for this patch.]

Tue, Jan 15, 5:45 PM
rsmith added a comment to D56760: Add a new builtin: __builtin_dynamic_object_size.

Thanks, this seems like a useful feature to me.

Tue, Jan 15, 5:15 PM
rsmith added a comment to D56731: Add -Wctad-maybe-unsupported to diagnose CTAD on types with no user defined deduction guides..

I like @Quuxplusone's suggestions for more heuristics here, but I think they should probably live under a different warning flag (collectively grouped under -Wctad as @lebedev.ri suggested). Concretely, I think we could warn if, during template instantiation from a type-dependent initializer, we select the copy deduction candidate and there was another viable candidate (the optional o(x) case, the tuple t{args...}case, etc), maybe under a new -Wctad-unwrap or similar.

Tue, Jan 15, 3:18 PM

Mon, Jan 14

rsmith added inline comments to D54472: Disable invalid isPodLike<> specialization.
Mon, Jan 14, 6:04 PM

Fri, Jan 11

rsmith added a comment to D55500: [Builtins] Implement __builtin_is_constant_evaluated for use in C++2a.

@rsmith, what sorts of additional tests are needed?

Fri, Jan 11, 2:36 PM

Thu, Jan 10

rsmith added a comment to D3853: Begin implementing Plan 9 C extensions..

If someone wants to pick this up and run with it, this patch is fine as a starting point (though will need to be rebased).

Thu, Jan 10, 7:01 PM
rsmith committed rL350915: Remember to instantiate explicit template argument lists in a friend.
Remember to instantiate explicit template argument lists in a friend
Thu, Jan 10, 6:05 PM
rsmith committed rC350915: Remember to instantiate explicit template argument lists in a friend.
Remember to instantiate explicit template argument lists in a friend
Thu, Jan 10, 6:05 PM

Wed, Jan 9

rsmith accepted D56522: [SemaCXX] add -Woverride-init alias to -Winitializer-overrides.
Wed, Jan 9, 5:22 PM
rsmith committed rL350779: In nothrow new-expressions, null-check the result if we're going to.
In nothrow new-expressions, null-check the result if we're going to
Wed, Jan 9, 4:07 PM
rsmith committed rC350779: In nothrow new-expressions, null-check the result if we're going to.
In nothrow new-expressions, null-check the result if we're going to
Wed, Jan 9, 4:07 PM
rsmith accepted D54188: [Sema] Mark target of __attribute__((alias("target"))) used for C.

I don't like having a solution that doesn't work for C++ and can't reasonably be extended to a solution for C++ (we really don't want to be demangling the alias target here and trying to match it against the program, and ideally we don't want to delay the warning in question to codegen time), but this does reduce warning false-positives so it seems hard to object to. (We'll still need to tell people to mark declarations as __attribute__((used)) when they're used in this way if their names are mangled.)

Wed, Jan 9, 11:32 AM
rsmith added a reviewer for D54188: [Sema] Mark target of __attribute__((alias("target"))) used for C: rjmccall.
Wed, Jan 9, 11:29 AM

Mon, Jan 7

rsmith added inline comments to D56405: Split -Wdelete-non-virtual-dtor into two groups.
Mon, Jan 7, 5:56 PM
rsmith added inline comments to D56405: Split -Wdelete-non-virtual-dtor into two groups.
Mon, Jan 7, 4:51 PM
rsmith added inline comments to D37035: Implement __builtin_LINE() et. al. to support source location capture..
Mon, Jan 7, 4:22 PM

Sun, Jan 6

rsmith accepted D56357: Fix PR40230 - std::pair may have padding on FreeBSD..

LGTM (assuming the FreeBSD folks are OK with it).

Sun, Jan 6, 10:09 PM
rsmith committed rL350505: DR674, PR38883, PR40238: Qualified friend lookup should look for a.
DR674, PR38883, PR40238: Qualified friend lookup should look for a
Sun, Jan 6, 10:04 PM
rsmith committed rC350505: DR674, PR38883, PR40238: Qualified friend lookup should look for a.
DR674, PR38883, PR40238: Qualified friend lookup should look for a
Sun, Jan 6, 10:04 PM

Thu, Jan 3

rsmith accepted D55955: Properly diagnose [[nodiscard]] on the body of a range-based for loop.

Thanks, this looks great. A couple of the changes to the tests look like the diagnostic output is slightly worse in some error recovery conditions, but generally this is a nice improvement.

Thu, Jan 3, 2:50 PM
rsmith accepted D56271: [SemaCXX] Fix ICE for unexpanded parameter pack.

Looks good, thank you!

Thu, Jan 3, 10:50 AM

Wed, Dec 26

rsmith added inline comments to D55955: Properly diagnose [[nodiscard]] on the body of a range-based for loop.
Wed, Dec 26, 12:36 PM

Dec 24 2018

rsmith added inline comments to D55955: Properly diagnose [[nodiscard]] on the body of a range-based for loop.
Dec 24 2018, 9:57 AM

Dec 21 2018

rsmith accepted D55853: Ignore ConstantExpr in IgnoreParens.

LGTM with s/ConstantExpr/FullExpr/.

Dec 21 2018, 4:28 PM
rsmith added a comment to D54565: Introduce `-Wctad` as a subgroup of `-Wc++14-compat`.

I think there is a case to be made for warning on this specific language feature, because using CTAD on class templates that weren't designed for it is dangerous and creates source compatibility problems for future changes to that library.

Personally I would go stronger: using CTAD on class templates that were designed for it (1) is dangerous and (2) may create source compatibility problems for future changes to that library!

Dec 21 2018, 4:26 PM
rsmith added inline comments to D55955: Properly diagnose [[nodiscard]] on the body of a range-based for loop.
Dec 21 2018, 2:54 PM

Dec 20 2018

rsmith added a reviewer for D54590: [compiler-rt][UBSan] Sanitization for alignment assumptions.: rsmith.
Dec 20 2018, 4:22 PM · Restricted Project
rsmith added inline comments to D54590: [compiler-rt][UBSan] Sanitization for alignment assumptions..
Dec 20 2018, 4:22 PM · Restricted Project
rsmith added inline comments to D55955: Properly diagnose [[nodiscard]] on the body of a range-based for loop.
Dec 20 2018, 2:03 PM
rsmith added inline comments to D55955: Properly diagnose [[nodiscard]] on the body of a range-based for loop.
Dec 20 2018, 2:01 PM
rsmith accepted D47757: [Sema] Produce diagnostics when unavailable aligned allocation/deallocation functions are called.
Dec 20 2018, 1:19 PM
rsmith committed rC349820: Make the "too many braces in scalar initialization" extension cause.
Make the "too many braces in scalar initialization" extension cause
Dec 20 2018, 1:02 PM
rsmith committed rL349820: Make the "too many braces in scalar initialization" extension cause.
Make the "too many braces in scalar initialization" extension cause
Dec 20 2018, 1:02 PM

Dec 18 2018

rsmith committed rL349600: Fix use-after-free with profile remapping..
Fix use-after-free with profile remapping.
Dec 18 2018, 7:27 PM
rsmith added inline comments to D55853: Ignore ConstantExpr in IgnoreParens.
Dec 18 2018, 4:50 PM
rsmith added inline comments to D55853: Ignore ConstantExpr in IgnoreParens.
Dec 18 2018, 4:48 PM

Dec 17 2018

rsmith added a comment to D35783: Ignore shadowing for declarations coming from within macros..

I think the ideal solution would be something like:

Dec 17 2018, 11:40 AM
rsmith added a comment to D54604: Automatic variable initialization.

Thanks, you've addressed my comments to my satisfaction. (Not approving as I've not done a detailed review of the implementation, only of the approach, but it looks like your review with @pcc is nearly complete.)

Dec 17 2018, 11:20 AM

Dec 16 2018

rsmith accepted D55741: Implementation Feature Test Macros for P0722R3.

Thanks! Do you need someone to commit for you?

Dec 16 2018, 10:08 PM
rsmith accepted D55741: Implementation Feature Test Macros for P0722R3.

Looks good. Is there anything in www/cxx_status.html that we should update to track that we've implemented this part of P1353R0?

Dec 16 2018, 12:47 AM

Dec 14 2018

rsmith added inline comments to D53713: Add extension to always default-initialize nullptr_t..
Dec 14 2018, 2:59 PM
rsmith added a comment to D53713: Add extension to always default-initialize nullptr_t..

I'm concerned that this will hide real bugs by suppressing the bogus warnings in (only) the simple cases. There is no "read a value from memory" operation on type nullptr_t (just like for, say, class types), and any warning that believes there is is incorrect. For example, given

Dec 14 2018, 2:38 PM

Dec 12 2018

rsmith accepted D55534: [AST] Store "UsesADL" information in CallExpr..
Dec 12 2018, 12:18 PM
rsmith added inline comments to D55413: [ExprConstant] Handle compound assignment when LHS has integral type and RHS has floating point type.
Dec 12 2018, 11:21 AM

Dec 11 2018

rsmith added a comment to D54604: Automatic variable initialization.

For the record: I'm OK with this direction. (I somewhat prefer removing the -enable-long-wordy-thing option and instead automatically disabling the zero option for clang release builds, but I'm OK with either approach.)

Dec 11 2018, 5:58 PM
rsmith accepted D55510: [ExprConstant] Improve memchr/memcmp for type mismatch and multibyte element types.
Dec 11 2018, 4:27 PM
rsmith added a comment to D55527: Normalize GlobalDecls when used with CPUDispatch.

Thanks, this makes a lot of sense to me.

Dec 11 2018, 1:55 PM
rsmith added inline comments to D55534: [AST] Store "UsesADL" information in CallExpr..
Dec 11 2018, 9:42 AM

Dec 10 2018

rsmith added inline comments to D55510: [ExprConstant] Improve memchr/memcmp for type mismatch and multibyte element types.
Dec 10 2018, 3:40 PM
rsmith added inline comments to D55510: [ExprConstant] Improve memchr/memcmp for type mismatch and multibyte element types.
Dec 10 2018, 1:42 PM

Dec 6 2018

rsmith added a comment to D55395: Re-order content in OMPDeclareReductionDecl dump.

This is wrong, the original implementation is correct and should not be changed.

Dec 6 2018, 7:36 PM
rsmith accepted D55398: Re-order content from InitListExpr.
Dec 6 2018, 7:33 PM
rsmith added inline comments to rL345839: Multiversioning- Ensure all MV functions are emitted..
Dec 6 2018, 3:10 PM
rsmith added inline comments to rL345839: Multiversioning- Ensure all MV functions are emitted..
Dec 6 2018, 11:22 AM
rsmith added a comment to D52956: Support `-fno-visibility-inlines-hidden`.

Is this change blocked on something?

Dec 6 2018, 11:04 AM

Dec 5 2018

rsmith accepted D49511: [Sema/Attribute] Check for noderef attribute.

Thanks for your patience.

Dec 5 2018, 2:00 PM · Restricted Project
rsmith accepted D54014: [Sema] Push and Pop Expression Evaluation Context Records at the start and end of function definitions.

Thanks!

Dec 5 2018, 1:53 PM · Restricted Project
rsmith accepted D21508: Diagnose friend function template redefinitions.

Thanks (and sorry for dropping the ball on this review).

Dec 5 2018, 11:28 AM

Dec 4 2018

rsmith added a comment to D54966: Implement P1007R3 `std::assume_aligned`.

@chandlerc, @hfinkel: does an attribute-only implementation (with no constant evaluation enforcement) materially hurt the ability for the optimizer to use this annotation? Eg, in:

extern char k[16];
void f() {
  // the initializer of p is a constant expression and might get constant-folded to &k by the frontend
  char *p = std::assume_aligned<16>(&k);
  // ...do stuff...
}

the alignment assumption may well never be emitted as IR. Is that acceptable?

__attribute__((assume_aligned(N))) and __builtin_assume_aligned are, at the IR level, implemented in a very-similar way. For functions with that attribute on the return type, we essentially emit an alignment assumption on the return value at every call site (in CodeGenFunction::EmitCall). Thus, from the optimizer's perspective, I don't think that it makes a big difference.

Dec 4 2018, 3:21 PM
rsmith committed rC348313: Fix crash if an in-class explicit function specialization has explicit.
Fix crash if an in-class explicit function specialization has explicit
Dec 4 2018, 2:29 PM
rsmith committed rL348313: Fix crash if an in-class explicit function specialization has explicit.
Fix crash if an in-class explicit function specialization has explicit
Dec 4 2018, 2:29 PM

Dec 3 2018

rsmith committed rC348233: Fix -Wmismatched-tags to not warn on redeclarations of structs in system.
Fix -Wmismatched-tags to not warn on redeclarations of structs in system
Dec 3 2018, 6:48 PM
rsmith committed rL348233: Fix -Wmismatched-tags to not warn on redeclarations of structs in system.
Fix -Wmismatched-tags to not warn on redeclarations of structs in system
Dec 3 2018, 6:48 PM
rsmith added a comment to D51568: [modules] Add `-fno-absolute-module-directory` flag for relocatable modules.

I don't think we need to change the serialization format for this: a serialized path beginning with / is already treated as absolute and any other path is already treated as relative, so we don't need a flag to carry that information.

But I think we need this since we now have two types of relative paths -- a CWD-relative path and a module-home-relative path -- and we use this flag to discern them for the AST reader. Previously, because cleanPathForOutput would always absolutify input paths, we didn't need this flag -- any relative path was relative the module home and all other paths were absolute.

Dec 3 2018, 6:21 PM
rsmith accepted D53787: [Sema] Provide -fvisibility-global-new-delete-hidden option.

Looks good with minor changes, thanks.

Dec 3 2018, 4:53 PM
rsmith added a comment to D54966: Implement P1007R3 `std::assume_aligned`.

We don't need to use __builtin_assume_aligned to implement this. We can use __attribute__((assume_aligned(N))) instead. That solves our constexpr problem.

Dec 3 2018, 1:56 PM
rsmith added reviewers for D54966: Implement P1007R3 `std::assume_aligned`: chandlerc, hfinkel.
Dec 3 2018, 1:40 PM
rsmith added inline comments to D40218: [Clang] Add __builtin_launder.
Dec 3 2018, 1:09 PM

Nov 29 2018

rsmith accepted D52967: Extend shelf-life by 70 years.

I'm assuming this is a patch from a time traveller who has come back from 11 years in the future seeking to prevent some disaster, after this test case somehow becomes part of some critical infrastructure. Definitely don't want to stand in the way of that!

Nov 29 2018, 6:11 PM
rsmith added inline comments to D55097: [constexpr][c++2a] Try-catch blocks in constexpr functions.
Nov 29 2018, 5:42 PM
rsmith added a comment to D51568: [modules] Add `-fno-absolute-module-directory` flag for relocatable modules.

I don't think we need to change the serialization format for this: a serialized path beginning with / is already treated as absolute and any other path is already treated as relative, so we don't need a flag to carry that information.

Nov 29 2018, 4:17 PM
rsmith added inline comments to D55057: [Headers] Make max_align_t match GCC's implementation..
Nov 29 2018, 2:08 PM
rsmith added a comment to D54986: Make CodeGen choose when to emit vtables..

Will -fforce-emit-vtables still work?

Nov 29 2018, 1:33 PM

Nov 28 2018

rsmith updated the diff for D54986: Make CodeGen choose when to emit vtables..
  • Do not emit unused discardable vtables.
Nov 28 2018, 5:02 PM

Nov 27 2018

rsmith added inline comments to D54986: Make CodeGen choose when to emit vtables..
Nov 27 2018, 10:36 PM
rsmith committed rC347730: PR39809: (const void*)0 is not a null pointer constant in C..
PR39809: (const void*)0 is not a null pointer constant in C.
Nov 27 2018, 10:28 PM
rsmith committed rL347730: PR39809: (const void*)0 is not a null pointer constant in C..
PR39809: (const void*)0 is not a null pointer constant in C.
Nov 27 2018, 10:28 PM
rsmith committed rL347729: PR12884: Add test (bug is already fixed)..
PR12884: Add test (bug is already fixed).
Nov 27 2018, 9:18 PM
rsmith committed rC347729: PR12884: Add test (bug is already fixed)..
PR12884: Add test (bug is already fixed).
Nov 27 2018, 9:18 PM
rsmith added inline comments to D54986: Make CodeGen choose when to emit vtables..
Nov 27 2018, 9:07 PM
rsmith added inline comments to D54986: Make CodeGen choose when to emit vtables..
Nov 27 2018, 7:56 PM
rsmith added a comment to D53925: [modules] Defer emission of inline key functions..

If CodeGen is able to emit inline key functions when the vtable is needed anyway, can we instead change DeclMustBeEmitted to not treat inline key functions specially? There is no reason we need to emit any symbols for:

Nov 27 2018, 7:54 PM
rsmith created D54986: Make CodeGen choose when to emit vtables..
Nov 27 2018, 7:51 PM
rsmith committed rL347692: Don't speculatively emit VTTs for classes unless we are able to correctly emit….
Don't speculatively emit VTTs for classes unless we are able to correctly emit…
Nov 27 2018, 11:37 AM