summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Unify ctx_iterator/ctx_begin()/ctx_end() and iterator/begin()/end() so that ↵Argyrios Kyrtzidis2008-07-173-159/+102
| | | | | | a single iterator type is used for both traversing decls of the same declaration context *and* of the parent declaration contexts, depending on the value of the bool parameter 'LookInParentCtx' that is passed to IdentifierResolver::begin(). llvm-svn: 53724
* When in C++, make EnumConstant names hide tag names in the same scope, ↵Argyrios Kyrtzidis2008-07-161-1/+6
| | | | | | instead of colliding with them. llvm-svn: 53702
* Two fixes:Steve Naroff2008-07-161-1/+2
| | | | | | | - Make sure ObjCIvarDecl propagates the bitfield width. - RewriteObjC::SynthesizeIvarOffsetComputation(): Avoid using the __OFFSETOF__ mumbo jumbo for bitfields (since it isn't legal C). This fixes <rdar://problem/5986079> clang ObjC rewriter: bitfields and ivar access don't mix. llvm-svn: 53694
* When checking for name collision between a tag and a previously defined ↵Argyrios Kyrtzidis2008-07-161-5/+8
| | | | | | | | namespace, the collision occured even when the tag was in a different nested scope. Fix it by taking into account the scope when checking for namespace-tag name collisions. llvm-svn: 53667
* Added parsing/sema support for __attribute__ ((IBOutlet)), a clang-specific ↵Ted Kremenek2008-07-151-0/+17
| | | | | | attribute that the static analyzer will use to recognize what ivars are IBOutlets. llvm-svn: 53644
* http://llvm.org/bugs/show_bug.cgi?id=2523Nate Begeman2008-07-142-22/+88
| | | | | | | | | Add some code to handle vector comparisons, which is the language side of the llvm vicmp/vfcmp instructions. Also make the vector-vector and vector-scalar asign checks a bit more sane under the presence of lax vector conversions. llvm-svn: 53565
* rename "SInt" methods to "Int" in APValue.Chris Lattner2008-07-111-6/+5
| | | | llvm-svn: 53467
* Extend va_start checking to include __builtin_stdarg_start.Ted Kremenek2008-07-091-0/+1
| | | | llvm-svn: 53332
* Add parser support for __builtin_stdarg_start, PR2531Chris Lattner2008-07-091-1/+2
| | | | llvm-svn: 53328
* fix CheckForConstantInitializer() for Compound LiteralsNuno Lopes2008-07-071-0/+5
| | | | | | also fix the correspondent test (it was expecting more errors than it should. please confirm my fix is correct (at least gcc agrees with me) llvm-svn: 53174
* Fix warningsSeo Sanghyeon2008-07-051-1/+2
| | | | llvm-svn: 53141
* Shuffle things around in preparation for integrating Eli's constant evaluator.Anders Carlsson2008-07-031-34/+7
| | | | llvm-svn: 53074
* Fix PR2020 by recovering by defining an anonymous enum, instead of recoveringChris Lattner2008-07-031-21/+24
| | | | | | by filling in the body of a union with enum constants. llvm-svn: 53069
* Added method "HandleTranslationUnit" to ASTConsumer. This is called by ↵Ted Kremenek2008-07-021-0/+2
| | | | | | ParseAST when all of the ASTs in a translation unit have been built. llvm-svn: 53042
* Update some comments.Argyrios Kyrtzidis2008-07-011-2/+2
| | | | llvm-svn: 52957
* Add Sema support for C++ classes.Argyrios Kyrtzidis2008-07-017-30/+398
| | | | llvm-svn: 52956
* Make a few related changes:Chris Lattner2008-06-302-14/+8
| | | | | | | | | | | | | | 1) add a new ASTContext::getFloatTypeSemantics method. 2) Use it from SemaExpr.cpp, CodeGenTypes.cpp and other places. 3) Change the TargetInfo.h get*Format methods to return their fltSemantics byref instead of by pointer. 4) Change CodeGenFunction::EmitBuiltinExpr to allow builtins which sometimes expand specially and othertimes fall back to libm. 5) Add support for __builtin_nan("") to codegen, cases that don't pass in an empty string are currently lowered to libm calls. 6) Fix codegen of __builtin_infl. llvm-svn: 52914
* make type attribute processing static instead of methods on Sema.Chris Lattner2008-06-292-48/+43
| | | | llvm-svn: 52881
* make the rest of the decl attribute processing methods beChris Lattner2008-06-292-179/+160
| | | | | | static functions instead of methods on sema. llvm-svn: 52880
* make most of Sema public. Sema is a class private to the Sema library Chris Lattner2008-06-292-39/+37
| | | | | | | anyway, so there is no real loss here. Start making attribute processing methods static functions instead of methods on Sema. llvm-svn: 52879
* move a few methods, no other change.Chris Lattner2008-06-291-74/+75
| | | | llvm-svn: 52878
* handle type attributes when converting types, not when processing decls.Chris Lattner2008-06-292-16/+6
| | | | llvm-svn: 52877
* Make ProcessDeclAttributes walk the declarator structure pulling Chris Lattner2008-06-292-21/+45
| | | | | | | | | | | | | decl attributes out of the various places they can hide. This makes us correctly reject things like this: t.c:2:22: error: mode attribute only supported for integer and floating-point types int **__attribute((mode(HI)))* i32; ^ because you can't make a pointer be HImode. llvm-svn: 52876
* move some code from all callers of ProcessDeclAttributes into Chris Lattner2008-06-293-18/+11
| | | | | | the implementation of ProcessDeclAttributes. llvm-svn: 52875
* more attribute refactoring/renaming, no functionality change.Chris Lattner2008-06-283-48/+53
| | | | llvm-svn: 52874
* more minor tidiness.Chris Lattner2008-06-281-17/+12
| | | | llvm-svn: 52873
* more cleanups, refactor HandleVectorTypeAttributeChris Lattner2008-06-282-42/+44
| | | | | | | | to work list the rest of the attr handlers. Also, rename it to HandleVectorSizeAttribute to match its attr name. No functionality change. llvm-svn: 52872
* adjust the prototypes of a bunch of decl processing methods to take Chris Lattner2008-06-283-157/+158
| | | | | | | | | | | the single attribute they look at by reference instead of by pointer. This is a subtle indicator that they take the specified attribute, not a whole list of them. This also make HandleExtVectorTypeAttribute work the same way as the rest of the attributes, adds some comments etc. No functionality change. llvm-svn: 52871
* Fix for PR2501; this patch makes usual arithmetic conversions for Eli Friedman2008-06-281-5/+28
| | | | | | | | integers which have the same width and different signedness work correctly. (The testcase in PR2501 uses a comparison between long and unsigned int). llvm-svn: 52853
* Replace CurFunctionDecl and CurMethodDecl with methods getCurFunctionDecl() ↵Argyrios Kyrtzidis2008-06-288-52/+50
| | | | | | and getCurMethodDecl() that return the appropriate Decl through CurContext. llvm-svn: 52852
* Fix a bug where we didn't promote 'const float' (or typedefs) toChris Lattner2008-06-271-4/+6
| | | | | | double in some places. llvm-svn: 52846
* the 'mode' attribute is a decl attribute, not a type attribute. Move it toChris Lattner2008-06-273-137/+130
| | | | | | SemaDeclAttr, and do some cleanups. llvm-svn: 52844
* move decl attribute processing to a new SemaDeclAttr.cpp.Chris Lattner2008-06-262-672/+658
| | | | llvm-svn: 52792
* Make Declarator::getDeclSpec() return a const reference to avoidChris Lattner2008-06-263-55/+58
| | | | | | cases where mutation can introduce bugs. Propagate around 'const'. llvm-svn: 52772
* add a comment about something that was surprising, at least to me.Chris Lattner2008-06-261-0/+3
| | | | llvm-svn: 52771
* fix a bug handling type attributes in the declspec. declspec processingChris Lattner2008-06-263-46/+32
| | | | | | | | | | used to mutate the attribute list for declspecs when the type was converted, breaking the case where one declspec was shared by multiple declarators. This fixes rdar://6032532. llvm-svn: 52769
* The assert at Sema::ObjCActOnStartOfMethodDef should check CurMethodDecl ↵Argyrios Kyrtzidis2008-06-251-1/+1
| | | | | | instead of CurFunctionDecl. llvm-svn: 52719
* 'Educate' IdentifierResolver about the declaration context of CXXFieldDecls.Argyrios Kyrtzidis2008-06-241-0/+4
| | | | llvm-svn: 52698
* Add parsing support for C++ classes.Argyrios Kyrtzidis2008-06-241-0/+3
| | | | | | | Note that Parser::ParseCXXMemberSpecification is temporarily disabled until the Sema support is in place. Once ParseCXXMemberSpecification is enabled, the Parser/cxx-class.cpp test will pass. llvm-svn: 52694
* ObjCMessageExpr objects that represent messages to class methods now can ↵Ted Kremenek2008-06-241-2/+10
| | | | | | contain the ObjCInterfaceDecl* of the target class if it was available when the ObjCMessageExpr object was constructed. The original interfaces of the class has been preserved (requiring no functionality changes from clients), but now a "getClasSInfo" method returns both the ObjCInterfaceDecl* and IdentifierInfo* of the target class. llvm-svn: 52676
* add a fixme backChris Lattner2008-06-211-0/+1
| | | | llvm-svn: 52607
* "this patch adds code generation hooks for Objective-C constant strings. It ↵Chris Lattner2008-06-211-8/+12
| | | | | | | | also modifies Sema so that Objective-C constant strings are treated as untyped objects if the interface for the constant string class can not be found. This is consistent with Apple GCC. I thought it was consistent with GNU GCC, since this was causing failures when trying to compile GNUstep with (GNU) GCC, but it appears that this is not the case when attempting to produce a simple test case to demonstrate it. Possibly there is a way of making the error go away, but I haven't found out what it is yet." Patch by David Chisnall! llvm-svn: 52599
* Don't add isa with @defs only to work around it in the code generator, patchChris Lattner2008-06-211-4/+0
| | | | | | by David Chisnall. llvm-svn: 52597
* "This moves built-in Objective-C types up the scope chains to where they can ↵Chris Lattner2008-06-211-51/+34
| | | | | | | | | | be replaced by versions included from the runtime library's headers." This makes it ok to use @"foo" without a declaration for NSConstantString. Patch by David Chisnall! llvm-svn: 52593
* add parser and sema support for the funny ObjC '@defs' thing.Chris Lattner2008-06-212-0/+31
| | | | | | Patch by David Chisnall! llvm-svn: 52586
* Switch 'super' from being a weird cast thing to being a predefined expr node.Chris Lattner2008-06-211-6/+2
| | | | | | Patch by David Chisnall with objc rewriter and stmtdumper updates from me. llvm-svn: 52580
* Change self/_cmd to be instances of ImplicitParamDecl instead of ParmVarDecl.Chris Lattner2008-06-173-8/+8
| | | | | | Patch by David Chisnall! llvm-svn: 52422
* Introduce preliminary support for NSString format-string checking.Ted Kremenek2008-06-164-2/+38
| | | | | | Patch by Nikita Zhuk! llvm-svn: 52336
* Don't crash if we can't find FileEntry info for a typedef, since one Eli Friedman2008-06-111-14/+17
| | | | | | | | | | | isn't guaranteed to exist. This fixes a crash with conflicting typedefs coming from stdin. This also fixes the crash in PR2406, but doesn't completely fix the issue; it appears there's something strange about the physical location for the definition of int64_t in stdlib.h. llvm-svn: 52209
* -Add DeclChain member to DeclContext.Argyrios Kyrtzidis2008-06-101-20/+14
| | | | | | | -ScopedDecls get chained to their DeclContext. -DeclContext's DeclChain replaces FunctionDecl's DeclChain and EnumDecl's ElementList. llvm-svn: 52164
OpenPOWER on IntegriCloud