Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
710ac7c
Fixed part 1 of #373
Jan 12, 2021
d917148
Actual fix
Jan 13, 2021
b24a251
Added test
Jan 13, 2021
efc9514
1st draft of single-var typedef handling
Jan 21, 2021
7a39353
Fixed first constraint issue
Jan 22, 2021
e56a07c
Merge branch 'main' into typedefs
Jan 22, 2021
6946d67
Merge branch 'main' into typedefs
Jan 22, 2021
a544451
Merge branch 'typedefs' of github.com:correctcomputation/checkedc-cla…
Jan 22, 2021
0481898
Moved definedType test to count
Jan 26, 2021
22a6eae
Fixing issue #373
Jan 28, 2021
57fe480
Merge branch 'main' into typedefs
Jan 29, 2021
70dc288
Fixed writing issue
Feb 2, 2021
156bf6c
Merge branch 'main' into typedefs
Feb 2, 2021
2e597e3
Fixed consistency issue w/ unwritable structs
Feb 4, 2021
34896cb
Fixed macro problem
Feb 4, 2021
185a7d5
Removed outdated TODO
Feb 4, 2021
20e4773
Added a descriptive reason for wildness root causes
Feb 4, 2021
7fe28e9
Fixed comment & style
Feb 4, 2021
7c7d95d
Style fixes
Feb 4, 2021
83a748d
Improved qualifier handling around typedefs
Feb 5, 2021
6676c06
Working on fixing the basedir tests
Feb 10, 2021
b6c5274
Merge branch 'main' into typedefs
Feb 18, 2021
0c3c72e
Update clang/test/3C/canwrite_constraints.h
Feb 19, 2021
7ab2c9e
Update clang/test/3C/root_cause.c
Feb 19, 2021
e6e1ae8
Updating canwrite tests
Feb 25, 2021
bea6efc
Updating canwrite tests
Feb 25, 2021
5627645
Merge branch 'main' into typedefs
Feb 25, 2021
956bcd1
Merge branch 'main' into typedefs
Feb 26, 2021
238e580
Fix for typedef'd arrays
Mar 3, 2021
34440e8
Fixed handling of function typedefs
Mar 5, 2021
7957e95
Merge branch 'main' into typedefs
Mar 5, 2021
79f8886
Style cleanup
Mar 5, 2021
67ecac9
Merge branch 'main' into typedefs
Mar 5, 2021
523a5a2
Fixed typo in test
Mar 5, 2021
260242a
Merge branch 'main' into typedefs
john-h-kastner Mar 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion clang/include/clang/3C/ProgramInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ class ProgramInfo : public ProgramVariableAdder {

// Map storing constraint information for typedefed types
// The set contains all the constraint variables that also use this tyepdef
// TODO this could be replaced w/ a signle CVar
// The bool informs the rewriter whether or not this typedef should be
// rewritten. It will be false for typedefs we don't support rewritting,
// such as typedefs that are pointers to anonymous structs
Comment thread
aaronjeline marked this conversation as resolved.
Outdated
Expand Down
8 changes: 4 additions & 4 deletions clang/lib/3C/ProgramInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1047,8 +1047,8 @@ void ProgramInfo::addTypedef(PersistentSourceLoc PSL, bool ShouldCheck,
auto Name = "typedef__" + TD->getNameAsString();
Comment thread
mattmccutchen-cci marked this conversation as resolved.
Outdated
auto* PV = new PointerVariableConstraint(TD->getUnderlyingType(), nullptr,
Name, *this, C);
if (ShouldCheck && canWrite(PSL.getFileName()))
this->typedefVars[PSL] = {*PV};
else
this->typedefVars[PSL] = {};
if (!(ShouldCheck && canWrite(PSL.getFileName())))
PV->constrainToWild(this->getConstraints(), "wild", &PSL);
Comment thread
mattmccutchen-cci marked this conversation as resolved.
Outdated
constrainWildIfMacro(PV, TD->getLocation(), &PSL);
this->typedefVars[PSL] = {*PV};
}
4 changes: 2 additions & 2 deletions clang/test/3C/basic_checks.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void mut_pa(PA p) {
p->a = 0;
p->b = 1;
}
//CHECK: void mut_pa(_Ptr<struct _A> p) {
//CHECK: void mut_pa(PA p) {

void pa_driver(void) {
A a = {0};
Expand All @@ -49,7 +49,7 @@ void pa_driver(void) {
}
//CHECK: void pa_driver(void) {
//CHECK-NEXT: A a = {0};
//CHECK-NEXT: _Ptr<struct _A> b = &a;
//CHECK-NEXT: PA b = &a;

int *id(int *a) {
return a;
Expand Down
4 changes: 2 additions & 2 deletions clang/test/3C/simple_locals.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ void dfnk(int a, int b) {
}
//CHECK: void dfnk(int a, int b) {
//CHECK-NEXT: A j;
//CHECK-NEXT: _Ptr<struct _A> k = &j;
//CHECK-NEXT: _Ptr<_Ptr<struct _A>> u = &k;
//CHECK-NEXT: PA k = &j;
//CHECK-NEXT: PPA u = &k;

void adsfse(void) {
int a = 0;
Expand Down
6 changes: 6 additions & 0 deletions clang/test/3C/typedefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ void barfoo(intptr x) {
*x = 5;
}

#define MYDECL typedef int* ZZZ;
MYDECL
void zzz(void) {
int x = 3;
ZZZ z = &x;
}



Expand Down