Граф коммитов

33444 Коммитов

Автор SHA1 Сообщение Дата
Anna Zaks 5238474707 [analyzer] Fixup for r146793. Add tests for atol and atoll.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146794 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 00:30:16 +00:00
Anna Zaks 9ffbe243cc [analyzer] Add support for taint flowing through a function (atoi).
Check if the input parameters are tainted (or point to tainted data) on
a checkPreStmt<CallExpr>. If the output should be tainted, record it in
the state. On post visit (checkPostStmt<CallExpr>), use the state to
make decisions (in addition to the existing logic). Use this logic for
atoi and fscanf.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146793 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 00:26:34 +00:00
Anna Zaks 777d706547 [analyzer] Minor: Simplify & assert.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146792 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 00:26:29 +00:00
Chad Rosier b8786c4dc4 Fix _mm256_round_pd, _mm256_round_ps, _mm_permute_pd and _mm256_permute_pd AVX
intrinsics to use "I" (ICE) markings.  Fix avxintrin.h to take them into 
account.
Part of rdar://10595450


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146791 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-17 00:15:26 +00:00
Eric Christopher 973bbb6a8a When in a limited debug information situation if we can find the original
declaration for the type then go ahead and use that, it's still smaller
than creating an all new derived type.

Part of rdar://10335756 and others.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146779 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 23:40:18 +00:00
Eric Christopher 435e106f94 Start down the path of getting clang to internally agree on structs versus
classes.

