aboutsummaryrefslogtreecommitdiff
path: root/Sema
AgeCommit message (Collapse)Author
2007-11-27Report errors for invalid casts from/to vectors.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44350 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27Add more semantic analysis for inline asm statements.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44349 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-26Fix sema support for the gnu ?: expression with a Chris Lattner
missing middle expression, and fix a codegen bug where we didn't correctly promote the condition to the right result type. This fixes PR1824. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44322 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25Moved logic for -Wfloat-equal to SemaChecking.cpp.Ted Kremenek
Moved utility functions IgnoreParen and friends to be static inline functions defined in SemaUtil.h. Added SemaUtil.h to Xcode project. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44312 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25Check that the clobber registers are valid.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44311 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-23Keep track of whether the asm is volatile or not.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44297 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-23Check asm input and output expressions.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44289 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-22Store output and input operands as well as clobber information in the ↵Anders Carlsson
AsmStmt. Ted, could you please review the serialization/deserialization code? git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44266 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-20Store inline asm code in the AST.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44255 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-20Improve function decl merging, patch by Oliver Hunt!Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44253 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17Now that we are passing back "free standing decls", make sure -ast-dump ↵Steve Naroff
works like -ast-print. Also added a cast to be safe... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44209 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-17Make sure Sema::ParsedFreeStandingDeclSpec() returns a decl representing the ↵Steve Naroff
type. Adding basic printing to StmtPrinter::PrintRawDecl(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44208 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-16Tighten up address-of checking, implementing test/Sema/expr-address-of.c. Chris Lattner
This fixes a bug reported by Seo Sanghyeon. This was meant to be committed yesterday, but the commit failed. doh. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44190 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Finish up variadic methods/messages.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44172 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Implement support for variadic methods (work in progress).Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44171 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15- Implement ivar rewrite (patch by Fariborz).Steve Naroff
- RewriteMessageExpr()...make implicit casts explicit with synthesizing call (removing warnings when calling objc_msgSend()). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44156 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14Allow properties within a protocol. The case below was asserting...now it ↵Steve Naroff
works fine. @protocol CAMediaTiming @property int beginTime; @end Comments in the code tell the rest of the story... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44117 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14implement test/Sema/typedef-prototype.c, allowing codeChris Lattner
to declare a function with a typedef: typedef int unary_int_func(int arg); unary_int_func add_one; This patch contributed by Seo Sanghyeon! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44100 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Give AST-walk passes a way to access DeclSpec attributes on functions andNate Begeman
variables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44073 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Rename Sema method to follow class naming conventionNate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44069 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Modified -Wfloat-equal logic to suppress warnings where floating point valuesTed Kremenek
are compared against builtins such as __builtin_inf. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44058 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Updated diagnostic for -Wfloat-equal to underline the offending expressions.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44054 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Teach Sema::CheckCompareOperands() about "void *" (C99 6.5.9p2)Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44047 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Tune the lookup logic in Sema::ActOnInstanceMessage() to handle private ↵Steve Naroff
methods (declared within the implementation). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44041 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Patch to set context (interface, category, etc.) in which method is declared.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44038 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Fix Sema::CheckAssignmentConstraints() to operate on the canonical, ↵Steve Naroff
unqualified type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44036 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12Patch to do statically typed ivar references.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44028 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12Add category method definitions incrementally, removing a FIXME (like we do ↵Steve Naroff
for class implementations). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44027 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12Minor twik for when there is no super class and 'super' is errornously used.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44026 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12'super' nailed.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44025 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12Fix regression to Sema::ObjcActOnStartOfMethodDef()...need to initialize ↵Steve Naroff
InvalidType field to false. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44023 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12Implement instance variable references.Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44016 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12- Minor cleanup to yesterday's changes to Sema::ObjcActOnStartOfMethodDef();Steve Naroff
- Add Sema::CurMethodDecl, in preparation for adding ObjcIvarRefExpr. - Add ObjcInterfaceDecl::lookupInstanceVariable(), in prep for adding ivars. - A couple renames in ObjcInterfaceDecl, while I was in the vicinity:-) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44015 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12Remove Action::ObjcActOnMethodDefinition(). Rationale:Steve Naroff
- It is not an "action" - it is never called by the parser. - It was only used by one method, Sema::ObjcActOnStartOfMethodDef(). As a result, the logic it embodied is now directly implemented in Sema::ObjcActOnStartOfMethodDef(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44008 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12Make sure @property is allowed within a category.Steve Naroff
Bug submitted by Keith Bauer. CookieJar:Desktop keith$ cat test.m #import <WebKit/WebKit.h> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44007 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-12Remove Sema::ObjcBuildMethodParameter().Steve Naroff
Modify Sema::ParseParamDeclarator() to work for both ActOnStartOfFunctionDef() and ObjcActOnStartOfMethodDef(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44006 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-11Replace 2 method definition actions (ActOnFunctionDefBody, ↵Steve Naroff
ActOnMethodDefBody) with 1 method definition action (ActOnFinishFunctionBody). I can't think of any reason that we would need two action hooks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44000 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-11Tweak Sema::ActOnInstanceMessage() to treat the built-in "Class" type the ↵Steve Naroff
same as "id". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43996 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-11This is the last 5% of the solution to teaching Sema::ActOnInstanceMessage() ↵Steve Naroff
about private methods (r43989). While the diff is large, the idea is very simple. When we parse method definitions (in an @implementation), we need to add them incrementally (rather than wait until the @end). Other details... - Renamed Sema::ActOnAddMethodsToObjcDecl() to Sema::ActOnAtEnd(). The methods are now optional arguments. - Removed Parser::AllImplMethods (a nice cleanup). - Added location info to ObjcImplementationDecl (since we will need it very soon:-) - Modified message.m test to no longer allow the bogus diagnostic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43995 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-11Make sure Sema::CheckIncrementDecrementOperand() removes typedefs when doing ↵Steve Naroff
it's analysis. Thanks to Seo Sanghyeon for his excellent (first) bug fix! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43994 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-11Teach Sema::ActOnInstanceMessage() about private methods. That is, methods ↵Steve Naroff
declared in an implementation (but not listed in the interface). This commit is only 95% of the bug fix. The last piece to this puzzle is to add the method decls to the implementation incrementally (as we encounter them). At the moment, the methods aren't added until we see an @end (which is too late). I will complete this later... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43989 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-10Fixed a bug which exposed the internally built type to user code.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43987 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-10Fix a basic bug (having to do with typedefs) in ↵Steve Naroff
Sema::UsualArithmeticConversions(). This resuled in the following crash below. Also modified the usual-float.c test case to capture this case. [steve-naroffs-imac:clang/test/Sema] snaroff% ../../../../Debug/bin/clang usual-float.c Assertion failed: (0 && "Sema::UsualArithmeticConversions(): illegal float comparison"), function UsualArithmeticConversions, file SemaExpr.cpp, line 960. 0 clang 0x001ef9b9 _ZN40_GLOBAL__N_Signals.cpp_00000000_4E6DAF8315PrintStackTraceEv + 45 1 clang 0x001efd5f _ZN40_GLOBAL__N_Signals.cpp_00000000_4E6DAF8313SignalHandlerEi + 323 2 libSystem.B.dylib 0x90c6297b _sigtramp + 43 3 ??? 0xffffffff 0x0 + 4294967295 4 libSystem.B.dylib 0x90cdb782 raise + 26 5 libSystem.B.dylib 0x90cead3f abort + 73 6 libSystem.B.dylib 0x90cdc923 __assert_rtn + 101 7 clang 0x00077316 _ZN5clang4Sema26UsualArithmeticConversionsERPNS_4ExprES3_b + 1004 8 clang 0x000803cf _ZN5clang4Sema27CheckMultiplyDivideOperandsERPNS_4ExprES3_NS_14SourceLocationEb + 181 9 clang 0x0007a8e8 _ZN5clang4Sema10ActOnBinOpENS_14SourceLocationENS_3tok9TokenKindEPvS4_ + 472 10 clang 0x000cf058 _ZN5clang6Parser26ParseRHSOfBinaryExpressionENS_6Action12ActionResultILj0EEEj + 1286 11 clang 0x000cf2de _ZN5clang6Parser25ParseAssignmentExpressionEv + 86 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43985 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-10Minor code clean up in method def area.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43980 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-10Represent method definitions as separate AST nodes. Pretty print will come next.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43979 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09Some code clean up in the form of name changes for functions whichFariborz Jahanian
process method definitions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43967 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09Added class context to method declarations. Provide "interface *" typeFariborz Jahanian
to 'self' method of instance methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43957 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09Insert invisble arguments to method definition header.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43948 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08First patch toward rewriting of method definitions. This is work in progress.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43915 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-07AST for objective-c's @throw statement and its pretty-printing.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43802 91177308-0d34-0410-b5e6-96231b3b80d8