paulsemel created this revision.
paulsemel added a reviewer: aaron.ballman.
The purpose of this new builtin is to be able to pretty print any structure at
runtime.
This might be really useful when debugging is not an option or is fastidious
(like for kernel development).
Repository:
rC Clang
paulsemel marked 4 inline comments as done.
paulsemel added inline comments.
Comment at: lib/CodeGen/CGBuiltin.cpp:1208
+
+assert(RT && "The first argument must be a record type");
+
aaron.ballman wrote:
> I don't see anything enforcing this constraint, so us
paulsemel updated this revision to Diff 137141.
paulsemel added a comment.
Applied Aaron change suggestions
Repository:
rC Clang
https://reviews.llvm.org/D44093
Files:
include/clang/Basic/Builtins.def
lib/CodeGen/CGBuiltin.cpp
Index: lib/CodeGen/CGBuiltin.cpp
===
paulsemel created this revision.
Herald added subscribers: cfe-commits, mgorny.
\!/ This is only a proof of concept !
The purpose of this checker is to improve the detection of unsequenced
modifications. Indeed, there is a warning the tries to detect those, but this
is not efficient at all.
The
paulsemel added a comment.
Hi Aleksei,
In https://reviews.llvm.org/D44154#1028612, @a.sidorin wrote:
> Hi Paul,
>
> You didn't add any reviewer. Do you need a review for this checker? Are you
> going to contribute this code to the upstream?
I was actually uploading this because Artem Dergache
paulsemel marked 2 inline comments as done.
paulsemel added inline comments.
Comment at: lib/CodeGen/CGBuiltin.cpp:1206
+QualType Arg0Type = Arg0->getType()->getPointeeType();
+const RecordType *RT = Arg0Type->getAs();
+
aaron.ballman wrote:
> You can use
paulsemel updated this revision to Diff 137369.
paulsemel added a comment.
Applied Aaron suggestion changes.
Added parameters checking in Sema.
Repository:
rC Clang
https://reviews.llvm.org/D44093
Files:
include/clang/Basic/Builtins.def
include/clang/Basic/DiagnosticSemaKinds.td
lib/Co
paulsemel updated this revision to Diff 137371.
paulsemel added a comment.
Updated with more context.
Repository:
rC Clang
https://reviews.llvm.org/D44093
Files:
include/clang/Basic/Builtins.def
include/clang/Basic/DiagnosticSemaKinds.td
lib/CodeGen/CGBuiltin.cpp
lib/Sema/SemaCheckin
paulsemel marked 12 inline comments as done.
paulsemel added inline comments.
Comment at: lib/CodeGen/CGBuiltin.cpp:1231
+ Types[getContext().VoidPtrTy] = "%p";
+ Types[getContext().FloatTy] = "%f";
+ Types[getContext().DoubleTy] = "%f";
aaron.ball
paulsemel updated this revision to Diff 137578.
paulsemel marked 3 inline comments as done.
paulsemel added a comment.
Applied Aaron suggestions
Repository:
rC Clang
https://reviews.llvm.org/D44093
Files:
include/clang/Basic/Builtins.def
lib/CodeGen/CGBuiltin.cpp
lib/Sema/SemaChecking.
paulsemel added inline comments.
Comment at: lib/CodeGen/CGBuiltin.cpp:1252
+ Types[getContext().getPointerType(getContext().CharTy)] = "%s";
+ GENERATE_TYPE_QUALIFIERS_NO_RESTRICT(getContext().CharTy, "%s")
+}
aaron.ballman wrote:
> paulsemel wrote
paulsemel updated this revision to Diff 137775.
paulsemel added a comment.
Added recursive type pretty-printing as suggested by Aaron.
Repository:
rC Clang
https://reviews.llvm.org/D44093
Files:
include/clang/Basic/Builtins.def
lib/CodeGen/CGBuiltin.cpp
lib/Sema/SemaChecking.cpp
Index
paulsemel updated this revision to Diff 137998.
paulsemel added a comment.
Applied Francis' suggestions
Repository:
rC Clang
https://reviews.llvm.org/D44093
Files:
include/clang/Basic/Builtins.def
lib/CodeGen/CGBuiltin.cpp
lib/Sema/SemaChecking.cpp
Index: lib/Sema/SemaChecking.cpp
===
paulsemel added a comment.
Hi,
In https://reviews.llvm.org/D44093#1034610, @lebedev.ri wrote:
> BTW, as far as i can tell this still has zero test coverage (no new tests are
> being added).
> I'd expect to see the tests for the actual output
>
> - one struct per each type it is able to print
>
paulsemel updated this revision to Diff 138687.
paulsemel added a comment.
Added some tests (unit tests for almost every types) and some other tests with
tricky cases.
More tests are coming soon.
Repository:
rC Clang
https://reviews.llvm.org/D44093
Files:
include/clang/Basic/Builtins.def
paulsemel updated this revision to Diff 138832.
paulsemel added a comment.
Applied Aaron's suggestions
Added Sema tests for the typechecking
Repository:
rC Clang
https://reviews.llvm.org/D44093
Files:
include/clang/Basic/Builtins.def
lib/CodeGen/CGBuiltin.cpp
lib/Sema/SemaChecking.cpp
paulsemel created this revision.
paulsemel added a reviewer: aaron.ballman.
This is an attempt for adding bitfield support to __builtin_dump_struct.
Repository:
rC Clang
https://reviews.llvm.org/D47953
Files:
lib/CodeGen/CGBuiltin.cpp
Index: lib/CodeGen/CGBuiltin.cpp
paulsemel added a comment.
This version is working for non packed structures. For packed structures, it
might sometimes work, sometimes not.
The resulting assembly code seems to be the right one.
If someone went through bitfields manipulation, please do not hesitate to
comment !
Requesting for h
paulsemel added a comment.
ping :) @aaron.ballman
Repository:
rC Clang
https://reviews.llvm.org/D47953
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
paulsemel added a comment.
I will for sure add tests @lebedev.ri . Fact is that, for the moment, this is
not working as expected.
This is why I am asking for a bit of help about this bitfield handling :)
Comment at: lib/CodeGen/CGBuiltin.cpp:1250
+ if (Info.IsSigned) {
+
paulsemel added a comment.
First thanks all for reviewing !
Basically, what's happening is that it works good with non-packed structures.
Here is an example for packed structure (with unsigned signed short):
c
struct lol {
unsigned short a:3;
unsigned short b:2;
unsig
paulsemel created this revision.
paulsemel added a reviewer: aaron.ballman.
Herald added a subscriber: cfe-commits.
There was missing some basic types format (like uint8_t..). This patch is meant
to print them the correct way.
Repository:
rC Clang
https://reviews.llvm.org/D45615
Files:
li
paulsemel added a comment.
In https://reviews.llvm.org/D45615#1066973, @lebedev.ri wrote:
> Tests?
I can do this. But currently, I am not testing the formats in the tests..
Repository:
rC Clang
https://reviews.llvm.org/D45615
___
cfe-commits m
paulsemel added a comment.
In https://reviews.llvm.org/D45615#1067068, @aaron.ballman wrote:
> In https://reviews.llvm.org/D45615#1066975, @paulsemel wrote:
>
> > In https://reviews.llvm.org/D45615#1066973, @lebedev.ri wrote:
> >
> > > Tests?
> >
> >
> > I can do this. But currently, I am not tes
paulsemel created this revision.
paulsemel added a reviewer: aaron.ballman.
Added check for correct formats in CodeGen tests, to ensure we are printing the
fields correctly.
Added a fix that outcomed from this previous add
Repository:
rC Clang
https://reviews.llvm.org/D45665
Files:
lib/Co
paulsemel updated this revision to Diff 142548.
paulsemel added a comment.
Fixed typo..
Repository:
rC Clang
https://reviews.llvm.org/D45665
Files:
lib/CodeGen/CGBuiltin.cpp
test/CodeGen/dump-struct-builtin.c
Index: test/CodeGen/dump-struct-builtin.c
paulsemel added a comment.
In https://reviews.llvm.org/D45665#1069075, @aaron.ballman wrote:
> LGTM!
Nice to hear ! As for the last time, as I don't have any rights to push this, I
would really appreciate if you could do it for me ! :)
Repository:
rC Clang
https://reviews.llvm.org/D45665
paulsemel updated this revision to Diff 142750.
paulsemel added a comment.
Removed the two existing types.
Added the correct format sizing.
Added tests for those formats.
These version is now relying on the previous patch :
https://reviews.llvm.org/D45665
Repository:
rC Clang
https://reviews
paulsemel added a comment.
In https://reviews.llvm.org/D45615#1069755, @aaron.ballman wrote:
> LGTM! I will go ahead and commit on your behalf. Btw, if you're thinking of
> making additional patches, now might be a good time to ask for commit
> privileges
> (https://llvm.org/docs/DeveloperPoli
paulsemel created this revision.
paulsemel added a reviewer: aaron.ballman.
This patch adds a test for long double format.
Repository:
rC Clang
https://reviews.llvm.org/D46033
Files:
test/CodeGen/dump-struct-builtin.c
Index: test/CodeGen/dump-struct-builtin.c
paulsemel closed this revision.
paulsemel added a comment.
commited on r330808
Repository:
rC Clang
https://reviews.llvm.org/D46033
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
paulsemel created this revision.
paulsemel added reviewers: jakehehrlich, echristo.
Herald added a subscriber: llvm-commits.
This option permit to localize a symbol by given its name.
Repository:
rL LLVM
https://reviews.llvm.org/D46064
Files:
test/tools/llvm-objcopy/localize.test
tools/l
paulsemel updated this revision to Diff 153511.
paulsemel added a comment.
Fixed version problem. Now building.
Repository:
rC Clang
https://reviews.llvm.org/D47953
Files:
lib/CodeGen/CGBuiltin.cpp
Index: lib/CodeGen/CGBuiltin.cpp
=
paulsemel added a comment.
In https://reviews.llvm.org/D47953#1143044, @dblaikie wrote:
> This doesn't seem to build for me - so hard to debug/probe it:
>
> llvm/src/tools/clang/lib/CodeGen/CGBuiltin.cpp:1264:65: error: no viable
> conversion from 'clang::QualType' to 'llvm::Type *'
>
> CGF.CG
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG145f353fd679: [clang][dataflow] fix failing assert in
copyRecord (authored by paulsemel).
Herald added a subscriber: cfe-commits.
Repository:
rG L
paulsemel marked 6 inline comments as done.
paulsemel added inline comments.
Comment at: test/Sema/builtin-dump-struct.c:8
+ void *b;
+ int (*goodfunc)(const char *, ...);
+ int (*badfunc1)(const char *);
aaron.ballman wrote:
> Can you also add a test for: `in
paulsemel updated this revision to Diff 140304.
paulsemel marked 3 inline comments as done.
paulsemel added a comment.
Added Aaron suggestions.
Fixed a bug when having nested anonymous unions and structures.
Repository:
rC Clang
https://reviews.llvm.org/D44093
Files:
include/clang/Basic/Bu
paulsemel marked an inline comment as done.
paulsemel added a comment.
No problem, thanks for getting back on this ! I was busy because of my midterms
anyway :)
Comment at: test/Sema/builtin-dump-struct.c:8
+ void *b;
+ int (*goodfunc)(const char *, ...);
+ int (*badfunc1)(
paulsemel updated this revision to Diff 141745.
paulsemel marked an inline comment as done.
paulsemel added a comment.
Updated the amperstamp in the Sema test to be consistent with the remaining
part of it.
Repository:
rC Clang
https://reviews.llvm.org/D44093
Files:
include/clang/Basic/Bu
paulsemel added inline comments.
Comment at: test/Sema/builtin-dump-struct.c:8
+ void *b;
+ int (*goodfunc)(const char *, ...);
+ int (*badfunc1)(const char *);
aaron.ballman wrote:
> paulsemel wrote:
> > aaron.ballman wrote:
> > > paulsemel wrote:
> > > > aar
paulsemel updated this revision to Diff 141762.
paulsemel added a comment.
Added a good test for the `int (*)()` function prototype, as we decided to
accept it as a valid function for the dumper
Repository:
rC Clang
https://reviews.llvm.org/D44093
Files:
include/clang/Basic/Builtins.def
paulsemel added a comment.
In https://reviews.llvm.org/D44093#1063122, @arichardson wrote:
> I'm also often restricted to using printf for debugging so this looks really
> useful!
>
> However, before committing this I feel like the test should also verify that
> the format strings that are gene
paulsemel added a comment.
I don't really know what's the procedure right now.. What should I do once you
both accepted the patch ? :)
Repository:
rC Clang
https://reviews.llvm.org/D44093
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
h
paulsemel added a comment.
In https://reviews.llvm.org/D44093#1063348, @aaron.ballman wrote:
> In https://reviews.llvm.org/D44093#1063340, @paulsemel wrote:
>
> > I don't really know what's the procedure right now.. What should I do once
> > you both accepted the patch ? :)
>
>
> You're good to
paulsemel updated this revision to Diff 141890.
paulsemel added a comment.
Patch rebased.
Minor fix for single quotes escaping.
Repository:
rC Clang
https://reviews.llvm.org/D44093
Files:
include/clang/Basic/Builtins.def
lib/CodeGen/CGBuiltin.cpp
lib/Sema/SemaChecking.cpp
test/CodeGe
paulsemel added a comment.
Sorry about it, I also have the warning on my machine, but not the error you
get...
Those test are actually working on my different linux machines, that's really
weird.
This one is actually really weird, because I could find manually the missing
pattern in your output
paulsemel updated this revision to Diff 141913.
paulsemel added a comment.
Fixed printf warning generated in tests/CodeGen.
Repository:
rC Clang
https://reviews.llvm.org/D44093
Files:
include/clang/Basic/Builtins.def
lib/CodeGen/CGBuiltin.cpp
lib/Sema/SemaChecking.cpp
test/CodeGen/du
paulsemel added a comment.
Ok, I found the problem. In fact the size of `long` is 4 bytes on your machine,
but 8 bytes on mine.
This makes this `// CHECK: [[LOAD1:%[0-9]+]] = load i64, i64* [[RES1]],` fail.
Do you know a smart way to do it without dealing with type sizes ?
Repository:
rC Clan
paulsemel added a comment.
Thanks a lot for your help, updating the patch !
Repository:
rC Clang
https://reviews.llvm.org/D44093
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
paulsemel updated this revision to Diff 141920.
paulsemel added a comment.
Added triple option to CodeGen test so that it matches with the correct
architecture
Repository:
rC Clang
https://reviews.llvm.org/D44093
Files:
include/clang/Basic/Builtins.def
lib/CodeGen/CGBuiltin.cpp
lib/Se
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG96d035c1dcd7: [clang][dataflow] unnamed bitfields should be
discarded in InitListExpr (authored by paulsemel).
Herald added a subscriber: cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe6e753d173db: [clang][dataflow] Fix wrong assert for
CXXConstructExpr (authored by paulsemel).
Herald added a subscriber: cfe-commits.
Repository:
52 matches
Mail list logo