| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Todo...still need to call the action from the parser...
llvm-svn: 40693
|
|
|
|
| |
llvm-svn: 40659
|
|
|
|
| |
llvm-svn: 40577
|
|
|
|
|
|
| |
This implements test/Sema/stmt_exprs.c
llvm-svn: 40465
|
|
|
|
| |
llvm-svn: 40388
|
|
|
|
| |
llvm-svn: 40162
|
|
|
|
|
|
|
| |
We still need to do sematic analysis (and implement initializers), however this
should complete the parsing & ast building for compound literals.
llvm-svn: 40067
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the result type of the expr node.
Implement isIntegerConstantExpr for ImplicitCastExpr nodes the same
was as for CastExpr nodes.
Implement proper sign/zero extension as well as truncation and noop
conversion in the i-c-e evaluator. This allows us to correctly
handle i-c-e's like these:
char array[1024/(sizeof (long))];
int x['\xBb' == (char) 187 ? 1: -1];
this implements test/Sema/i-c-e2.c
llvm-svn: 39888
|
|
|
|
| |
llvm-svn: 39846
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Fixed a recent regression discovered by Keith Bauer (thanks!).
The fix involved adding (back) two arguments to UsualArithmeticConversions.
Without the reference arguments, no unary conversions were being passed back
to the caller. This had the effect of turning off the UsualUnaryConversions.
- Refactored CheckAssignmentConstraints into 3 functions. CheckAssignmentConstraints,
CheckSingleAssignmentConstraints, and CheckCompoundAssignmentConstraints.
- Changed the argument type of DefaultFunctionArrayConversion from QualType->Expr*&.
- Removed a bunch of casts in routines I was working on (cleanup).
- Fixed the visitor for ImplicitCastExpr (oops).
llvm-svn: 39840
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
code generator. Source translation tools can simply ignore this node.
- Added a new Expr node, ImplicitCastExpr.
- Changed UsualUnaryConversions/UsualArithmeticConversions to take references
to Expr *'s. This will allow these routines to instantiate the new AST node
and pass it back.
- Changed all clients of UsualUnary/UsualArithmetic (lot's of diff's).
- Changed some names in CheckConditionalOperands. Several variables where
only distinguished by their case (e.g. Cond, cond). Yuck (what was I thinking).
- Removed an old/crufty constructor in CastExpr (cleanup).
This check-in does not actually create the new AST node. I wanted to separate
the mechanical changes from the semantic changes. In addition, I need to
coordinate with Chris, since the semantic change will break the code generator.
llvm-svn: 39814
|
|
|
|
|
|
|
|
|
|
|
| |
Both in one patch, and the test case that Chris didn't commit last
time is in there too...
I'll split the patch up if somebody wants it split."
Patch by Keith Bauer.
llvm-svn: 39796
|
|
|
|
|
|
| |
pretty printer to print it.
llvm-svn: 39770
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
out of the llvm namespace. This makes the clang namespace be a sibling of
llvm instead of being a child.
The good thing about this is that it makes many things unambiguous. The
bad things is that many things in the llvm namespace (notably data structures
like smallvector) now require an llvm:: qualifier. IMO, libsystem and libsupport
should be split out of llvm into their own namespace in the future, which will fix
this issue.
llvm-svn: 39659
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
void printutf8(unsigned int X) {
if (X <= 127)
printf("%c", (char)X);
else if (X <= 2047)
printf("%d %d ", 128 + 64 + (X >> 6), 128 + (X & ((1 << 6) - 1)));
else if (X <= 65535)
printf("%c%c%c", 128 + 64 + 32 + (X >> 12), 128 + ((X >> 6) & 63), 128 + (X & 63));
else
printf("UNKNOWN %d\n", X);
instead of:
if (X <= 127)
printf("%c", (char)X);
else
if (X <= 2047)
printf("%d %d ", 128 + 64 + (X >> 6), 128 + (X & ((1 << 6) - 1)));
else
if (X <= 65535)
printf("%c%c%c", 128 + 64 + 32 + (X >> 12), 128 + ((X >> 6) & 63), 128 + (X & 63));
else
printf("UNKNOWN %d\n", X);
llvm-svn: 39648
|
|
|
|
|
|
|
|
|
|
|
| |
declspecs,
like: int X, Y, Z;
This is required for the code gen to get to all of the declarations in a
DeclStmt, and should simplify some other code.
llvm-svn: 39623
|
|
|
|
|
|
| |
stmts prettier etc
llvm-svn: 39592
|
|
|
|
| |
llvm-svn: 39556
|
|
|
|
|
|
|
|
|
|
|
| |
We now print:
extern void blah();
as:
void (blah)();
Strange, but ok :)
llvm-svn: 39549
|
|
|
|
| |
llvm-svn: 39538
|
|
|
|
| |
llvm-svn: 39537
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a = b;
{
int c;
c = a + b;
int d;
d++;
}
int e;
instead of:
a = b;
{
int c;
c = a + b;
int d;
d++;
} int e;
llvm-svn: 39535
|
|
|
|
| |
llvm-svn: 39531
|
|
|
|
|
|
|
|
|
|
|
|
| |
Submitted by:
Reviewed by:
- ParseForStatement(): Put back a test/assignment. My removal of
ParseExprStmt() was a bit over zealous:-(thanks to Chris for pointing it out)
- Add assert to VisitDeclStmt().
- Removed an out-of-date FIXME
- Added some curlies for a couple multi-line calls to Diag().
llvm-svn: 39528
|
|
|
|
| |
llvm-svn: 39521
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Submitted by:
Reviewed by:
Implement some FIXME's that stand in the way of fully typechecking "for"
statements. This involved:
- Adding a DeclStmt AST node (with statement visitor). The DeclStmt
printer is preliminary.
- Added a ParseDeclStmt action, called from Parser::ParseForStatement()
and Parser::ParseStatementOrDeclaration(). DID NOT add to
Parser::ParseIdentifierStatement()...probably could have, however didn't
really understand the context of this rule (will speak with Chris).
- Removed ParseExprStmt (and it's clients)...it was vestigial.
llvm-svn: 39518
|
|
|
|
| |
llvm-svn: 39510
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the label identifier. Handle fwd references etc. This allows us to detect
uses of undefined labels and label redefinitions, such as:
t.c:2:12: error: redefinition of label 'abc'
abc: ; abc:
^
t.c:2:3: error: previous definition is here
abc: ; abc:
^
t.c:12:12: error: use of undeclared label 'hijl'
goto hijl;
^
llvm-svn: 39509
|
|
|
|
| |
llvm-svn: 39507
|
|
|
|
| |
llvm-svn: 39505
|
|
|
|
| |
llvm-svn: 39489
|
|
|
|
| |
llvm-svn: 39488
|
|
|
|
|
|
|
|
|
|
| |
Submitted by: Bill Wendling
Reviewed by: Chris Lattner
- Changed "std::cerr" to "OS" stream to be consistent with the other
outputs in the method.
llvm-svn: 39483
|
|
|
|
|
|
| |
integer constants, whoa! :)
llvm-svn: 39475
|
|
|
|
| |
llvm-svn: 39469
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
void foo() {
abc:
def:
hij:
case 1:
case 1:
goto abc
baz:
goto def
}
instead of:
void foo() {
abc:
def:
hij:
case 1:
case 1:
goto abc
baz:
goto def
}
llvm-svn: 39468
|
|
|
|
|
|
|
| |
QualType::getAsString() that returns a string, which is much easier
for clients to use. Convert clients to use it.
llvm-svn: 39449
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Submitted by:
Reviewed by:
Misc. changes driven by getting "carbon.h" to compile...
- Added ParseCharacterConstant() hook to Action, Sema, etc.
- Added CheckAssignmentOperands() & CheckCommaOperands() to Sema.
- Added CharacterLiteral AST node.
- Fixed CallExpr instantiation - install the correct type.
- Install a bunch of temp types and annotate with FIXME's.
llvm-svn: 39416
|
|
|
|
|
|
|
|
|
|
|
|
| |
This set of changes includes:
- convert ExprCXX.h and add to the Xcode project file.
-- required adding CXXBoolLiteralExpr to StmtNodes.def.
-- required adding visitor support (decl/defn).
- make the class codes in StmtNodes.def explicit (to enable range checking).
-- this required changing all clients of the STMT macro.
- declare the instance data const.
llvm-svn: 39344
|
|
|
|
|
|
|
|
|
| |
IntegerConstant->StringLiteral).
clang still compiled/linked/ran properly...simply a confusing name regression.
From now on I'll make sure I run "cvs diff" before committing any changes!
llvm-svn: 39342
|
|
|
|
|
|
|
| |
rename FloatingConstant->FloatingLiteral
rename StringExpr->StringLiteral
llvm-svn: 39341
|
|
|
|
|
|
| |
reinterpret_cast, and static_cast. Patch by Bill!
llvm-svn: 39247
|
|
|
|
| |
llvm-svn: 39193
|
|
|
|
| |
llvm-svn: 39191
|
|
|
|
|
|
|
|
| |
typedef int G;
X = sizeof(const G);
X = sizeof(restrict G);
llvm-svn: 39190
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
void foo(int X) {
X = __alignof(int);
X = sizeof(const int** restrict ** volatile*);
}
as:
x = __alignof(int)
x = sizeof(int const **restrict **volatile *)
llvm-svn: 39181
|
|
|
|
| |
llvm-svn: 39137
|