]> granicus.if.org Git - clang/log
clang
12 years ago[analyzer] Fixup for r146793. Add tests for atol and atoll.
Anna Zaks [Sat, 17 Dec 2011 00:30:16 +0000 (00:30 +0000)]
[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

12 years ago[analyzer] Add support for taint flowing through a function (atoi).
Anna Zaks [Sat, 17 Dec 2011 00:26:34 +0000 (00:26 +0000)]
[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

12 years ago[analyzer] Minor: Simplify & assert.
Anna Zaks [Sat, 17 Dec 2011 00:26:29 +0000 (00:26 +0000)]
[analyzer] Minor: Simplify & assert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146792 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix _mm256_round_pd, _mm256_round_ps, _mm_permute_pd and _mm256_permute_pd AVX
Chad Rosier [Sat, 17 Dec 2011 00:15:26 +0000 (00:15 +0000)]
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

12 years agoWhen in a limited debug information situation if we can find the original
Eric Christopher [Fri, 16 Dec 2011 23:40:18 +0000 (23:40 +0000)]
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

12 years agoStart down the path of getting clang to internally agree on structs versus
Eric Christopher [Fri, 16 Dec 2011 23:40:14 +0000 (23:40 +0000)]
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

12 years agoFix an inconsistency in the syntactic form of InitListExpr in case of initialization...
Nicola Gigante [Fri, 16 Dec 2011 22:57:37 +0000 (22:57 +0000)]
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

12 years agoDon't allow #include (and its friends #import, #include_next and
Richard Smith [Fri, 16 Dec 2011 22:50:01 +0000 (22:50 +0000)]
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

12 years agoAdd missing header change
Douglas Gregor [Fri, 16 Dec 2011 22:40:58 +0000 (22:40 +0000)]
Add missing header change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146764 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake sure we're always setting the previous declaration of an ObjCInterfaceDecl
Douglas Gregor [Fri, 16 Dec 2011 22:37:11 +0000 (22:37 +0000)]
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

12 years agoAdd the value of "suitably aligned" from the C++11 standard to Basic/TargetInfo.
Nick Lewycky [Fri, 16 Dec 2011 22:34:14 +0000 (22:34 +0000)]
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

12 years agoFix 80-column violation and whitespace. No functionality change.
Nick Lewycky [Fri, 16 Dec 2011 22:32:39 +0000 (22:32 +0000)]
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

12 years agoAdd missing flush call. This is an attempt to fix a broken Windows buildbot.
Eli Friedman [Fri, 16 Dec 2011 22:12:23 +0000 (22:12 +0000)]
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

12 years agoReduce recursion limit on this test further to try to make the msys bot green.
Richard Smith [Fri, 16 Dec 2011 21:59:02 +0000 (21:59 +0000)]
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

12 years agoFix vinsertf128_* AVX intrinsics to use "I" (ICE) markings. Fix avxintrin.h to
Chad Rosier [Fri, 16 Dec 2011 21:40:31 +0000 (21:40 +0000)]
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

12 years agoFix vperm2f128_* AVX intrinsics to use "I" (ICE) markings. Fix avxintrin.h to
Chad Rosier [Fri, 16 Dec 2011 21:07:34 +0000 (21:07 +0000)]
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

12 years agoAdd a warning flag for ext_embedded_directive. gcc considers this undefined
Richard Smith [Fri, 16 Dec 2011 20:58:01 +0000 (20:58 +0000)]
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

12 years agoPR11594: Don't blindly build a UnaryOperator UO_Minus on an expression which
Richard Smith [Fri, 16 Dec 2011 19:31:14 +0000 (19:31 +0000)]
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

12 years agoC++11 constexpr: Add note stacks containing backtraces if constant evaluation
Richard Smith [Fri, 16 Dec 2011 19:06:07 +0000 (19:06 +0000)]
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

12 years ago[analyzer] Better stdin support.
Anna Zaks [Fri, 16 Dec 2011 18:28:50 +0000 (18:28 +0000)]
[analyzer] Better stdin support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146748 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixup to the relaxed diagnostic verification option r146633.
Anna Zaks [Fri, 16 Dec 2011 18:28:45 +0000 (18:28 +0000)]
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

12 years agoUpdate tests to match r146744.
Devang Patel [Fri, 16 Dec 2011 17:56:38 +0000 (17:56 +0000)]
Update tests to match r146744.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146745 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIf there is a definition of an ObjCInterfaceDecl, make it the Decl returned from...
Douglas Gregor [Fri, 16 Dec 2011 16:34:57 +0000 (16:34 +0000)]
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

12 years agoSupport decltype in pseudo destructors and dependent destructor calls.
David Blaikie [Fri, 16 Dec 2011 16:03:09 +0000 (16:03 +0000)]
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

12 years agoobjc: after issuing the warning on direct use of __attribute__((NSObject))
Fariborz Jahanian [Fri, 16 Dec 2011 15:54:29 +0000 (15:54 +0000)]
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

12 years agoFix chaining of ObjCInterfaceDecl redeclarations
Douglas Gregor [Fri, 16 Dec 2011 03:12:41 +0000 (03:12 +0000)]
Fix chaining of ObjCInterfaceDecl redeclarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146722 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSema::RequireCompleteType currently attempts to
Sean Callanan [Fri, 16 Dec 2011 00:20:31 +0000 (00:20 +0000)]
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

12 years agoIn SourceManager::~SourceManager do a sanity check to make sure we
Argyrios Kyrtzidis [Thu, 15 Dec 2011 23:37:55 +0000 (23:37 +0000)]
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

12 years agoWhen generating debug info for an ObjCInterfaceDecl, try to dig out the definition.
Douglas Gregor [Thu, 15 Dec 2011 23:32:29 +0000 (23:32 +0000)]
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

12 years agoMove ObjCInterfaceDecl's "EndLoc" into DefinitionData, since it only
Douglas Gregor [Thu, 15 Dec 2011 22:34:59 +0000 (22:34 +0000)]
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

12 years ago[analyzer] Address Jordy's comments for r145985.
Anna Zaks [Thu, 15 Dec 2011 21:33:26 +0000 (21:33 +0000)]
[analyzer] Address Jordy's comments for r145985.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146683 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen name lookup finds a module-private Objective-C class declaration,
Douglas Gregor [Thu, 15 Dec 2011 20:36:27 +0000 (20:36 +0000)]
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

12 years agoKeep track of all declarations of an Objective-C class (both forward
Douglas Gregor [Thu, 15 Dec 2011 20:29:51 +0000 (20:29 +0000)]
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

12 years agoRefactor and simplify AddInitializerToDecl.
Richard Smith [Thu, 15 Dec 2011 19:20:59 +0000 (19:20 +0000)]
Refactor and simplify AddInitializerToDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146673 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoclarify that clang version number macros are marketing version #'s, not something...
Chris Lattner [Thu, 15 Dec 2011 19:06:36 +0000 (19:06 +0000)]
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

12 years agoExtend ObjCInterfaceDecl::DefinitionData to contain a pointer to the
Douglas Gregor [Thu, 15 Dec 2011 18:17:27 +0000 (18:17 +0000)]
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

12 years agoUpdate tests to match r146665.
Devang Patel [Thu, 15 Dec 2011 18:03:43 +0000 (18:03 +0000)]
Update tests to match r146665.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146668 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIntroduce the core infrastructure needed to model a complete
Douglas Gregor [Thu, 15 Dec 2011 18:03:09 +0000 (18:03 +0000)]
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

12 years ago"Accidentally" fixed a bug with overloading of functions with
Douglas Gregor [Thu, 15 Dec 2011 17:20:18 +0000 (17:20 +0000)]
"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

12 years agoTwo null Decl*'s don't refer to the same declaration, because they
Douglas Gregor [Thu, 15 Dec 2011 17:15:07 +0000 (17:15 +0000)]
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

12 years agoProvide a default constructor for ObjCInterfaceDecl::DefinitionData
Douglas Gregor [Thu, 15 Dec 2011 16:51:02 +0000 (16:51 +0000)]
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

12 years agoFix test/Sema/format-strings-scanf.c
Hans Wennborg [Thu, 15 Dec 2011 11:43:45 +0000 (11:43 +0000)]
Fix test/Sema/format-strings-scanf.c

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146651 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSupport the 'a' length modifier in scanf format strings as a C90
Hans Wennborg [Thu, 15 Dec 2011 10:25:47 +0000 (10:25 +0000)]
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

12 years ago[libclang] Give up on using write(); hopefully unbreaks mingw build.
Argyrios Kyrtzidis [Thu, 15 Dec 2011 06:51:30 +0000 (06:51 +0000)]
[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

12 years agoRevert r146646 that was a mistake, and make the intended change in the right file.
Argyrios Kyrtzidis [Thu, 15 Dec 2011 05:53:37 +0000 (05:53 +0000)]
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

12 years ago[libclang] Try to unbreak mingw build.
Argyrios Kyrtzidis [Thu, 15 Dec 2011 05:48:43 +0000 (05:48 +0000)]
[libclang] Try to unbreak mingw build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146646 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove the definition-specific data of ObjCInterfaceDecl into a
Douglas Gregor [Thu, 15 Dec 2011 05:27:12 +0000 (05:27 +0000)]
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

12 years ago[libclang] Install a fatal error handler that will call abort() instead of exit()
Argyrios Kyrtzidis [Thu, 15 Dec 2011 04:52:41 +0000 (04:52 +0000)]
[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

12 years ago<climits> has UINT_MAX, not <limits>.
Eli Friedman [Thu, 15 Dec 2011 04:24:37 +0000 (04:24 +0000)]
<climits> has UINT_MAX, not <limits>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146638 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAnother fixit for r146633 (to make debian-fnt bot happy), try including limits instead.
Anna Zaks [Thu, 15 Dec 2011 03:27:51 +0000 (03:27 +0000)]
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

12 years agoFixit for r146633. Make sure UINT_MAX is defined on all platforms.
Anna Zaks [Thu, 15 Dec 2011 02:58:00 +0000 (02:58 +0000)]
Fixit for r146633. Make sure UINT_MAX is defined on all platforms.

(Attempt to turn debian-fnt buildbot back to green.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146635 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEnhance the -Wsign-compare handling to suppress the -Wsign-compare warning in the...
Eli Friedman [Thu, 15 Dec 2011 02:41:52 +0000 (02:41 +0000)]
Enhance the -Wsign-compare handling to suppress the -Wsign-compare warning in the case of a shifted bitfield.  PR11572.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146634 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd support for matching one or more (aka regex +) diagnostic messages with -verify.
Anna Zaks [Thu, 15 Dec 2011 02:28:16 +0000 (02:28 +0000)]
Add support for matching one or more (aka regex +) diagnostic messages with -verify.

Ex:
// expected-warning + {{tainted}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146633 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agogcov-style profiling support for OpenBSD. Patch by Jonathan Gray.
Eli Friedman [Thu, 15 Dec 2011 02:15:56 +0000 (02:15 +0000)]
gcov-style profiling support for OpenBSD.  Patch by Jonathan Gray.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146631 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Ensure that the order in which checker callbacks are called
Anna Zaks [Thu, 15 Dec 2011 01:36:04 +0000 (01:36 +0000)]
[analyzer] Ensure that the order in which checker callbacks are called
is deterministic.

Non-determinism was the reason for the test which caused the earlier
buildbot failures, so re-enable the test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146628 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjc: do not auto synthesize properties declared in
Fariborz Jahanian [Thu, 15 Dec 2011 01:03:18 +0000 (01:03 +0000)]
objc: do not auto synthesize properties declared in
protocols; with a warning. // rdar://10567333

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146626 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIn debugger support mode, if we have a top-level message send
Douglas Gregor [Thu, 15 Dec 2011 00:53:32 +0000 (00:53 +0000)]
In debugger support mode, if we have a top-level message send
expression with an unknown result type, assume that the result type is
'id'. Fixes <rdar://problem/10400663>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146622 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoModify how the -verify flag works. Currently, the verification string and
Richard Trieu [Thu, 15 Dec 2011 00:38:15 +0000 (00:38 +0000)]
Modify how the -verify flag works.  Currently, the verification string and
diagnostic message are compared.  If either is a substring of the other, then
no error is given.  This gives rise to an unexpected case:

  // expect-error{{candidate function has different number of parameters}}

will match the following error messages from Clang:

  candidate function has different number of parameters (expected 1 but has 2)
  candidate function has different number of parameters

It will also match these other error messages:

  candidate function
  function has different number of parameters
  number of parameters

This patch will change so that the verification string must be a substring of
the diagnostic message before accepting.  Also, all the failing tests from this
change have been corrected.  Some stats from this cleanup:

87 - removed extra spaces around verification strings
70 - wording updates to diagnostics
40 - extra leading or trailing characters (typos, unmatched parens or quotes)
35 - diagnostic level was included (error:, warning:, or note:)
18 - flag name put in the warning (-Wprotocol)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146619 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReplace all comparisons between ObjCInterfaceDecl pointers with calls
Douglas Gregor [Thu, 15 Dec 2011 00:29:59 +0000 (00:29 +0000)]
Replace all comparisons between ObjCInterfaceDecl pointers with calls
to declaresSameEntity(), as a baby step toward tracking forward
declarations of Objective-C classes precisely. Part of
<rdar://problem/10583531>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146618 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] Indexing API: provide an attribute list inside CXIdxEntityInfo
Argyrios Kyrtzidis [Thu, 15 Dec 2011 00:05:00 +0000 (00:05 +0000)]
[libclang] Indexing API: provide an attribute list inside CXIdxEntityInfo
so that we can access the attributes of an entity for a reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146616 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] Suppress indexing references for occurrences of the interface
Argyrios Kyrtzidis [Thu, 15 Dec 2011 00:04:56 +0000 (00:04 +0000)]
[libclang] Suppress indexing references for occurrences of the interface
in a superclass and the protocols in a protocol list.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146615 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReplace Decl::isSameEntityAs with a free function declaresSameEntity, which can cope...
Douglas Gregor [Wed, 14 Dec 2011 23:59:32 +0000 (23:59 +0000)]
Replace Decl::isSameEntityAs with a free function declaresSameEntity, which can cope with NULL pointer values

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146613 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoProduce more detailed diagnostics when static_assert condition is not an ICE.
Richard Smith [Wed, 14 Dec 2011 23:32:26 +0000 (23:32 +0000)]
Produce more detailed diagnostics when static_assert condition is not an ICE.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146607 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoHalve the constexpr recursion depth in this test in an attempt to make the
Richard Smith [Wed, 14 Dec 2011 21:55:23 +0000 (21:55 +0000)]
Halve the constexpr recursion depth in this test in an attempt to make the
freebsd bots happy. In the longer term, we should have a mechanism for moving
constexpr recursion off the call stack, to support the default limit of 512
suggested by the standard.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146596 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix typos.
Rafael Espindola [Wed, 14 Dec 2011 21:50:24 +0000 (21:50 +0000)]
Fix typos.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146595 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIntroduce Decl::isSameEntityAs(), to help compare declarations using
Douglas Gregor [Wed, 14 Dec 2011 21:44:45 +0000 (21:44 +0000)]
Introduce Decl::isSameEntityAs(), to help compare declarations using
their canonical Decl nodes. Not used yet, but it will be.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146591 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't consider an overloaded operator& when the expression is actually
Douglas Gregor [Wed, 14 Dec 2011 21:23:13 +0000 (21:23 +0000)]
Don't consider an overloaded operator& when the expression is actually
going to be a pointer-to-member constant. Fixes <rdar://problem/10544564>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146587 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't use the frame pointer on linux x86 and x86_64 if optimizing. This
Rafael Espindola [Wed, 14 Dec 2011 21:02:23 +0000 (21:02 +0000)]
Don't use the frame pointer on linux x86 and x86_64 if optimizing. This
matches gcc's behavior.

Fixes PR8186.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146586 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Disable verification step on the failing test.
Anna Zaks [Wed, 14 Dec 2011 19:39:46 +0000 (19:39 +0000)]
[analyzer] Disable verification step on the failing test.

I need to keep the test itself in the repository since it's the only way I can currently reproduce the issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146582 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAllow empty argument lists in thread safety attributes
DeLesley Hutchins [Wed, 14 Dec 2011 19:36:06 +0000 (19:36 +0000)]
Allow empty argument lists in thread safety attributes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146580 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove & comment the 'decltype in declarator-id' as suggested by Doug Gregor.
David Blaikie [Wed, 14 Dec 2011 18:59:02 +0000 (18:59 +0000)]
Move & comment the 'decltype in declarator-id' as suggested by Doug Gregor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146576 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Re-enable the test which was failing on one of the bots.
Anna Zaks [Wed, 14 Dec 2011 18:34:17 +0000 (18:34 +0000)]
[analyzer] Re-enable the test which was failing on one of the bots.

I cannot reproduce the failures neither on my machine nor on the same buildbot machine (with the clang binary built on it). Let's see if it fails again..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146574 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix obvious error in _mm_test_all_zeros. PR11565.
Bob Wilson [Wed, 14 Dec 2011 17:17:16 +0000 (17:17 +0000)]
Fix obvious error in _mm_test_all_zeros.  PR11565.
Patch by Mathias Gaunard!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146565 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEliminate the vistigial ObjCClassDecl::ObjCClassRef, and inline its
Douglas Gregor [Wed, 14 Dec 2011 17:12:03 +0000 (17:12 +0000)]
Eliminate the vistigial ObjCClassDecl::ObjCClassRef, and inline its
members into ObjCClassDecl, saving ourselves one pointer per forward
declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146564 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen name lookup comes across a declaration that is in a module that
Douglas Gregor [Wed, 14 Dec 2011 16:03:29 +0000 (16:03 +0000)]
When name lookup comes across a declaration that is in a module that
is not visible, look for any previous declarations of that entity that
might be visible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146563 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agor146430 lost some compile-time performance on MultiSource/Benchmarks/MiBench/security...
Matt Beaumont-Gay [Wed, 14 Dec 2011 16:02:15 +0000 (16:02 +0000)]
r146430 lost some compile-time performance on MultiSource/Benchmarks/MiBench/security-rijndael; this gets most of it back.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146562 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEnable stack protectors by default for iOS. <rdar://problem/8836680>
Bob Wilson [Wed, 14 Dec 2011 06:08:25 +0000 (06:08 +0000)]
Enable stack protectors by default for iOS.  <rdar://problem/8836680>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146552 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSwitch test over to using -verify instead of using grep. PR11552.
Eli Friedman [Wed, 14 Dec 2011 02:16:13 +0000 (02:16 +0000)]
Switch test over to using -verify instead of using grep.  PR11552.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146544 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Revert the taint test, which is failing on one of the bots for time being.
Anna Zaks [Wed, 14 Dec 2011 02:00:54 +0000 (02:00 +0000)]
[analyzer] Revert the taint test, which is failing on one of the bots for time being.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146541 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Treat stdin as a source of taint.
Anna Zaks [Wed, 14 Dec 2011 00:56:18 +0000 (00:56 +0000)]
[analyzer] Treat stdin as a source of taint.

Some of the test cases do not currently work because the analyzer core
does not seem to call checkers for pre/post DeclRefExpr visits.
(Opened radar://10573500. To be fixed later on.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146536 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Minor refactor to addTaint.
Anna Zaks [Wed, 14 Dec 2011 00:56:15 +0000 (00:56 +0000)]
[analyzer] Minor refactor to addTaint.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146535 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Mark output of fscanf and fopen as tainted.
Anna Zaks [Wed, 14 Dec 2011 00:56:02 +0000 (00:56 +0000)]
[analyzer] Mark output of fscanf and fopen as tainted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146533 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Mark getenv output as tainted.
Anna Zaks [Wed, 14 Dec 2011 00:55:58 +0000 (00:55 +0000)]
[analyzer] Mark getenv output as tainted.

Also, allow adding taint to a region (not only a symbolic value).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146532 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPer discussion on the list, remove BitcodeVerify pass to reimplement as a free function.
Chad Rosier [Wed, 14 Dec 2011 00:29:23 +0000 (00:29 +0000)]
Per discussion on the list, remove BitcodeVerify pass to reimplement as a free function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146530 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake the diagnostic message more consistant. Update the type comparison to
Richard Trieu [Tue, 13 Dec 2011 23:19:45 +0000 (23:19 +0000)]
Make the diagnostic message more consistant.  Update the type comparison to
handle non-pointer types.  This is for the extra info printed when function
types are compared.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146525 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjc: diagnose duplicate declaration of methods
Fariborz Jahanian [Tue, 13 Dec 2011 19:40:34 +0000 (19:40 +0000)]
objc: diagnose duplicate declaration of methods
in classes. // rdar://10535349

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146504 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] Indexing API: Provide the protocols list for objc categories as well.
Argyrios Kyrtzidis [Tue, 13 Dec 2011 18:47:45 +0000 (18:47 +0000)]
[libclang] Indexing API: Provide the protocols list for objc categories as well.

rdar://10573361

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146498 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] Indexing API: Fix indexing of missed references.
Argyrios Kyrtzidis [Tue, 13 Dec 2011 18:47:41 +0000 (18:47 +0000)]
[libclang] Indexing API: Fix indexing of missed references.

rdar://10567864&10567916

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146497 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] Indexing API: Fix suppressing of references in macros and suppress
Argyrios Kyrtzidis [Tue, 13 Dec 2011 18:47:35 +0000 (18:47 +0000)]
[libclang] Indexing API: Fix suppressing of references in macros and suppress
@class forward references.

rdar://10568080&10568103&10568119

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146496 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTweak ARC diagnostic categories and rename 'Automatic Reference Counting Issue' to...
Ted Kremenek [Tue, 13 Dec 2011 14:50:33 +0000 (14:50 +0000)]
Tweak ARC diagnostic categories and rename 'Automatic Reference Counting Issue' to 'ARC Parse Issue' and 'ARC Issue' to 'ARC Semantic Issue'.  Patch by Jean-Daniel Dupas.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146483 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdded an assertion about overflow in sizeof evaluation. This does not solve the under...
Abramo Bagnara [Tue, 13 Dec 2011 11:23:52 +0000 (11:23 +0000)]
Added an assertion about overflow in sizeof evaluation. This does not solve the underlying structural issue that is waiting for a proper solution.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146482 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDisallow decltype in qualified declarator-ids.
David Blaikie [Tue, 13 Dec 2011 08:03:36 +0000 (08:03 +0000)]
Disallow decltype in qualified declarator-ids.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146480 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd checks and diagnostics for many of the cases which C++11 considers to not
Richard Smith [Tue, 13 Dec 2011 06:39:58 +0000 (06:39 +0000)]
Add checks and diagnostics for many of the cases which C++11 considers to not
be constant expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146479 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTestcase for LLVM commit r146475.
Nick Lewycky [Tue, 13 Dec 2011 05:09:22 +0000 (05:09 +0000)]
Testcase for LLVM commit r146475.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146476 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agos/%clang-cc1/%clang_cc1/ for conformity.
Nick Lewycky [Tue, 13 Dec 2011 00:32:15 +0000 (00:32 +0000)]
s/%clang-cc1/%clang_cc1/ for conformity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146454 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSet umbrella directory correctly when we infer a framework module
Douglas Gregor [Mon, 12 Dec 2011 23:55:05 +0000 (23:55 +0000)]
Set umbrella directory correctly when we infer a framework module

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146451 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix "control may reach end of non-void function" warning.
Nick Lewycky [Mon, 12 Dec 2011 23:36:07 +0000 (23:36 +0000)]
Fix "control may reach end of non-void function" warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146448 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement the Microsoft __if_exists/if_not_exists extension in initializer-list.
Francois Pichet [Mon, 12 Dec 2011 23:24:39 +0000 (23:24 +0000)]
Implement the Microsoft __if_exists/if_not_exists extension in initializer-list.
Necessary to parse Microsoft ATL code.

Example:
  int array[] = {
    0,
    __if_exists(CLASS::Type) {2, }
    3
  };

will declare an array of 2 or 3 elements depending on if CLASS::Type exists or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146447 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[asan] update asan docs
Kostya Serebryany [Mon, 12 Dec 2011 23:22:31 +0000 (23:22 +0000)]
[asan] update asan docs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146446 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTweak submodule ID handling in the AST writer
Douglas Gregor [Mon, 12 Dec 2011 23:17:57 +0000 (23:17 +0000)]
Tweak submodule ID handling in the AST writer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146445 91177308-0d34-0410-b5e6-96231b3b80d8