aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2011-08-04Specialize diag::warn_unused_call for the "warn_unused_result" attribute, soMatt Beaumont-Gay
it can be controlled with a distinct flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136941 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04Fix assertion failure in -Wuninitialized involving no-op casts. Fixes PR 10577.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136939 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04KeychainAPI checker: Track additional pair of SecKeychain APIs. Also, keep ↵Anna Zaks
exploring the transition on which a call to allocator function failed (to be able to find errors in examples like ErrorCodesFromDifferentAPISDoNotInterfere). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136930 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04Whitespace.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136929 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04objective-c: diagnose protocol inconsistencies in following Fariborz Jahanian
situation. When a class explicitly or implicitly (through inheritance) "conformsTo" two protocols which conflict (have methods which conflict). This is 2nd part of // rdar://6191214. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136927 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04Add a new libclang API to return a CXCompletionString for an arbitraryDouglas Gregor
cursor, from Connor Wakamo! Addresses <rdar://problem/9087798>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136911 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04Fix style and remove obviously redundant code.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136907 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04Clean up the debug dump for a Module, so the local->global maps areDouglas Gregor
clearly called out, and add the missing local -> global selector map output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136903 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04Introduce local -> global mapping for preprocessed entity IDs. This isDouglas Gregor
the last of the ID/offset/index mappings that I know of. Unfortunately, the "gap" method of testing doesn't work here due to the way the preprocessing record performs iteration. We'll do more testing once multi-AST loading is possible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136902 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04Remove the unset, unused return value ofDouglas Gregor
ASTReader::ReadMacroRecord(). No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136893 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04Additional comments and whitespace.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136892 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04Match type names and give more info for out-of-line function definition errors.Kaelyn Uhrain
Having a function declaration and definition with different types for a parameter where the types have same (textual) name can occur when an unqualified type name resolves to types in different namespaces in each location. The error messages have been extended by adding notes that point to the first parameter of the function definition that doesn't match the declaration, instead of a generic "member declaration nearly matches". The generic message is still used in cases where the mismatch is not in the paramenter list, such as mismatched cv qualifiers on the member function itself. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136891 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04KeychainAPI checker: Refactor to make it easier to add more ↵Anna Zaks
allocator/deallocator API pairs. Add the allocator function ID to the checker state. Better comments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136889 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04In the AST reader and writer, slide the preprocessed entity IDs by +1Douglas Gregor
so that we use ID zero as a sentinel for "no result". This matches the convention set by all of the other global IDs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136885 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04Add some missing record names to the AST output. No functionality change, ↵Douglas Gregor
but llvm-bcanalyzer will be a little more informative now for AST files git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136883 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04Implement the local -> global remapping for macro definition IDs inDouglas Gregor
the detailed preprocessing record. Tested with the standard "gaps" method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136882 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04The AST reader was forgetting to parse ObjCInferRelatedReturnTypeDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136879 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04Parsing of C++0x lambda expressions, from John Freeman with help fromDouglas Gregor
David Blaikie! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136876 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04Add partial support for using anonymous bitfields (e.g., int : 0) to enforce Chad Rosier
alignment. This fixes cases where the anonymous bitfield is followed by a non-bitfield member. E.g., struct t4 { int foo : 1; long : 0; char bar; }; Part of rdar://9859156 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136858 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04Emit wide string literals with the appropriate alignment.John McCall
Patch by Craig Topper and Sundeep! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136856 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04KeychainAPI checker: refactor to use early exit.Anna Zaks
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136852 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04KeychainAPI checker: Add basic diagnostics. Track MemoryRegion istead of ↵Anna Zaks
SymbolicRef since the address might not be a symbolic value in some cases, for example in fooOnlyFree() test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136851 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04[analyzer] Remove 'all-experimental' checker group.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136849 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04Don't introduce a local -> global mapping for CXXBaseSpecifiers. TheDouglas Gregor
IDs will never cross module boundaries, since they're tied to the CXXDefinitionData, so just use a local mapping throughout. Eliminate the global -> local tables and supporting data. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136847 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03Refactoring of my last patch.Fariborz Jahanian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136841 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03Introduce local -> global selector ID mapping into the ASTDouglas Gregor
reader. Tested with the usual "gaps" method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136839 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03[analyzer] rename all experimental checker packages to have 'experimental' ↵Ted Kremenek
be the common root package. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136835 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03Use the general conditional-cleanup framework instead of rolling ourJohn McCall
own, incorrectly, for releasing objects at the end of a full-expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136823 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03Introduce a local-to-global remapping for identifiers in the ASTDouglas Gregor
reader, and fix up the one (!) place where we were improperly mapping a local ID to a global ID. Tested via the usual "gaps" trick. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136817 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03Improve overloaded function handling in the typo correction code.Kaelyn Uhrain
Change TypoCorrection to store a set of NamedDecls instead of a single NamedDecl. Also add initial support for performing function overload resolution to Sema::DiagnoseEmptyLookup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136807 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03[analyzer] Introduce MallocOverflowSecurityChecker, a simple flow-sensitive ↵Ted Kremenek
checker that may be useful for security auditing. This checker is currently too noisy to be on by default. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136804 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03objective-c: Methods declared in methods must type matchFariborz Jahanian
those declated in its protocols. First half or // rdar://6191214 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136794 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03Fix a few typosJonathan D. Turner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136792 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03Comment the weird behavior of __has_feature(is_empty) and __has_feature(is_pod)Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136788 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03Make the type of the IntegerLiteral for bitfield paddings an actualDouglas Gregor
integer, and initialise its TypeSourceInfo. The initialisation fixes a crash when using pre-compiled preambles with C++ code-completion. From Erik Verbruggen! Fixes PR10511. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136786 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03Introduce a constant for the number of predefined declarations in anDouglas Gregor
AST file, along with an enumeration naming those predefined declarations. No functionality change, but this will make it easier to introduce new predefined declarations, when/if we need them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136781 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03Introduce the local -> global declaration ID mapping into the ASTDouglas Gregor
reader, to allow AST files to be loaded with their declarations remapped to different ID numbers. Fix a number of places where we were either failing to map local declaration IDs into global declaration IDs or where interpreting the local declaration IDs within the wrong module. I've tested this via the usual "random gaps" method. It works well except for the preamble tests, because our handling of the precompiled preamble requires declaration and preprocessed entity to be stable when parsing code and then loading that back into memory. This property will hold in general, but my randomized testing naturally breaks this property to get more coverage. In the future, I expect that the precompiled preamble logic won't need this property. I am very unhappy with the current handling of the translation unit, which is a rather egregious hack. We're going to have to do something very different here for loading multiple AST files, because we don't want to have to cope with merging two translation units. Likely, we'll just handle translation units entirely via "update" records, and predefine a single, fixed declaration ID for the translation unit. That will come later. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136779 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03In ARC, don't try to reclaim the result of a call to performSelectorJohn McCall
unless done in a context where the value is used retained. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136769 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03Handle "homogeneous aggregates" as required by the ARM AAPCS-VFP ABI.Bob Wilson
A homogeneous aggregate is an aggregate data structure where after flattening any nesting there are 1 to 4 elements of the same base type that is either a float, double, or Neon vector. All Neon vectors of the same size, either 64 or 128 bits, are treated as equivalent for this purpose. When using the AAPCS-VFP ABI, check for homogeneous aggregates and pass them as arguments by expanding them into a sequence of their base types. This requires extending the existing support for expanded arguments to handle not only structs, but also constant arrays and complex types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136767 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03Static Analyzer diagnostics visualization: when the last location on a path ↵Anna Zaks
is end of the function, the arrow should point to the closing brace, not the statement before it. Patch by Ted Kremenek. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136761 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03When rewriting a call to a K&R function to lead to a well-prototypedJohn McCall
function, be sure to drop parameter attributes when dropping their associated arguments. Patch by Aaron Landwehr! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136753 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-03A couple fixes for preprocessor expressions:Eli Friedman
1. Be more tolerant of comments in -CC (comment-preserving) mode. We were missing a few cases. 2. Make sure to expand the second FOO in "#if defined FOO FOO". (See also r97253, which addressed the case of "#if defined(FOO FOO".) Fixes PR10286. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136748 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-02Implements alignment for long long and double types in va_arg on ARM AAPCS.Rafael Espindola
Patch by Jim (Ningjie) Chen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136734 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-02Update for LLVM change in PassManagerBuilder.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136728 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-02disable array bounds overflow warning for cases where an array Chris Lattner
has a single element. This disables the warning in cases where there is a clear bug, but this is really rare (who uses arrays with one element?) and it also silences a large class of false positive issues with C89 code that is using tail padding in structs. A better version of this patch would detect when an array is in a tail position in a struct, but at least patch fixes the huge false positives that are hitting postgres and other code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136724 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-02Fix cmake for r136702 (at least for the most part). Chandler has been kind Chad Rosier
enough to offer to investigate the underlying issue. Thanks to Doug for his assistance as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136719 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-02objective-c rewrite: Fixes rewriting of objective-c collectionFariborz Jahanian
statement inside a block. // rdar://9878420 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136717 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-02Temporarily revert parts of r136702 to make cmake builds happy.Chad Rosier
Someone with more cmake experience want to throw me a bone? :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136709 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-02Change the hashing function for DeclContext lookup within an AST fileDouglas Gregor
by eliminating the type ID from constructor, destructor, and conversion function names. There are several reasons for this change: - A given type (say, int*) isn't guaranteed to have a single, unique type ID within a chain of PCH files. Hence, we could end up hashing based on the wrong type ID, causing name lookup to fail. - The mapping from types back to type IDs required one DenseMap entry for every type that was ever deserialized, which was an unacceptable cost to support just the name lookup of constructors, destructors, and conversion functions. Plus, this mapping could never actually work with chained or multiple PCH, based on the first bullet. Once we have eliminated the type from the hash function, these problems go away, as does my horrible "reverse type remap" hack, which was doomed from the start (see bullet #1 above) and far too complicated. However, note that removing the type from the hash function means that all constructors, destructors, and conversion functions have the same hash key, so I've updated the caller to double-check that the declarations found have the appropriate name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136708 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-02[analyzer] Drastically simplify ExprEngine::VisitInitListExpr() by assuming ↵Ted Kremenek
all initializer expressions have already been evaluated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136706 91177308-0d34-0410-b5e6-96231b3b80d8