This is an archive of the discontinued LLVM Phabricator instance.

Using of variable length arrays in captured statements and OpenMP constructs
ClosedPublic

Authored by ABataev on Jun 9 2014, 3:55 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

ABataev updated this revision to Diff 10236.Jun 9 2014, 3:55 AM
ABataev retitled this revision from to Using of variable length arrays in captured statements and OpenMP constructs.
ABataev updated this object.
ABataev edited the test plan for this revision. (Show Details)
ABataev added a subscriber: Unknown Object (MLST).
jcownie added a subscriber: jcownie.Jun 9 2014, 4:13 AM

This looks very dubious
lib/CodeGen/CGStmt.cpp : 2076

assert(CD->hasBody() && "missing CapturedDecl body");

I believe the "&&" should be a comma.

hfinkel edited edge metadata.Jun 9 2014, 4:17 AM
  • Original Message -----

From: "Jim Cownie" <james.h.cownie@intel.com>
To: "a bataev" <a.bataev@hotmail.com>, dgregor@apple.com, hfinkel@anl.gov, cbergstrom@pathscale.com,
fraggamuffin@gmail.com, richard@metafoo.co.uk, rjmccall@gmail.com
Cc: "james h cownie" <james.h.cownie@intel.com>, cfe-commits@cs.uiuc.edu
Sent: Monday, June 9, 2014 6:13:09 AM
Subject: Re: [PATCH] Using of variable length arrays in captured statements and OpenMP constructs

This looks very dubious
lib/CodeGen/CGStmt.cpp : 2076

assert(CD->hasBody() && "missing CapturedDecl body");

I believe the "&&" should be a comma.

No, this looks fine (and follows the LLVM coding convention, see: http://llvm.org/docs/CodingStandards.html#assert-liberally).

-Hal

http://reviews.llvm.org/D4067

Ah, sorry, I should keep my nose out of stuff that I don't understand.

To a C programmer it looks very odd indeed, and could never assert (since the pointer to the string would be cast to a truth value, and would always be true).

I'll crawl back under my stone and get back to what I'm supposed to be working on :-)

  • Jim

James Cownie <james.h.cownie@intel.com>
SSG/DPD/TCAR (Technical Computing, Analyzers and Runtimes)
Tel: +44 117 9071438

Man, I must be in a fuddle this morning. I blame it being Monday.
My logic is utterly wrong :-(

  • Jim

James Cownie <james.h.cownie@intel.com>
SSG/DPD/TCAR (Technical Computing, Analyzers and Runtimes)
Tel: +44 117 9071438

Jim, no problems. :)

Best regards,

Alexey Bataev

Software Engineer
Intel Compiler Team

9 Июнь 2014 г. 15:27:28, Jim Cownie писал:

Man, I must be in a fuddle this morning. I blame it being Monday.
My logic is utterly wrong :-(

  • Jim

James Cownie <james.h.cownie@intel.com>
SSG/DPD/TCAR (Technical Computing, Analyzers and Runtimes)
Tel: +44 117 9071438

http://reviews.llvm.org/D4067

rsmith accepted this revision.Jun 27 2014, 8:52 AM
rsmith edited edge metadata.

LGTM

Seems like a nice approach. We might want to consider doing the same thing in lambdas at some point :)

This revision is now accepted and ready to land.Jun 27 2014, 8:52 AM

Richard,
Thanks for the review. I can try to prepare similar patch for lambdas
in a few days.

Best regards,

Alexey Bataev

Software Engineer
Intel Compiler Team

27 Июнь 2014 г. 19:52:40, Richard Smith писал:

LGTM

Seems like a nice approach. We might want to consider doing the same thing in lambdas at some point :)

http://reviews.llvm.org/D4067

ABataev closed this revision.Jun 29 2014, 8:04 PM
ABataev updated this revision to Diff 10969.

Closed by commit rL212010 (authored by @ABataev).