aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
AgeCommit message (Collapse)Author
2009-08-02Use the correct cast kind for dynamic_cast.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77905 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-01More warnings for unused expressions.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77763 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31Remove a redundant getCanonicalType callDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77702 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31PR3679 - enable #pragma weak aliasing.Ryan Flynn
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77660 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31Rename Action::TagKind to Action::TagUseKind, which removes both a misnomerJohn McCall
and a name collision. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77658 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31Make the check for the linkage of a template handle the case of nested Eli Friedman
linkage specifications correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77653 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31Add CK_DerivedToBase and use it PerformObjectMemberConversion.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31Add a CastKind enum to CastExpr. Right now it's not used for much but it ↵Anders Carlsson
will be :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77650 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30Diagnose unused expression results for all statements, just not compound ↵Anders Carlsson
statements. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77631 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30Factor code out into a DiagnoseUnusedExprResult function.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77628 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30What luck! Clang obtains support for refering to members of theDouglas Gregor
current instantiation when that current instantiation is a class template partial specialization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77609 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30Support out-of-line definitions of the members of class templateDouglas Gregor
partial specializations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77606 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-30PR3679 - handle #pragma weakRyan Flynn
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77573 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Change uses of:Ted Kremenek
Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsRecordType() -> Type::getAs<RecordType>() Type::getAsPointerType() -> Type::getAs<PointerType>() Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>() Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>() Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>() Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>() Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsTagType() -> Type::getAs<TagType>() And remove Type::getAsReferenceType(), etc. This change is similar to one I made a couple weeks ago, but that was partly reverted pending some additional design discussion. With Doug's pending smart pointer changes for Types, it seemed natural to take this approach. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77510 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Some refactoring of member access forFariborz Jahanian
performace sake. Also added a test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77502 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Refactor base/member initializers, and construct them correctly in cases Eli Friedman
with dependent types. Fixes PR4621 and PR4627. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77498 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Check accessibility when converting object to the baseFariborz Jahanian
class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77497 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Patch to provide cast of objects in member accessFariborz Jahanian
excpression, if needed, and remove some ir-gen code now unnencessary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77490 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29[llvm up]Douglas Gregor
A template name can refer to a set of overloaded function templates. Model this in TemplateName, which can now refer to an OverloadedFunctionDecl that contains function templates. This removes an unspeakable hack in Sema::isTemplateName. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77488 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Check for identical types in C++ catch expression. Patch by Erik Verbruggen.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77475 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29When lookup of an identifier preceding a '<' finds a set of overloadedDouglas Gregor
functions, only return those overloaded functions that are actually function templates. Note that there is still a glaring problem with treating an OverloadedFunctionDecl as a TemplateName. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77472 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Remove an obsolete kludge based on the previous, completely broken handling ↵Douglas Gregor
of function templates git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77464 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Use the new statement/expression profiling code to unique dependentDouglas Gregor
template arguments, as in template specialization types. This permits matching out-of-line definitions of members for class templates that involve non-type template parameters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77462 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Fix <rdar://problem/7100524> regression: "error: incompatible operand types ↵Steve Naroff
('void *' and 'NSString *')". Remove XFAIL from 'conditional-expr-4.m' test case (which would have caught this). Also tweaked several aspects of the test to jive with the current type checking. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77453 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Incorporate feedback from Chris (on r76979).Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77452 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29Make functional-style casts emit correct messages, and fix a crash-on-invalid.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77451 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29BlockScopeInfo::hasPrototype was uninitialized.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28Some minor cleanups, thanks Chris.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77402 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28Add support for -Wmissing-noreturn.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77391 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28Refactor the code that produces a TemplateSpecializationType, so thatDouglas Gregor
canonicalization for dependent TemplateSpecializationTypes occurs within ASTContext::getTemplateSpecializationType. Also, move template argument canonicalization into ASTContext::getCanonicalTemplateArgument. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77388 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28Add noreturn support for blocks.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77377 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28Bounds checking for address spaces.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77303 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28Make longjmp a real builtin.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77291 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28Allow functions to be marked "implicit return zero" and so mark main().John McCall
Codegen by initializing the return value with its LLVM type's null value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77288 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28Make sure to move the comment with the code.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77279 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27Add knowledge about _longjmp being noreturn.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77254 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27Add builtin knowledge about longjmp being noreturn. Add printing forMike Stump
the noreturn attribute. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77253 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27Add noreturn for exit.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77237 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27Make ObjCImplDecl inherit from ObjCContainerDecl.Argyrios Kyrtzidis
ObjCContainerDecl now is the root class for objc decls that contain methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27When instantiating a variable without an initializer, callDouglas Gregor
ActOnUninitializedDecl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77211 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25PR3575 - warn on declared variable or function attributes after a ↵Ryan Flynn
definition, which are currently ignored. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25Add noreturn as a type attribute, handle printing for them and handleMike Stump
calls to noreturn function pointers when CFG building. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77089 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25Implement C++ semantics for C-style and functional-style casts. This ↵Sebastian Redl
regresses Clang extension conversions, like vectors, but allows conversions via constructors and conversion operators. Add custom conversions to static_cast. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77076 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25Semantic checking for main().John McCall
Fix some invalid main() methods in the test suite that were nicely exposed by the new checks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77047 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24Template instantiation for static data members that are defined out-of-line.Douglas Gregor
Note that this also fixes a bug that affects non-template code, where we were not treating out-of-line static data members are "file-scope" variables, and therefore not checking their initializers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77002 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24More Sema check for constructor's member initializer along Fariborz Jahanian
with type conversion to fix ir-gen crash. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77000 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24Fix 80-col violations, reflow a few comments and zap some extraMike Stump
whitespace at ends of lines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76992 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24Allow front-end 'isa' access on object's of type 'id'.Steve Naroff
Enhance test case to cover 'isa' access on interface types (clang produces an error, GCC produces a warning). Still need back-end CodeGen for ObjCIsaExpr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76979 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24Test commit: make a little stub routine for semantic checking of main().John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24Implement new warning for functions declared 'noreturn' when they fall off ↵Mike Stump
the end. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76932 91177308-0d34-0410-b5e6-96231b3b80d8