| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 40577
|
|
|
|
|
|
| |
Convert isFunctionType(), isStructureType(), and isUnionType() to the new API.
llvm-svn: 40541
|
|
|
|
| |
llvm-svn: 40509
|
|
|
|
|
|
|
|
|
|
|
| |
- Added source range support to Diag's.
- Used the new type predicate API to remove dealing with the canonical
type explicitly.
- Added Type::isRecordType().
- Removed some casts.
- Removed a const qualifier from RecordType::getDecl().
llvm-svn: 40508
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
promotions on it's argument types.
This resulted in the following errors when compiling promote_types_in_proto.c test...
[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang test/Parser/promote_types_in_proto.c
test/Parser/promote_types_in_proto.c:7:24: error: incompatible types passing 'char *[]' to function expecting 'char *const []'
arrayPromotion(argv);
~~~~~~~~~~~~~~ ^~~~
test/Parser/promote_types_in_proto.c:8:27: error: incompatible types passing 'void (char *const [])' to function expecting 'void (char *const [])'
functionPromotion(arrayPromotion);
~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~
2 diagnostics generated.
When fixing this, noticed that both ParseCallExpr() and ParseReturnStmt() were prematurely comparing types for
equivalence. This is incorrect (since the expr. promotions haven't been done yet). To fix this, I moved the
check "down" to Sema::CheckAssignmentConstraints().
I also converted Type::isArrayType() to the modern API (since I needed it). Still more Type predicates to
convert.
llvm-svn: 40475
|
|
|
|
|
|
| |
This implements test/Sema/stmt_exprs.c
llvm-svn: 40465
|
|
|
|
|
|
| |
Patch by Neil Booth!
llvm-svn: 40452
|
|
|
|
| |
llvm-svn: 40388
|
|
|
|
| |
llvm-svn: 40375
|
|
|
|
| |
llvm-svn: 40176
|
|
|
|
| |
llvm-svn: 40162
|
|
|
|
| |
llvm-svn: 40113
|
|
|
|
| |
llvm-svn: 40110
|
|
|
|
|
|
| |
carbon.h working again.
llvm-svn: 40068
|
|
|
|
|
|
|
| |
We still need to do sematic analysis (and implement initializers), however this
should complete the parsing & ast building for compound literals.
llvm-svn: 40067
|
|
|
|
|
|
| |
fixme's.
llvm-svn: 40012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows us to compile this:
struct abc { char A; double D; };
int foo() {
return sizeof(struct abc);
return __alignof__(struct abc);
}
Into:
ret i32 16
ret i32 8
llvm-svn: 40010
|
|
|
|
|
|
|
|
|
|
|
| |
- added ocu_vector_type attribute, Sema::HandleOCUVectorTypeAttribute().
- added new AST node, OCUVectorType, a subclass of VectorType.
- added ASTContext::getOCUVectorType.
- changed ASTContext::convertToVectorType() to ASTContext::getVectorType(). This is
unrelated to extended vectors, however I was in the vicinity and it was on my todo list.
Added a FIXME to Sema::HandleVectorTypeAttribute to deal with converting complex types.
llvm-svn: 40007
|
|
|
|
|
|
| |
hooked up to anything, so it's not very useful yet.
llvm-svn: 40006
|
|
|
|
| |
llvm-svn: 39996
|
|
|
|
| |
llvm-svn: 39994
|
|
|
|
| |
llvm-svn: 39956
|
|
|
|
|
|
| |
the canonical type. Also fix so that we're not expecting a return value from a void function
llvm-svn: 39954
|
|
|
|
|
|
|
|
| |
According to the spec (C++ 5p6[expr]), we need to adjust "T&" to
"T" before further analysis. We do this via the "implicit cast"
thingy.
llvm-svn: 39953
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
isPointerType and isVectorType to only look through a single level of typedef
when one is present. For this invalid code:
typedef float float4 __attribute__((vector_size(16)));
typedef int int4 __attribute__((vector_size(16)));
typedef int4* int4p;
void test(float4 a, int4p result, int i) {
result[i] = a;
}
we now get:
t.c:5:15: error: incompatible types assigning 'float4' to 'int4'
result[i] = a;
~~~~~~~~~ ^ ~
instead of:
t.c:5:15: error: incompatible types assigning 'float4' to 'int __attribute__((vector_size(16)))'
result[i] = a;
~~~~~~~~~ ^ ~
The rest of the type predicates should be upgraded to do the same thing.
llvm-svn: 39932
|
|
|
|
| |
llvm-svn: 39925
|
|
|
|
| |
llvm-svn: 39907
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
information in the common case. On this invalid code:
typedef float float4 __attribute__((vector_size(16)));
typedef int int4 __attribute__((vector_size(16)));
void test(float4 a, int4 *result, int i) {
result[i] = a;
}
we now generate:
t.c:5:15: error: incompatible types assigning 'float4' to 'int4'
instead of:
t.c:5:15: error: incompatible types assigning 'float4' to 'int __attribute__((vector_size(16)))'
This implements test/Sema/typedef-retain.c
llvm-svn: 39892
|
|
|
|
|
|
| |
the actual vectortype or pointertype when they return success.
llvm-svn: 39890
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
not all builtin types have size and alignment equal to pointers :)
llvm-svn: 39887
|
|
|
|
| |
llvm-svn: 39886
|
|
|
|
| |
llvm-svn: 39884
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unlike the
previous two checkins, which involved lot's of tedious refactoring, this checkin is nice and clean:-)
- Hacked UsualUnaryConversions, UsualArithmeticConversions, and DefaultFunctionArrayConversion
to create the AST node (using a helper function promoteExprToType).
- Added a setType method to Expr.
- Changed Expr::isIntegerConstantExpr to allow for the new node.
llvm-svn: 39866
|
|
|
|
|
|
| |
compute type alignment. This info is needed for struct layout.
llvm-svn: 39850
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 39838
|
|
|
|
| |
llvm-svn: 39837
|
|
|
|
|
|
| |
where ASTContext can manage caches for struct layout, etc.
llvm-svn: 39835
|
|
|
|
| |
llvm-svn: 39832
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Keith Bauer.
llvm-svn: 39793
|
|
|
|
| |
llvm-svn: 39792
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Teach all the integer/float predicates on Type about Vectors.
- Disallow bitwise compliment on float vectors. For example...
typedef float __attribute__(( vector_size(16) )) float4;
float4 float4_return()
{
float4 xx;
return ~xx;
}
...now emits the following diagnostic...
[administrators-powerbook59:~/llvm/tools/clang] admin% ../../Debug/bin/clang bug.c
bug.c:8:12: error: invalid argument type to unary expression 'float4'
return ~xx;
^
1 diagnostic generated.
llvm-svn: 39791
|
|
|
|
|
|
| |
Benoit Boissinot!
llvm-svn: 39780
|
|
|
|
| |
llvm-svn: 39777
|
|
|
|
|
|
| |
pretty printer to print it.
llvm-svn: 39770
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Submitted by:
Reviewed by:
Removed Attr.[h,cpp]...they didn't have any useful content.
When more (GCC) attributes are added, we might want to create a file
of this ilk. For now, it's better to remove them (to eliminate any confusion).
I also update the Xcode project file...
llvm-svn: 39729
|