Chris Lattner
88dca04648
rename some helpers, have them return the idx of the field being accessed.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40764 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 22:33:49 +00:00
Chris Lattner
b4878f4a57
Use static methods, which don't require an instance of OCUVectorType
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40763 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 22:20:00 +00:00
Chris Lattner
667405a3b0
mark some methods static, don't consider a vector to be an ocuvector
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40762 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 22:19:39 +00:00
Chris Lattner
d14faaa7ec
silence some warnings.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40761 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 21:50:34 +00:00
Chris Lattner
cb92a11814
Minor comment improvements.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40760 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 21:47:28 +00:00
Chris Lattner
281a492261
make sure we don't lose the ability to parse carbon.h
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40759 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 21:40:29 +00:00
Reid Spencer
ad43ad4747
Hyphenate a word, to check auto-update feature. Third times the charm!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40734 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 09:58:41 +00:00
Reid Spencer
06ddd81e13
Expand a contraction to test auto-update on commit.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40733 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 09:54:52 +00:00
Reid Spencer
2f291ba967
Test auto-update with minor grammaro fix.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40732 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 09:50:49 +00:00
Chris Lattner
c1e50fc734
Fix a bug in my previous commit
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40719 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 04:22:39 +00:00
Chris Lattner
4cabcfea26
switch a fixme to an assert.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40717 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 04:14:33 +00:00
Steve Naroff
7b658aa315
Tweak to Expr::isIntegerConstantExpr...make sure the result is appropriately size for TypesCompatibleExpr's.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40716 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 04:09:23 +00:00
Chris Lattner
991ae518e9
Increase the macro id cache to look up several recent entries, not just the last one.
...
This is important in insane cases like the one dannyb sent me recently:
#define F0(a) void a(){}
#define F1(a) F0(a##0) F0(a##1) F0(a##2) F0(a##3) F0(a##4) F0(a##5) F0(a##6) F0(a##7)
#define F2(a) F1(a##0) F1(a##1) F1(a##2) F1(a##3) F1(a##4) F1(a##5) F1(a##6) F1(a##7)
#define F3(a) F2(a##0) F2(a##1) F2(a##2) F2(a##3) F2(a##4) F2(a##5) F2(a##6) F2(a##7)
#define F4(a) F3(a##0) F3(a##1) F3(a##2) F3(a##3) F3(a##4) F3(a##5) F3(a##6) F3(a##7)
#define F5(a) F4(a##0) F4(a##1) F4(a##2) F4(a##3) F4(a##4) F4(a##5) F4(a##6) F4(a##7)
#define F6(a) F5(a##0) F5(a##1) F5(a##2) F5(a##3) F5(a##4) F5(a##5) F5(a##6) F5(a##7)
F6(f)
cpp is great. :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40715 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 03:55:37 +00:00
Steve Naroff
9dfa7b4e32
Tidy up Parser::ParseTypeofSpecifier()...implement FIXME and minor restructure.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40713 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 02:53:48 +00:00
Steve Naroff
7f28fe8e00
Add a couple const modifiers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40708 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 00:19:14 +00:00
Steve Naroff
389cecc83f
Hack Expr::isConstantExpr() to allow for __builtin_types_compatible_p.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40705 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 00:13:27 +00:00
Steve Naroff
363bcff47d
- Finish hooking up support for __builtin_types_compatible_p().
...
- Fix type printing code for recently added TypeOfExpr/TypeOfType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40700 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 23:45:51 +00:00
Steve Naroff
d34e915f33
Add AST/Sema support for __builtin_types_compatible_p (a GNU extension).
...
Todo...still need to call the action from the parser...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40693 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 22:05:33 +00:00
Steve Naroff
9752f25748
Add comments to getTypeOfExpr/getTypeOfType.
...
Also add instances of TypeOfExpr/TypeOfType to the Types vector (so we can keep track of them).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40677 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 18:02:17 +00:00
Steve Naroff
8d1a3b8ca1
Two typeof() related changes...
...
- 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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40676 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 17:20:42 +00:00
Chris Lattner
bf98651d42
update this to build with LLVM ToT
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40665 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 06:24:52 +00:00
Chris Lattner
86e499d952
Print floating point literal values better.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40659 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 00:23:58 +00:00
Steve Naroff
2cb64ecc86
Tighten up Parser::ParseTypeofSpecifier().
...
Add some more tests to typeof.c. Also added a couple of missing "expect" attributes that caused the test to fail.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40656 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 23:56:32 +00:00
Chris Lattner
02c642e8f4
remove more explicit accesses to the canonical type pointer.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40653 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 21:33:24 +00:00
Chris Lattner
2dcb6bb17d
simplify some type checking code, don't explicitly access
...
canonical types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40652 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 21:27:01 +00:00
Chris Lattner
611c1fff19
move trivial type predicates inline.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40651 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 21:13:58 +00:00
Chris Lattner
c8629630ce
split the rest of the type predicates into pure predicates:
...
there is now an isXXXType and a getAsXXXType
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40646 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 19:29:30 +00:00
Chris Lattner
2ad07f06c5
add internals manual to project
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40645 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 18:57:09 +00:00
Chris Lattner
33fc68a7c3
Owen pointed out that this made no sense :)
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40644 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 18:54:50 +00:00
Chris Lattner
b39eec4913
add two missing files to the xcode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40643 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 18:43:04 +00:00
Chris Lattner
a1d9fdea79
rename isReferenceType to follow the new scheme.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40640 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 16:56:34 +00:00
Chris Lattner
befee48ff2
make isPointerType() a pure predicate, rename the
...
existing one to getAsPointerType()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40639 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 16:53:04 +00:00
Chris Lattner
11406c1428
update name
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40637 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 16:50:51 +00:00
Steve Naroff
d1861fd633
Add parsing and AST support for GNU "typeof".
...
Many small changes to lot's of files.
Still some FIXME's, however the basic support is in place.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40631 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 12:34:36 +00:00
Chris Lattner
8a2bc625e8
Oops, I committed the wrong file before. This expands the description of
...
type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40620 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 06:37:39 +00:00
Chris Lattner
86920d33ad
Add a start at a clang internals manual, documenting some
...
of the more subtle and interesting classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40615 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 05:42:17 +00:00
Chris Lattner
8993e90cd2
add a link
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40614 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 04:52:37 +00:00
Chris Lattner
d51d890954
Don't use canonical type for sema here. In
...
void func() {
typedef int foo;
foo *Y;
**Y; // error
}
we now get:
indirection requires pointer operand ('foo' invalid)
instead of:
indirection requires pointer operand ('int' invalid)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40597 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 18:53:26 +00:00
Steve Naroff
fcac0fff87
Upgrade a comment...
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40585 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 03:52:55 +00:00
Steve Naroff
fec0b49c3f
Finish up semantic analysis for vector components.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40584 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 03:29:09 +00:00
Steve Naroff
bea0b34d99
Implement pretty diagnostics when doing on-the-fly vector sizing (for vector component access).
...
For example, before this commit, the following diagnostics would be emitted...
ocu.c:49:12: error: incompatible types assigning 'float __attribute__((ocu_vector_type(3)))' to 'float4'
vec4_2 = vec4.rgb; // shorten
~~~~~~ ^ ~~~~~~~~
ocu.c:51:7: error: incompatible types assigning 'float __attribute__((ocu_vector_type(2)))' to 'float'
f = vec2.xx; // shorten
~ ^ ~~~~~~~
Now, the diagnostics look as you would expect...
ocu.c:49:12: error: incompatible types assigning 'float3' to 'float4'
vec4_2 = vec4.rgb; // shorten
~~~~~~ ^ ~~~~~~~~
ocu.c:51:7: error: incompatible types assigning 'float2' to 'float'
f = vec2.xx; // shorten
~ ^ ~~~~~~~
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40579 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-29 16:33:31 +00:00
Steve Naroff
31a458462c
Added a new expression, OCUVectorComponent.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40577 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-28 23:10:27 +00:00
Steve Naroff
e1b31fedbc
Implement syntax/semantic analysis for OCU Vector Components.
...
Next step, AST support...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40568 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-27 22:15:19 +00:00
Steve Naroff
7064f5c95b
Add Type::isOCUVectorType().
...
Convert isFunctionType(), isStructureType(), and isUnionType() to the new API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40541 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 18:32:01 +00:00
Steve Naroff
08f794b212
Fix the following bogus diagnostic...reported by Jeroen.
...
#include <stdio.h>
int
main(void) {
int test = 0;
printf("Type is %s\n", (test >= 1 ? "short" : "char"));
return (0);
}
It comes up with a diagnostic that's misleading upon first read.
t.c:7:36: error: incompatible operand types ('char *' and 'char *')
printf("Type is %s\n", (test >= 1 ? "short" : "char"));
^ ~~~~~~~ ~~~~~~
1 diagnostic generated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40526 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 14:35:56 +00:00
Chris Lattner
18cf0ffa74
add another link.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40512 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 06:11:49 +00:00
Chris Lattner
eca996743d
don't expect to be able to reparse arbitrary system headers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40511 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 05:59:05 +00:00
Steve Naroff
adc01856ec
Forgot a return stmt (oops).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40509 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 03:18:02 +00:00
Steve Naroff
dfa6aae5a1
Various improvements to Sema::ParseMemberReferenceExpr().
...
- 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().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40508 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 03:11:44 +00:00
Steve Naroff
82c7e6d821
- Fix commit in Parser.h (patch by Kevin Andre).
...
- Add comment and minor cleanup to yesterday's fix to ParseCallExpr().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40492 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-25 20:45:33 +00:00