aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2012-01-14constexpr irgen: Add irgen support for APValue::Struct, APValue::Union,Richard Smith
APValue::Array and APValue::MemberPointer. All APValue values can now be emitted as constants. Add new CGCXXABI entry point for emitting an APValue MemberPointer. The other entrypoints dealing with constant member pointers are no longer necessary and will be removed in a later change. Switch codegen from using EvaluateAsRValue/EvaluateAsLValue to VarDecl::evaluateValue. This performs caching and deals with the nasty cases in C++11 where a non-const object's initializer can refer indirectly to previously-initialized fields within the same object. Building the intermediate APValue object incurs a measurable performance hit on pathological testcases with huge initializer lists, so we continue to build IR directly from the Expr nodes for array and record types outside of C++11. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148178 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-14Remember if a type has its visibility set explicitly or implicitly.Rafael Espindola
With that, centralize the way we merge visibility, always preferring explicit over implicit and then picking the most restrictive one. Fixes pr10113 and pr11690. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148163 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-14[libclang] Add CXIndexOpt_IndexFunctionLocalSymbols indexing option to indicateArgyrios Kyrtzidis
that one wants indexing callbacks for function-local symbols as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148160 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-13Move identification of memory setting and copying functions (memset,Anna Zaks
memcmp, strncmp,..) out of Sema and into FunctionDecl so that the logic could be reused in the analyzer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148142 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-13Revert r148138; it's causing test failures.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148141 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-13remove assertions in the Hexagon backend specific clang driverSebastian Pop
Patch from Jyotsna Verma: I have made the changes to remove assertions in the Hexagon backend specific clang driver. Instead of asserting on invalid arch name, it has been modified to use the default value. I have changed the implementation of the CPU flag validation for the Hexagon backend. Earlier, the clang driver performed the check and asserted on invalid inputs. In the new implementation, the driver passes the last CPU flag (or sets to "v4" if not specified) to the compiler (and also to the assembler and linker which perform their own check) instead of asserting on incorrect values. This patch changes the setCPU function for the Hexagon backend in clang/lib/Basic/Targets.cpp which causes the compiler to error out on incorrect CPU flag values. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148139 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-13rename -ccc-host-triple into -targetSebastian Pop
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148138 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-13rename DefaultHostTriple into DefaultTargetTripleSebastian Pop
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148137 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-13PR11754: Reject non-static constexpr member functions in classes with virtualRichard Smith
base classes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148094 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-13A few minor improvements to error recovery trying to access member of a ↵Eli Friedman
function. In particular, this restores the cool error recovery for the example from http://blog.llvm.org/2010/04/amazing-feats-of-clang-error-recovery.html , which regressed a few months back. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148089 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-13Fix up the calls to CorrectTypo in Sema*ObjC.cpp to use callbackKaelyn Uhrain
objects, and add a basic CorrectionCandidateCallback template class to simplify the fixups. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148085 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:Richard Smith
- If the declarator is at the start of a line, and the previous line contained another declarator and ended with a comma, then that comma was probably a typo for a semicolon: int n = 0, m = 1, l = 2, // k = 5; myImportantFunctionCall(); // oops! - If removing the parentheses would correctly initialize the object, then produce a note suggesting that fix. - Otherwise, if there is a simple initializer we can suggest which performs value-initialization, then provide a note suggesting a correction to that initializer. Sema::Declarator now tracks the location of the comma prior to the declarator in the declaration, if there is one, to facilitate providing the note. The code to determine an appropriate initializer from the -Wuninitialized warning has been factored out to allow use in both that and -Wvexing-parse. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148072 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12Revert accidental commit.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148058 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12Make sure adding a field to a struct never reduces its size. PR11745.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148056 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12[analyzer] fix inlining's handling of mapping actual to formal arguments and ↵Ted Kremenek
limit the call stack depth. The analyzer can now accurately simulate factorial for limited depths. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148036 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12scanf: parse the 'm' length modifier, and check that the right argumentsHans Wennborg
are used with that and the 'a' length modifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148029 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12Add IsImplicit field in ObjCMessageExpr that is true when the messageArgyrios Kyrtzidis
was constructed, e.g. for a property access. This allows the selector identifier locations machinery for ObjCMessageExpr to function correctly, in that there are not real locations to handle/report for such a message. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148013 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-12[analyzer] Rename Store::Retrieve() -> getBinding().Anna Zaks
+ all the other Retrieve..() methods + a comment for ElementRegion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148011 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-11Appease -Wnon-virtual-dtorMatt Beaumont-Gay
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147977 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-11Improve the diagnostic when trying to redefine a typedef with aDouglas Gregor
variably-modified type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147973 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-11Add initial callback object support to Sema::CorrectTypo.Kaelyn Uhrain
Also includes two examples of the callback: a wrapper/replacement for the CorrectTypoContext enum, and a conversion of the two calls to CorrectTypo in SemaDeclCXX.cpp (one of which provides verifiable improvement to the typo correction, as demonstrated in the added test). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147962 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-11C11 allows typedefs to be redefined. Implement this in C11 mode, andDouglas Gregor
downgrade the default-error warning to an ExtWarn in C90/99. <rdar://problem/10668057> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147925 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-11Start refactoring code for capturing variables and 'this' so that it is ↵Eli Friedman
shared between lambda expressions and block literals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147917 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-10Add field IsIEEE in FloatingLiteral to distinguish between different 128-bitAkira Hatanaka
floating point formats. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147887 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-10Make PathDiagnosticLocation more resilient to null Stmt pointers.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147854 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-10Per John's comment, it makes sense to ask isLambda on any CXXRecordDecl; ↵Eli Friedman
make sure that's safe. Get rid of a check which is now unnecessary in Sema::getFunctionLevelDeclContext(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147837 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-10Update C++11 scoped enumeration support to match the final proposal:Richard Smith
- reject definitions of enums within friend declarations - require 'enum', not 'enum class', for non-declaring references to scoped enumerations git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147824 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-10objc++: patch for IRgen for atomic properties ofFariborz Jahanian
c++ objects with non-trivial assignment/copy functions. Also, one additional sema check. // rdar://6137845 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147817 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-09Extend the diagnostic for a ',' at the end of a declaration where a ';' wasRichard Smith
intended to cover C++ class definitions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147808 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-09Implement redeclaration merging for namespaces defined in distinctDouglas Gregor
modules. Teach name lookup into namespaces to search in each of the merged DeclContexts as well as the (now-primary) DeclContext. This supports the common case where two different modules put something into the same namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147778 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-09Made unknown builtin diagnostic remappable.Abramo Bagnara
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147774 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07Pack UsingDecl more.Benjamin Kramer
88 -> 80 bytes on x86_64. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147736 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07Fixed TypeofExpr AST and code generation.Abramo Bagnara
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147730 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07Switch NamespaceDecl from its own hand-rolled redeclaration chain overDouglas Gregor
to Redeclarable<NamespaceDecl>, so that we benefit from the improveed redeclaration deserialization and merging logic provided by Redeclarable<T>. Otherwise, no functionality change. As a drive-by fix, collapse the "inline" bit into the low bit of the original namespace/anonymous namespace, saving 8 bytes per NamespaceDecl on x86_64. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147729 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07More lambda work: semantic analysis of capturing 'this'. It's a bit ↵Eli Friedman
complicated, but we have to be careful about when exactly captures are marked given PotentiallyPotentiallyEvaluated contexts. (Actually, it's not 100% correct yet, but it's close enough for the moment.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147723 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07[analyzer] Add basic format string vulnerability checking.Anna Zaks
We already have a more conservative check in the compiler (if the format string is not a literal, we warn). Still adding it here for completeness and since this check is stronger - only triggered if the format string is tainted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147714 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07Lambdas: semantic analysis of explicit captures.Eli Friedman
This patch (and some of my other commits related to lambdas) is heavily based off of John Freeman's work-in-progress patches. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147706 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07[analyzer] Remove CallEnterNodeBuilder and simplify ↵Ted Kremenek
ExprEngine::processCallEnter(). This removes analysis of other translation units, but that was an experimental feature anyway that we will revisit later. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147705 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-07[analyzer] Remove CallExitNodeBuilder, and have ↵Ted Kremenek
ExprEngine::processCallExit() do the work manually. This is a nice simplification. Along the way, fix Exprengine::processCallExit() to also perform the postStmt callback for checkers for CallExprs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147697 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06Suppress -Wunused-value within macros from system headers.Matt Beaumont-Gay
Along the way, move a helper function from SemaChecking.cpp to a more accessible home in SourceManager. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147692 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06[analyzer] Make the entries in 'Environment' context-sensitive by making ↵Ted Kremenek
entries map from (Stmt*,LocationContext*) pairs to SVals instead of Stmt* to SVals. This is needed to support basic IPA via inlining. Without this, we cannot tell if a Stmt* binding is part of the current analysis scope (StackFrameContext) or part of a parent context. This change introduces an uglification of the use of getSVal(), and thus takes two steps forward and one step back. There are also potential performance implications of enlarging the Environment. Both can be addressed going forward by refactoring the APIs and optimizing the internal representation of Environment. This patch mainly introduces the functionality upon when we want to build upon (and clean up). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147688 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06Stash Decl's TopLevelDeclInObjCContainer and ModulePrivate bitsDouglas Gregor
into the two unused lower bits of the NextDeclInContext link, dropping the number of bits in Decl down to 32, and saving 8 bytes per declaration on x86-64. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147660 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06C++11 generalized constant expressions: implement checking and diagnostics forRichard Smith
pointer-arithmetic-related undefined behavior and unspecified results. We continue to fold such values, but now notice they aren't constant expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147659 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06Introduce a "Hidden" bit into Decl, to track whether that declarationDouglas Gregor
is hidden from name lookup. The previous hack of tweaking the ModulePrivate bit when loading a declaration from a hidden submodule was brittle. Note that we now have 34 bits in Decl. I'll fix that next. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147658 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06More lambda work. Fixes a minor bug Richard pointed out, makes lookup for ↵Eli Friedman
lambda parameters work correctly, recording more information into the AST. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147650 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-06Tweak to r147599 for PR10828: Move the check from the parser into sema, and useRichard Smith
the Semantic Powers to only warn on class types (or dependent types), where the constructor or destructor could do something interesting. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147642 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-05After further discussion, rename attribute ↵Ted Kremenek
'objc_disable_automatic_synthesis' to 'objc_requires_property_definitions'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147622 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-05Tweak the fix to PR8977: an empty expression-list represents value ↵Eli Friedman
initialization, not default initialization. Fixes PR11712. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147620 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-05Don't seed the ASTWriter's declaration -> ID mapping with the IDs ofDouglas Gregor
each deserialized declaration, since that information is already available in each declaration. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147619 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-05When we deserialize a declaration from a module file, allocate extraDouglas Gregor
storage for the global declaration ID. Declarations that are parsed (rather than deserialized) are unaffected, so the number of declarations that pay this cost tends to be relatively small (since relatively few declarations are ever deserialized). This replaces a largish DenseMap within the AST reader. It's not strictly a win in terms of memory use---not every declaration was added to that DenseMap in the first place---but it's cleaner to have this information available for every deserialized declaration, so that future clients can rely on it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147617 91177308-0d34-0410-b5e6-96231b3b80d8