| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
block (because we are creating a CFG from an incomplete AST) we now
(gracefully) have a block ending with such statements not have any successors
instead of firing an assertion.
llvm-svn: 41327
|
|
|
|
| |
llvm-svn: 41325
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
capitalization.
Added explicit "Exit" CFGBlock pointer to the source-level CFG.
Changed the construction of blocks with "return" statements to have the
return statement appear both as a statement in the list of statements for
a CFGBlock as well as appear as a control-flow terminator. Also removed
the implicit linearization of "return" so that the return value and the
return statement did not appear as separate statements in the block.
llvm-svn: 41323
|
|
|
|
|
|
|
|
| |
where break targets weren't being set and restored properly. Also
cleaned up CFGBuilder code for "for" and "while" to use less reliance
on globals and to have clearer semantics.
llvm-svn: 41302
|
|
|
|
|
|
| |
Some comment cleanups.
llvm-svn: 41299
|
|
|
|
|
|
|
| |
Cleaned up some code for "for" and "while" loops by making their
implementations more symmetrical (and added a few comments).
llvm-svn: 41298
|
|
|
|
|
|
|
| |
Adjusted printing of source-level CFGs to account that the entry block
may not be the first block in the list of blocks a CFG object maintains.
llvm-svn: 41294
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In CFG dumper, refactored the code to print block terminators into a
StmtVisitor.
Added the method "FinishBlock" to CFGBuilder to do the reversal of statements
in a block instead of calling "reverseStmts" for a block directly. This
was necessary to fix a bug in how blocks with labels were being processed
(some cases would cause the statements to be reversed twice). FinishBlock
detects blocks that start with labels and doesn't do a second reversal.
llvm-svn: 41281
|
|
|
|
|
|
| |
to labeled blocks from a list to a vector.
llvm-svn: 41274
|
|
|
|
| |
llvm-svn: 41273
|
|
|
|
|
|
|
| |
Modified CFG so that getEntry(), getExit(), front() and back() return
CFGBlock& instead of CFGBlock*.
llvm-svn: 41258
|
|
|
|
|
|
| |
dispatch to walk the AST.
llvm-svn: 41254
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added builder code to translate ASTs to CFGs. This currently supports
if, return, and non-control flow statements.
Added pretty-printer to debug CFGs.
Added a "-dump-cfg" option to the clang driver to dump CFGs for code
sent through the frontend.
llvm-svn: 41252
|
|
|
|
| |
llvm-svn: 41238
|
|
|
|
| |
llvm-svn: 41229
|
|
|
|
|
|
|
| |
significantly faster and actually reduces the amount of code in the system.
This also allows for future visitor changes.
llvm-svn: 41211
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to getBase and getIdx. getBase and getIdx now return a "normalized" view
of the expression (e.g., always "A[4]" instead of possibly "4[A]"). getLHS
and getRHS return the expressions with syntactic fidelity to the original
source code.
Also modified client code of ArraySubscriptExpr, including the AST dumper
and pretty printer, the return-stack value checker, and the LLVM code
generator.
llvm-svn: 41180
|
|
|
|
| |
llvm-svn: 41136
|
|
|
|
| |
llvm-svn: 41011
|
|
|
|
| |
llvm-svn: 40969
|
|
|
|
| |
llvm-svn: 40968
|
|
|
|
| |
llvm-svn: 40967
|
|
|
|
| |
llvm-svn: 40964
|
|
|
|
| |
llvm-svn: 40959
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows us to dump:
typedef short S;
int test(S X, long long Y) {
return X < ((100));
}
as:
typedef short S;
int test(S X, long long Y)
(CompoundStmt 0x2905d40
(ReturnStmt 0x2905d30
(BinaryOperator 0x2905d10 'int' '<'
(ImplicitCastExpr 0x2905d00 'int'
(DeclRefExpr 0x2905c80 'S':'short' Decl='X' 0x2905c20))
(ParenExpr 0x2905ce0 'int'
(ParenExpr 0x2905cc0 'int'
(IntegerLiteral 0x2905ca0 'int' 100))))))
llvm-svn: 40956
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the AST in a structural, non-pretty, form useful for understanding
the AST. It isn't quite done yet, but is already somewhat useful.
For this example:
int test(short X, long long Y) {
return X < ((100));
}
we get (with -parse-ast-dump):
int test(short X, long long Y)
(CompoundStmt 0x2905ce0
(ReturnStmt 0x2905cd0
(BinaryOperator 0x2905cb0 '<'
(ImplicitCastExpr 0x2905ca0
(DeclRefExpr 0x2905c20 Decl='X' 0x2905bb0))
(ParenExpr 0x2905c80
(ParenExpr 0x2905c60
(IntegerLiteral 0x2905c40 100))))))
llvm-svn: 40954
|
|
|
|
| |
llvm-svn: 40951
|
|
|
|
|
|
|
|
|
|
|
| |
"public", however
it is used by "tgmath.h" (so we need to support it). It might also come in handy when
developing the overloaded function macros for OpenCU.
Next check-in will make this an integer constant expression...
llvm-svn: 40930
|
|
|
|
|
|
|
|
|
|
|
|
| |
[dylan:clang/test/Parser] admin% ../../../../Debug/bin/clang -parse-ast-check typeof.c
Warnings expected but not seen:
Line 21: incompatible types assigning 'typeof(*pi) const' to 'int *'
Warnings seen but not expected:
Line 21: incompatible types assigning 'typeof(*pi) const' to 'int *'
Also corrected a typo from my previous commit.
llvm-svn: 40832
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
struct X { int A; };
void foo() {
struct X s;
int i;
i = __builtin_choose_expr(0, s, i);
}
compiles to:
%tmp = load i32* %i ; <i32> [#uses=1]
store i32 %tmp, i32* %i
wow :)
llvm-svn: 40801
|
|
|
|
| |
llvm-svn: 40794
|
|
|
|
|
|
| |
OCUVectorElementExpr respectively. This is for consistency with other expr nodes end with *Expr.
llvm-svn: 40785
|
|
|
|
| |
llvm-svn: 40778
|
|
|
|
| |
llvm-svn: 40768
|
|
|
|
| |
llvm-svn: 40764
|
|
|
|
| |
llvm-svn: 40763
|
|
|
|
| |
llvm-svn: 40760
|
|
|
|
|
|
| |
size for TypesCompatibleExpr's.
llvm-svn: 40716
|
|
|
|
| |
llvm-svn: 40705
|
|
|
|
|
|
| |
- Fix type printing code for recently added TypeOfExpr/TypeOfType.
llvm-svn: 40700
|
|
|
|
|
|
| |
Todo...still need to call the action from the parser...
llvm-svn: 40693
|
|
|
|
|
|
| |
Also add instances of TypeOfExpr/TypeOfType to the Types vector (so we can keep track of them).
llvm-svn: 40677
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Changed the name of ASTContext::getTypeOfType(Expr*)->getTypeOfExpr().
- Remove FIXME for TypeOfExpr::getAsStringInternal(). This will work fine for printing the AST. It isn't ideal
for error diagnostics (since it's more natural to display the expressions type).
One "random" (or at least delayed:-) change...
- Changed all "ext_typecheck_*" diagnostics from EXTENSION->WARNING. Reason: Since -pedantic is now
off (by default), these diagnostics were never being emitted (which is bad). With this change, clang will
emit the warning all the time. The only downside (wrt GCC compatibility) is -pedantic-errors will not turn
this diagnostics into errors (a "feature" of making tagging them with EXTENSION). When/if this becomes
an issue, we can revisit.
llvm-svn: 40676
|
|
|
|
| |
llvm-svn: 40659
|
|
|
|
| |
llvm-svn: 40651
|
|
|
|
|
|
| |
there is now an isXXXType and a getAsXXXType
llvm-svn: 40646
|
|
|
|
| |
llvm-svn: 40640
|
|
|
|
|
|
| |
existing one to getAsPointerType()
llvm-svn: 40639
|
|
|
|
|
|
|
| |
Many small changes to lot's of files.
Still some FIXME's, however the basic support is in place.
llvm-svn: 40631
|
|
|
|
| |
llvm-svn: 40584
|