summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* Set proper location info on objc method arguments.Chris Lattner2009-04-111-5/+3
| | | | llvm-svn: 68877
* simplify code to use adjustParameterType, apply objc arg attributesChris Lattner2009-04-112-19/+19
| | | | | | to their arguments. llvm-svn: 68876
* fix blocks to reject objc interfaces returned by value. Also,Chris Lattner2009-04-111-11/+22
| | | | | | | a block without a prototype should still coerce a return in it to use the declared return type. llvm-svn: 68875
* diagnose attempts to return objc interfaces by-value from C functions.Chris Lattner2009-04-111-1/+9
| | | | llvm-svn: 68873
* Improve the 'cannot pass objc interface by value' diagnostic:Chris Lattner2009-04-112-20/+19
| | | | | | | | | | | | | | | | | | 1) improve localizability by not passing english strings in. 2) improve location for arguments. 3) print the objc type being passed. Before: method-bad-param.m:15:1: error: Objective-C type cannot be passed by value -(void) my_method:(foo) my_param ^ after: method-bad-param.m:15:25: error: Objective-C interface type 'foo' cannot be passed by value -(void) my_method:(foo) my_param ^ llvm-svn: 68872
* change the interface to ActOnMethodDeclaration to pass down argumentChris Lattner2009-04-112-12/+16
| | | | | | | information in a little struct instead of individually. While we're at it, add per-argument loc info and attribute info. llvm-svn: 68871
* simplify this code to not bother stripping to canonical types, andChris Lattner2009-04-111-15/+12
| | | | | | indent code properly llvm-svn: 68866
* Compare the predefines buffer in the PCH file with the predefinesDouglas Gregor2009-04-101-16/+0
| | | | | | | | | | | | | | | buffer generated for the current translation unit. If they are different, complain and then ignore the PCH file. This effectively checks for all compilation options that somehow would affect preprocessor state (-D, -U, -include, the dreaded -imacros, etc.). When we do accept the PCH file, throw away the contents of the predefines buffer rather than parsing them, since all of the results of that parsing are already stored in the PCH file. This eliminates the ugliness with the redefinition of __builtin_va_list, among other things. llvm-svn: 68838
* Fix another fallout from defining __weak unconditionally.Fariborz Jahanian2009-04-101-1/+2
| | | | llvm-svn: 68834
* Use getDeclName() instead of getIdentifier() (safe against null pointers)Ted Kremenek2009-04-101-1/+1
| | | | llvm-svn: 68804
* Various minor fixes to PCH reading and writing, with generalDouglas Gregor2009-04-101-0/+10
| | | | | | | cleanup. Aside from a minor tweak to the PCH file format, no functionality change. llvm-svn: 68793
* Implement attribute "analyzer_noreturn" (<rdar://problem/6777003>). This allowsTed Kremenek2009-04-101-5/+19
| | | | | | | clients of the analyzer to designate custom assertion routines as "noreturn" functions from the analyzer's perspective but not the compiler's. llvm-svn: 68746
* Implementation of pre-compiled headers (PCH) based on lazyDouglas Gregor2009-04-092-0/+17
| | | | | | | | | | | | | | | | | | | de-serialization of abstract syntax trees. PCH support serializes the contents of the abstract syntax tree (AST) to a bitstream. When the PCH file is read, declarations are serialized as-needed. For example, a declaration of a variable "x" will be deserialized only when its VarDecl can be found by a client, e.g., based on name lookup for "x" or traversing the entire contents of the owner of "x". This commit provides the framework for serialization and (lazy) deserialization, along with support for variable and typedef declarations (along with several kinds of types). More declarations/types, along with important auxiliary structures (source manager, preprocessor, etc.), will follow. llvm-svn: 68732
* Propagate the ASTContext to various AST traversal and lookup functions.Douglas Gregor2009-04-0914-166/+200
| | | | | | No functionality change (really). llvm-svn: 68726
* Add some FIXMEs for missing checks.Eli Friedman2009-04-091-0/+7
| | | | llvm-svn: 68725
* Fix <rdar://problem/6770998> make cast of super illegal (again:-)Steve Naroff2009-04-081-1/+1
| | | | llvm-svn: 68659
* Sema::CheckConditionalOperands(): Soften pointer/integer mismatch from ↵Steve Naroff2009-04-081-0/+14
| | | | | | | | error->warning. Fixes <rdar://problem/6762239> [sema] gcc incompatibility; error on incompatible operand types in ?:. llvm-svn: 68617
* -Wmissing-prototypes shouldn't complain about main() missing a prototype.Douglas Gregor2009-04-081-1/+2
| | | | | | Fixes <rdar://problem/6759522> llvm-svn: 68611
* Now that we have __weak defined as attribute in all modes,Fariborz Jahanian2009-04-071-1/+2
| | | | | | we must not issue gc-specific errors in non-gc mode. llvm-svn: 68551
* Diagnose uses of function specifiers on declarations which don't declareEli Friedman2009-04-072-12/+26
| | | | | | functions. Fixes PR3941. llvm-svn: 68541
* Fixes method name lookup when method appears inFariborz Jahanian2009-04-072-9/+22
| | | | | | | the base implementations (and not in current implementation). llvm-svn: 68527
* Tweak Sema::ActOnInstanceMessage() to look for a class method when dealing ↵Steve Naroff2009-04-071-0/+3
| | | | | | | | | | | | with qualified id's. This change is motivated by our desire to not support the "Class<foo>" idiom. Note that the change makes perfect sense (since all ObjC classes are also id/instances). This allow us to document a simple migration path...change "Class <foo>" to "id <foo>". This effects: - <rdar://problem/6761939> TASK: File source change radars for "qualified Class" errors - <rdar://problem/6761864> Protocol qualified Class is unsupported llvm-svn: 68517
* Change the type of ObjC @ string constants (from NSConstantString->NSString).Steve Naroff2009-04-071-3/+5
| | | | | | This fixes <rdar://problem/6757102> clang type for @"xxx" is "NSConstantString *" (GCC type is "NSString *"). llvm-svn: 68514
* Warn instead of error on duplicate protocol definitions.Fariborz Jahanian2009-04-061-2/+1
| | | | | | | Be kind to so many projects which are doing this (and be like gcc). llvm-svn: 68474
* Make casting 'super' a deprecated warning (instead of a hard error).Steve Naroff2009-04-061-1/+1
| | | | | | This will simplify clang adoption, and is probably better "etiquette" (since gcc has always accepted this idiom without warning). Once we are over the adoption hurdle, we can turn this into an error. llvm-svn: 68468
* Fixed the Fix-It hints for comparison against a string literal. Thanks, Chris!Douglas Gregor2009-04-062-19/+33
| | | | llvm-svn: 68454
* Fixed visibility issues related to objc2's synthesizedFariborz Jahanian2009-04-061-1/+1
| | | | | | ivars. llvm-svn: 68453
* Daniel convinced me that accepting "const va_list" arguments to va_arg isChris Lattner2009-04-061-10/+1
| | | | | | | a really really bad idea. Now that we emit an error about the unpromoted type, users should be able to understand what is going on. llvm-svn: 68447
* writable property in a category of class's superclassFariborz Jahanian2009-04-061-0/+3
| | | | | | | makes the property writable in the current class. llvm-svn: 68446
* in va_arg diagnostics, print out the unpromoted type. This makes the Chris Lattner2009-04-051-4/+5
| | | | | | | diagnostic use the va_list typedef more often, see the difference in the changed testcase. llvm-svn: 68441
* Add a warning for questionable va_args usage.Chris Lattner2009-04-051-2/+9
| | | | llvm-svn: 68435
* GCC compatibility: gcc allows applying va_args to const Chris Lattner2009-04-051-1/+4
| | | | | | va_lists for some reason. This fixes rdar://6726818 llvm-svn: 68434
* Extend possible handled regparm(N) valueAnton Korobeynikov2009-04-041-1/+1
| | | | llvm-svn: 68424
* Basic support for regparm codegenAnton Korobeynikov2009-04-041-1/+0
| | | | llvm-svn: 68414
* Provide sema proper values of maximal number of arguments passed in registers.Anton Korobeynikov2009-04-031-7/+6
| | | | llvm-svn: 68413
* Real corener case of a method declared in a protocolFariborz Jahanian2009-04-031-2/+9
| | | | | | | | used in a class which declares a property of the same name. This should not result in an unimplemented method warning. llvm-svn: 68409
* improve the string literal comparison warning to not call @encode's "string ↵Chris Lattner2009-04-031-1/+3
| | | | | | literals". llvm-svn: 68407
* Fix up lookup rules for properties declared inFariborz Jahanian2009-04-021-24/+37
| | | | | | objc's continuation class. llvm-svn: 68339
* When calling a function without a prototype for which we have aDouglas Gregor2009-04-021-0/+9
| | | | | | | definition, warn if there are too many/too few function call arguments. llvm-svn: 68318
* Clean up -fixit output slightlyDouglas Gregor2009-04-021-3/+4
| | | | llvm-svn: 68278
* Introduce a "-fixit" mode to clang-cc that applies code-modification hints.Douglas Gregor2009-04-021-1/+1
| | | | llvm-svn: 68268
* Add some more code modification hintsDouglas Gregor2009-04-016-19/+64
| | | | llvm-svn: 68261
* Fix a bug in declaration of property in continuationFariborz Jahanian2009-04-011-14/+14
| | | | | | | class which was exposed by implementation of objc2's nonfragile abi code gen. llvm-svn: 68259
* Make parsing a semantic analysis a little more robust following SemaDouglas Gregor2009-04-016-36/+162
| | | | | | | | | | | | | | | | failures that involve malformed types, e.g., "typename X::foo" where "foo" isn't a type, or "std::vector<void>" that doens't instantiate properly. Similarly, be a bit smarter in our handling of ambiguities that occur in Sema::getTypeName, to eliminate duplicate error messages about ambiguous name lookup. This eliminates two XFAILs in test/SemaCXX, one of which was crying out to us, trying to tell us that we were producing repeated error messages. llvm-svn: 68251
* CodeGenModule::GetAddrOfConstantCFString():Steve Naroff2009-04-011-7/+0
| | | | | | | | | | - Finish up support for converting UTF8->UTF16 to support ObjC @"string" constants. Remove warning from CheckObjCString. As the FIXME in the test case indicates, I still have a bug to work out (apparently with \u handling). llvm-svn: 68245
* Give Type::getDesugaredType a "for-display" mode that can apply moreDouglas Gregor2009-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | heuristics to determine when it's useful to desugar a type for display to the user. Introduce two C++-specific heuristics: - For a qualified type (like "foo::bar"), only produce a new desugred type if desugaring the qualified type ("bar", in this case) produces something interesting. For example, if "foo::bar" refers to a class named "bar", don't desugar. However, if "foo::bar" refers to a typedef of something else, desugar to that something else. This gives some useful desugaring such as "foo::bar (aka 'int')". - Don't desugar class template specialization types like "basic_string<char>" down to their underlying "class basic_string<char, char_traits<char>, allocator<char>>, etc."; it's better just to leave such types alone. Update diagnostics.html with some discussion and examples of type preservation in C++, showing qualified names and class template specialization types. llvm-svn: 68207
* Parsing, semantic analysis, and template instantiation for typenameDouglas Gregor2009-04-013-10/+53
| | | | | | | | | | | | | specifiers that terminate in a simple-template-id, e.g., typename MetaFun::template apply<T1, T2> Also, implement template instantiation for dependent nested-name-specifiers that involve unresolved identifiers, e.g., typename T::type::type llvm-svn: 68166
* Some cleanup and renaming. No functionality changeDouglas Gregor2009-03-311-3/+2
| | | | llvm-svn: 68140
* Implement template instantiation for template names, including bothDouglas Gregor2009-03-312-4/+81
| | | | | | | | | | | template template parameters and dependent template names. For example, the oft-mentioned typename MetaFun::template apply<T1, T2>::type can now be instantiated, with the appropriate name lookup for "apply". llvm-svn: 68128
* Implement -Wmissing-prototypes. Fixes PR3911.Douglas Gregor2009-03-311-0/+22
| | | | llvm-svn: 68110
OpenPOWER on IntegriCloud