Part of rdar://10520586 and a couple others.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146778 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 23:40:14 +00:00
Nicola Gigante 8a93d27a50 Fix an inconsistency in the syntactic form of InitListExpr in case of initialization that involves a ConstructorConversion
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146766 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 22:57:37 +00:00
Richard Smith a3ca4d6559 Don't allow #include (and its friends #import, #include_next and
#__include_macros) in the arguments of a function-style macro. Directives in the
arguments of such macros have undefined behaviour, and GCC does not correctly
support these cases. In some situations, this can lead to better diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146765 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 22:50:01 +00:00
Douglas Gregor 37f953f021 Add missing header change
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146764 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 22:40:58 +00:00
Douglas Gregor fd002a7027 Make sure we're always setting the previous declaration of an ObjCInterfaceDecl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146763 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 22:37:11 +00:00
Nick Lewycky 7ec59c78f1 Add the value of "suitably aligned" from the C++11 standard to Basic/TargetInfo.
This is equal to alignof(std::max_align_t) on the platform and equal to the
alignment provided by malloc. (Platform owners please double-check your
platform's value.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146762 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 22:34:14 +00:00
Nick Lewycky 9952070fa2 Fix 80-column violation and whitespace. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146761 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 22:32:39 +00:00
Eli Friedman d9ce41e19d Add missing flush call. This is an attempt to fix a broken Windows buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146760 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 22:12:23 +00:00
Richard Smith 1e7fc3d31e Reduce recursion limit on this test further to try to make the msys bot green.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146759 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 21:59:02 +00:00
Chad Rosier b95ddf15e7 Fix vinsertf128_* AVX intrinsics to use "I" (ICE) markings. Fix avxintrin.h to
take them into account.
rdar://10590282


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146758 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 21:40:31 +00:00
Chad Rosier c5cda1121e Fix vperm2f128_* AVX intrinsics to use "I" (ICE) markings. Fix avxintrin.h to
take them into account.
rdar://10576962


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146757 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 21:07:34 +00:00
Richard Smith 80d39bf55f Add a warning flag for ext_embedded_directive. gcc considers this undefined
behaviour to be an error, so it's useful to be able to make it an error in clang
too.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146755 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 20:58:01 +00:00
Richard Smith 25b009a9d2 PR11594: Don't blindly build a UnaryOperator UO_Minus on an expression which
might not be an rvalue when checking array accesses. Instead, pass through a
flag indicating the array index is negated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146753 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 19:31:14 +00:00
Richard Smith 08d6e032a2 C++11 constexpr: Add note stacks containing backtraces if constant evaluation
fails within a call to a constexpr function. Add -fconstexpr-backtrace-limit
argument to driver and frontend, to control the maximum number of notes so
produced (default 10). Fix APValue printing to be able to pretty-print all
APValue types, and move the testing for this functionality from a unittest to
a -verify test now that it's visible in clang's output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146749 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 19:06:07 +00:00
Anna Zaks d3d8548e75 [analyzer] Better stdin support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146748 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 18:28:50 +00:00
Anna Zaks 0e818a412f Fixup to the relaxed diagnostic verification option r146633.
We should exit when matching the '+' even if nothing was found to
prevent searching for all UNIT_MAX items.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146747 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 18:28:45 +00:00
Devang Patel b29b92ae0b Update tests to match r146744.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146745 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 17:56:38 +00:00
Douglas Gregor 8d2dbbf9dd If there is a definition of an ObjCInterfaceDecl, make it the Decl returned from the corresponding ObjCInterfaceType
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146740 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 16:34:57 +00:00
David Blaikie 91ec7894ec Support decltype in pseudo destructors and dependent destructor calls.
Reviewed by Eli Friedman.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146738 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 16:03:09 +00:00
Fariborz Jahanian 6b65d4a9cc objc: after issuing the warning on direct use of __attribute__((NSObject))
on properties, prevent consequential error  diagnostics. // rdar://10591336


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146737 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 15:54:29 +00:00
Douglas Gregor 0af550115d Fix chaining of ObjCInterfaceDecl redeclarations
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146722 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 03:12:41 +00:00
Sean Callanan bd79119a50 Sema::RequireCompleteType currently attempts to
instantiate a class from its template pattern
before it consults the ExternalASTSource.  LLDB
in particular will sometimes provide patterns
that need to be completed first.

To make this possible, I have moved the
completion before the code that does the
instantiation, allowing the ExternalASTSource
to provide the required information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146715 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-16 00:20:31 +00:00
Argyrios Kyrtzidis 99ee085101 In SourceManager::~SourceManager do a sanity check to make sure we
don't try to destruct a null ContentCache.

rdar://10567159

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146707 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 23:37:55 +00:00
Douglas Gregor 7c1f1f1582 When generating debug info for an ObjCInterfaceDecl, try to dig out the definition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146705 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 23:32:29 +00:00
Douglas Gregor 05c272fed8 Move ObjCInterfaceDecl's "EndLoc" into DefinitionData, since it only
applies to an actual definition. Plus, clarify the purpose of this
field and give the accessor a different name, since getLocEnd() is
supposed to be the same as getSourceRange().getEnd().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146694 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 22:34:59 +00:00
Anna Zaks bcb3b981da [analyzer] Address Jordy's comments for r145985.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146683 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 21:33:26 +00:00
Douglas Gregor d63348c338 When name lookup finds a module-private Objective-C class declaration,
check whether any previous declarations of the class were visible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146680 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 20:36:27 +00:00
Douglas Gregor 7723fec9b4 Keep track of all declarations of an Objective-C class (both forward
declarations and definitions) as ObjCInterfaceDecls within the same
redeclaration chain. This new representation matches what we do for
C/C++ variables/functions/classes/templates/etc., and makes it
possible to answer the query "where are all of the declarations of
this class?"



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146679 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 20:29:51 +00:00
Richard Smith 018887209f Refactor and simplify AddInitializerToDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146673 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 19:20:59 +00:00
Chris Lattner d4b66b9403 clarify that clang version number macros are marketing version #'s, not something useful.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146672 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 19:06:36 +00:00
Douglas Gregor 26fec63b14 Extend ObjCInterfaceDecl::DefinitionData to contain a pointer to the
definition, and implement ObjCInterfaceDecl::getDefinition()
efficiently based on that.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146669 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 18:17:27 +00:00
Devang Patel 36370f58d8 Update tests to match r146665.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146668 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 18:03:43 +00:00
Douglas Gregor 53df7a1d34 Introduce the core infrastructure needed to model a complete
redeclaration chain for Objective-C classes, including:
  - Using the first declaration as the canonical declaration.
  - Using the definition as the primary DeclContext
  - Making sure that all declarations have a pointer to the definition
  data, and the definition knows that it is the definition.
  - Serialization support for when a definition gets added to a
  declaration that comes from an AST file.

However, note that we're not taking advantage of much of this code
yet, because we're still re-using ObjCInterfaceDecls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146667 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 18:03:09 +00:00
Douglas Gregor 7ab8ef99e6 "Accidentally" fixed a bug with overloading of functions with
Objective-C objects as parameters in r146659. Add a test for it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146660 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 17:20:18 +00:00
Douglas Gregor dec1cc4ec7 Two null Decl*'s don't refer to the same declaration, because they
don't refer to anything. Amusingly, we were relying on this in one
place. Thanks to Chandler for noticing the weirdness in
declaresSameEntity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146659 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 17:15:07 +00:00
Douglas Gregor 1617947321 Provide a default constructor for ObjCInterfaceDecl::DefinitionData
that value-initializes all of its members for which
default-initialization does not suffice. This should clean up the
failures for compilers that do not implement C++ DR543:

  http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#543

and, therefore, implement very unfortunate semantics for
value-initialization of classes with implicitly-declared, non-trivial
default constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146658 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 16:51:02 +00:00
Hans Wennborg 31b9a984d7 Fix test/Sema/format-strings-scanf.c
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146651 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 11:43:45 +00:00
Hans Wennborg d02deebce5 Support the 'a' length modifier in scanf format strings as a C90
extension.

This fixes gcc.dg/format/c90-scanf-3.c and ext-4.c (test for excess
errors).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146649 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 10:25:47 +00:00
Argyrios Kyrtzidis db7a800e0b [libclang] Give up on using write(); hopefully unbreaks mingw build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146648 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 06:51:30 +00:00
Argyrios Kyrtzidis 53ba95612c Revert r146646 that was a mistake, and make the intended change in the right file.
Log:
[libclang] Try to unbreak mingw build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146647 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 05:53:37 +00:00
Argyrios Kyrtzidis f5a684d774 [libclang] Try to unbreak mingw build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146646 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 05:48:43 +00:00
Douglas Gregor 2e5c15be82 Move the definition-specific data of ObjCInterfaceDecl into a
separately-allocated DefinitionData structure, which we manage the
same way as CXXRecordDecl::DefinitionData. This prepares the way for
making ObjCInterfaceDecls redeclarable, to more accurately model
forward declarations of Objective-C classes and eliminate the mutation
of ObjCInterfaceDecl that causes us serious trouble in the AST reader.

Note that ObjCInterfaceDecl's accessors are fairly robust against
being applied to forward declarations, because Clang (and Sema in
particular) doesn't perform RequireCompleteType/hasDefinition() checks
everywhere it has to. Each of these overly-robust cases is marked with
a FIXME, which we can tackle over time.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146644 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 05:27:12 +00:00
Argyrios Kyrtzidis fa39f5b76b [libclang] Install a fatal error handler that will call abort() instead of exit()
when there is a report_fatal_error() call.

rdar://10507984

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146641 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 04:52:41 +00:00
Eli Friedman 4bf34d19b8 <climits> has UINT_MAX, not <limits>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146638 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 04:24:37 +00:00
Anna Zaks 676bb5ad76 Another fixit for r146633 (to make debian-fnt bot happy), try including limits instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146637 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-15 03:27:51 +00:00