it from several places. This merges the diagnostics, making them more
uniform and fewer in number. This also simplifies and cleans up the code.
Some highlights:
1. This removes a bunch of very-similar diagnostics.
2. This renames AssignmentCheckResult -> AssignConvertType
3. This merges PointerFromInt + IntFromPointer which were always treated the same.
4. This updates a bunch of test cases that have minor changes to the produced diagnostics.
llvm-svn: 45589
and OwningPtr instead of constructing only after all of sema is done. This
has a couple of effects:
1. it fixes memory leaks from all the error cases in sema
2. it simplifies the code significantly.
The cost of this is that the error case now new's and delete's an expr where
it did not before, but we don't care about the perf of the error case.
llvm-svn: 45380
- Changed Sema::ObjcActOnStartOfMethodDef() to register the methods with the global pools.
- Changed Sema::ActOnInstanceMessage() to look in global pools (should be much less error prone).
- Added a test case to message.m (for lookup that was broken).
Misc changes while I was investigating this...
- Changed Sema::ActOnAtEnd() to call AddFactoryMethodToGlobalPool (this looked like a cut/paste error).
- Added a comment and tweaked another where I was using the first person.
llvm-svn: 45142
Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation.
Added many utility methods to FullSourceLoc to provide shorthand for:
FullLoc.getManager().someMethod(FullLoc.getLocation());
instead we have:
FullLoc.someMethod();
Modified TextDiagnostics (and related classes) to use this short-hand.
llvm-svn: 44957
int test(int x, long long y) {
return x << y;
}
we now realize the type of the shift is int, not long long.
This fixes a fixme from june.
llvm-svn: 44912
this is passed to sema and ignored there, so the second part of the
string will not make it into the AST. Passing to Fariborz to finish
Sema + AST construction.
llvm-svn: 44898
As the comment in the code indicates, I'm not fond of this. Nevertheless, gcc compat is a goal.
Here is the case I'm talking about...
#import <Foundation/Foundation.h>
@interface AnyClass : NSObject
- (NSRect)rect;
@end
@class Helicopter;
static void func(Helicopter *obj) {
NSRect r = [obj rect];
}
...before this patch, we would warn/error. With this patch, everything "just works".
llvm-svn: 44682
the APFloat representing the parsed literal can represent the literal value
exactly. This is useful when performing various semantic checks on the code,
and issuing appropriate warnings to users.
llvm-svn: 44423
missing middle expression, and fix a codegen bug where
we didn't correctly promote the condition to the right
result type. This fixes PR1824.
llvm-svn: 44322
Moved utility functions IgnoreParen and friends to be static inline functions
defined in SemaUtil.h.
Added SemaUtil.h to Xcode project.
llvm-svn: 44312