]> granicus.if.org Git - clang/log
clang
12 years agoIf the element type of an initializer list has a destructor, make sure we check it...
Sebastian Redl [Mon, 5 Mar 2012 19:35:43 +0000 (19:35 +0000)]
If the element type of an initializer list has a destructor, make sure we check it. Fixes PR12178.

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

12 years agopatch to optionally warn for block implementations without explicit
Fariborz Jahanian [Mon, 5 Mar 2012 19:34:00 +0000 (19:34 +0000)]
patch to optionally warn for block implementations without explicit
return types that return non-void values. // rdar://10735698

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

12 years agoAdd MCRegisterInfo to the MCInstPrinter factory function interface.
Jim Grosbach [Mon, 5 Mar 2012 19:33:41 +0000 (19:33 +0000)]
Add MCRegisterInfo to the MCInstPrinter factory function interface.

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

12 years ago[analyzer] False positive in SelfInit - teach the checker about method
Anna Zaks [Mon, 5 Mar 2012 18:58:25 +0000 (18:58 +0000)]
[analyzer] False positive in SelfInit - teach the checker about method
calls with self as a parameter.

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

12 years ago[analyzer] Malloc should assume that ownership is transfered when
Anna Zaks [Mon, 5 Mar 2012 17:42:10 +0000 (17:42 +0000)]
[analyzer] Malloc should assume that ownership is transfered when
calling an ObjC method ending with 'NoCopy'.

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

12 years agoAvoid double lookup.
Benjamin Kramer [Mon, 5 Mar 2012 17:20:04 +0000 (17:20 +0000)]
Avoid double lookup.

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

12 years agoProperly handle non-canonical underlying types in
Peter Collingbourne [Mon, 5 Mar 2012 16:02:06 +0000 (16:02 +0000)]
Properly handle non-canonical underlying types in
ASTContext::getUnaryTransformType.  This can happen if, for example,
an enumeration's underlying type is a typedef.

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

12 years agoFix a -Wstring-plus-int warning.
Nico Weber [Mon, 5 Mar 2012 15:48:34 +0000 (15:48 +0000)]
Fix a -Wstring-plus-int warning.

Patch from Sean Silva <silvas@purdue.edu>!

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

12 years agoTargetInfo: create less temporary strings.
Benjamin Kramer [Mon, 5 Mar 2012 15:10:44 +0000 (15:10 +0000)]
TargetInfo: create less temporary strings.

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

12 years agoFix a small difference in sema and codegen views of what needs to be output.
Rafael Espindola [Mon, 5 Mar 2012 10:54:55 +0000 (10:54 +0000)]
Fix a small difference in sema and codegen views of what needs to be output.

In the included testcase, soma thinks that we already have a definition after we
see the out of line decl. Codegen puts it in a deferred list, to be output if
a use is seen. This would break when we saw an explicit template instantiation
definition, since codegen would not be notified.

This patch adds a method to the consumer interface so that soma can notify
codegen that this decl is now required.

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

12 years agoFix a bug in the mangler where in 'namespace std { extern "C" {X;} }', X would not...
James Molloy [Mon, 5 Mar 2012 09:59:43 +0000 (09:59 +0000)]
Fix a bug in the mangler where in 'namespace std { extern "C" {X;} }', X would not be seen to be in ::std::.

Migrate two other places where the same logic is used to use the helper function that already exists.

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

12 years ago[arcmt]
Argyrios Kyrtzidis [Mon, 5 Mar 2012 08:46:24 +0000 (08:46 +0000)]
[arcmt]
-Make sure we don't change to '__weak' a __block variable used as output.
-Make sure we don't apply __weak twice.

Fixes rdar://10520757&10521362

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

12 years ago[preprocessor] Enhance PreprocessingRecord to keep track of locations of conditional...
Argyrios Kyrtzidis [Mon, 5 Mar 2012 05:48:17 +0000 (05:48 +0000)]
[preprocessor] Enhance PreprocessingRecord to keep track of locations of conditional directives.

Introduce PreprocessingRecord::rangeIntersectsConditionalDirective() which returns
true if a given range intersects with a conditional directive block.

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

12 years ago[preprocessor] Enhance the preprocessor callbacks:
Argyrios Kyrtzidis [Mon, 5 Mar 2012 05:48:09 +0000 (05:48 +0000)]
[preprocessor] Enhance the preprocessor callbacks:

-Add location parameter for the directives callbacks
-Skip callbacks if the directive is inside a skipped range.
-Make sure the directive callbacks are invoked in source order.

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

12 years agoMore tests for r152012.
Richard Smith [Mon, 5 Mar 2012 04:06:25 +0000 (04:06 +0000)]
More tests for r152012.

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

12 years agoLexing support for user-defined literals. Currently these lex as the same token
Richard Smith [Mon, 5 Mar 2012 04:02:15 +0000 (04:02 +0000)]
Lexing support for user-defined literals. Currently these lex as the same token
kinds as the underlying string literals, and we silently drop the ud-suffix;
those issues will be fixed by subsequent patches.

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

12 years ago[clang.py] Return bool from Cursor.__eq__
Gregory Szorc [Mon, 5 Mar 2012 00:42:15 +0000 (00:42 +0000)]
[clang.py] Return bool from Cursor.__eq__

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

12 years agoRemove a recursive visitation in ExprEngine that is no longer needed because the...
Erik Verbruggen [Sun, 4 Mar 2012 18:12:21 +0000 (18:12 +0000)]
Remove a recursive visitation in ExprEngine that is no longer needed because the CFG is fully linearized.

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

12 years agoSilence a GCC warning about a set-but-not-used variable in release builds.
Chandler Carruth [Sun, 4 Mar 2012 12:16:40 +0000 (12:16 +0000)]
Silence a GCC warning about a set-but-not-used variable in release builds.

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

12 years agoAdd tests for [over.literal]. Fix a few bugs which were exposed by the tests.
Richard Smith [Sun, 4 Mar 2012 09:41:16 +0000 (09:41 +0000)]
Add tests for [over.literal]. Fix a few bugs which were exposed by the tests.

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

12 years agoFrom his comment in PR12168, Eli seems confused about the alignment assumptions
Chris Lattner [Sun, 4 Mar 2012 00:56:24 +0000 (00:56 +0000)]
From his comment in PR12168, Eli seems confused about the alignment assumptions
we're making.  We only ignore implicit casts.  Add a testcase showing that
we get the right behavior with explicit casts.

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

12 years agoadd a testcase for PR12094 and fix a crash on pointer to incomplete type,
Chris Lattner [Sun, 4 Mar 2012 00:52:12 +0000 (00:52 +0000)]
add a testcase for PR12094 and fix a crash on pointer to incomplete type,
reported by Richard Smith.

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

12 years agoAdd a pile of tests for unrestricted unions, and advertise support for them.
Richard Smith [Sat, 3 Mar 2012 23:51:05 +0000 (23:51 +0000)]
Add a pile of tests for unrestricted unions, and advertise support for them.

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

12 years agoconstexpr: Remove APValue/CCValue distinction. It is no longer useful given the
Richard Smith [Sat, 3 Mar 2012 22:46:17 +0000 (22:46 +0000)]
constexpr: Remove APValue/CCValue distinction. It is no longer useful given the
resolution of core issue 1454.

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

12 years agoRemove unused variable.
Benjamin Kramer [Sat, 3 Mar 2012 21:52:22 +0000 (21:52 +0000)]
Remove unused variable.

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

12 years agoFix Typo in 'objc changes' anchor.
Jean-Daniel Dupas [Sat, 3 Mar 2012 13:37:22 +0000 (13:37 +0000)]
Fix Typo in 'objc changes' anchor.

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

12 years agoAvoid an unnecessary recursive loop between type canonicalization and NNS canonicaliz...
Eli Friedman [Sat, 3 Mar 2012 04:09:56 +0000 (04:09 +0000)]
Avoid an unnecessary recursive loop between type canonicalization and NNS canonicalization which would (rarely) lead to memory corruption.  While I'm here, simplify.  Fixes PR12166.  Not committing a testcase because it's impossible to reduce it.

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

12 years ago[analyzer] do not warn about returning stack-allocated memory when it comes from...
Ted Kremenek [Sat, 3 Mar 2012 01:22:03 +0000 (01:22 +0000)]
[analyzer] do not warn about returning stack-allocated memory when it comes from an ancestor stack frame.

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

12 years agoFactor bitfields of LangOptions out into a base class in order to make them
Richard Smith [Sat, 3 Mar 2012 00:52:40 +0000 (00:52 +0000)]
Factor bitfields of LangOptions out into a base class in order to make them
trivially-copyable. 50KiB reduction in clang binary size.

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

12 years agoFrontend: Default to creating output files using temporary files + rename.
Daniel Dunbar [Sat, 3 Mar 2012 00:36:06 +0000 (00:36 +0000)]
Frontend: Default to creating output files using temporary files + rename.
 - This is a more reliable default, as it behaves better on failure and also
   ensures that we create *new* files (instead of reusing existing inodes). This
   is useful for other applications (like lldb) which want to cache inode's to
   know when a file has been rewritten.

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

12 years agoFrontend: Don't automatically create missing directories when using temporary files...
Daniel Dunbar [Sat, 3 Mar 2012 00:36:02 +0000 (00:36 +0000)]
Frontend: Don't automatically create missing directories when using temporary files with createOutputFile()
 - This would otherwise happen as a side effect of llvm::sys::fs::unique_file creating parent directories.

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

12 years agoThread safety analysis: expand set of expressions that can be used to denote locks.
DeLesley Hutchins [Fri, 2 Mar 2012 23:36:05 +0000 (23:36 +0000)]
Thread safety analysis: expand set of expressions that can be used to denote locks.

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

12 years agoReinstate r151879, r151880, reverted in r151922, along with a bugfix for
Richard Smith [Fri, 2 Mar 2012 23:27:11 +0000 (23:27 +0000)]
Reinstate r151879, r151880, reverted in r151922, along with a bugfix for
scalar emission of DeclRefExprs to const bools: emit scalar bools as i1,
not as i8.

In addition to the extra unit testing, this has successfully bootstrapped.

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

12 years agoUnbreak the CMake builds following the CallGraph change.
Anna Zaks [Fri, 2 Mar 2012 23:18:45 +0000 (23:18 +0000)]
Unbreak the CMake builds following the CallGraph change.

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

12 years agoAdd a test for the -Wstring-plus-int fixit note.
Nico Weber [Fri, 2 Mar 2012 23:01:20 +0000 (23:01 +0000)]
Add a test for the -Wstring-plus-int fixit note.

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

12 years ago[analyzer] Rename clang::CallGraph into clang::idx::CallGraph + rename
Anna Zaks [Fri, 2 Mar 2012 22:54:36 +0000 (22:54 +0000)]
[analyzer] Rename clang::CallGraph into clang::idx::CallGraph + rename
the corresponding files to avoid confusion.

This is a preparation to adding an AST-based call graph to Analysis. The
existing call graph works with indexer entries. We might be able to
refactor it to use the AST based graph in the future.

(Minimal testing here as the only example that uses the API has been
completely broken, does not compile.)

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

12 years agoAdding support for #pragma include_alias in MS compatibility mode. This implements...
Aaron Ballman [Fri, 2 Mar 2012 22:51:54 +0000 (22:51 +0000)]
Adding support for #pragma include_alias in MS compatibility mode.  This implements PR 10705.

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

12 years agoIssue warning when late-parsed attributes have no declaration.
DeLesley Hutchins [Fri, 2 Mar 2012 22:29:50 +0000 (22:29 +0000)]
Issue warning when late-parsed attributes have no declaration.

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

12 years agoMake late-parsed attributes follow the conventions of ordinary
DeLesley Hutchins [Fri, 2 Mar 2012 22:12:59 +0000 (22:12 +0000)]
Make late-parsed attributes follow the conventions of ordinary
GNU attributes to a better extent, by allowing them in more
places on a declator.

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

12 years agoThread safety analysis: handle CFG blocks which call functions marked as noreturn.
DeLesley Hutchins [Fri, 2 Mar 2012 22:02:58 +0000 (22:02 +0000)]
Thread safety analysis: handle CFG blocks which call functions marked as noreturn.

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

12 years agoAdd -Wstring-plus-int, which warns on "str" + int and int + "str".
Nico Weber [Fri, 2 Mar 2012 22:01:22 +0000 (22:01 +0000)]
Add -Wstring-plus-int, which warns on "str" + int and int + "str".

It doesn't warn if the integer is known at compile time and within
the bounds of the string.

Discussion: http://comments.gmane.org/gmane.comp.compilers.clang.scm/47203

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

12 years agoobjc: When issue diagnostic about deprecated method, also
Fariborz Jahanian [Fri, 2 Mar 2012 21:50:02 +0000 (21:50 +0000)]
objc: When issue diagnostic about deprecated method, also
issue the note if it is because message is sent to a forward class
declaration in delayed diagnostic. // rdar://10290322

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

12 years ago[analyzer diagnostics] flush locations *before* popping the current path when visitin...
Ted Kremenek [Fri, 2 Mar 2012 21:16:22 +0000 (21:16 +0000)]
[analyzer diagnostics] flush locations *before* popping the current path when visiting a CallEnter.

Fixes <rdar://problem/10967815>

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

12 years agoFix an ABI problem with ptrdiff_t and intptr_t on PPC32
Hal Finkel [Fri, 2 Mar 2012 20:54:36 +0000 (20:54 +0000)]
Fix an ABI problem with ptrdiff_t and intptr_t on PPC32

ptrdiff_t on PPC32 on Linux, etc. should be int not long.
This does not matter for C, but it does matter for C++ because of
name mangling.

The preprocessor test has been changed accordingly.

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

12 years agoMove int<->pointer conversion warnings behind -Wint-conversions.
Nico Weber [Fri, 2 Mar 2012 20:23:08 +0000 (20:23 +0000)]
Move int<->pointer conversion warnings behind -Wint-conversions.

This is consistent with -Wbool-conversion. Let me know if you prefer
a different flag name.

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

12 years ago[Sema] Fix crash-on-invalid-code issue:
Argyrios Kyrtzidis [Fri, 2 Mar 2012 19:14:29 +0000 (19:14 +0000)]
[Sema] Fix crash-on-invalid-code issue:

@class I;
@implementation I(cat) // crashes here
@end

rdar://10968158

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

12 years ago[analyzer] Bound the size of the functions being inlined + provide
Anna Zaks [Fri, 2 Mar 2012 19:05:03 +0000 (19:05 +0000)]
[analyzer] Bound the size of the functions being inlined + provide
command line options for inlining tuning.

This adds the option for stack depth bound as well as function size
bound.

+ minor doxygenification

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

12 years agoPR12094: Set the alignment of memory intrinsic instructions based on the
Jay Foad [Fri, 2 Mar 2012 18:34:30 +0000 (18:34 +0000)]
PR12094: Set the alignment of memory intrinsic instructions based on the
types of the pointer arguments.

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

12 years agoChange diagnostic test for my last patch.
Fariborz Jahanian [Fri, 2 Mar 2012 17:05:03 +0000 (17:05 +0000)]
Change diagnostic test for my last patch.
// rdar://10961370

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

12 years agoRevert r151879, r151880, "PR12145: Avoid emitting loads of constexpr variables in...
Daniel Dunbar [Fri, 2 Mar 2012 16:24:25 +0000 (16:24 +0000)]
Revert r151879, r151880, "PR12145: Avoid emitting loads of constexpr variables in contexts where there" and "Fix buildbot: make this test less dependent on the value names in the produced IR."

They broke bootstrap.

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

12 years agoUse tabs instead of spaces.
Benjamin Kramer [Fri, 2 Mar 2012 16:06:37 +0000 (16:06 +0000)]
Use tabs instead of spaces.

No, really, make doesn't work with spaces.

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

12 years agoclang -v support for separate clang.git and llvm.git, patch by Andrew Trick.
Jia Liu [Fri, 2 Mar 2012 14:37:41 +0000 (14:37 +0000)]
clang -v support for separate clang.git and llvm.git, patch by Andrew Trick.

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

12 years agoAdd the Solaris support directory to the header search when using libc++.
David Chisnall [Fri, 2 Mar 2012 10:49:52 +0000 (10:49 +0000)]
Add the Solaris support directory to the header search when using libc++.

Unconditionally define __C99FEATURES__ when using C++ on Solaris.  This is a
(hopefully temporary) work around for libc++ exposing C99-but-not-C++98
features in C++98 mode.

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

12 years agoEnsure that we instantiate static reference data members of class templates
Richard Smith [Fri, 2 Mar 2012 04:14:40 +0000 (04:14 +0000)]
Ensure that we instantiate static reference data members of class templates
early, since their values can be used in constant expressions in C++11. For
odr-use checking, the opposite change is required, since references are
odr-used whether or not they satisfy the requirements for appearing in a
constant expression.

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

12 years agoFix buildbot: make this test less dependent on the value names in the produced IR.
Richard Smith [Fri, 2 Mar 2012 03:22:38 +0000 (03:22 +0000)]
Fix buildbot: make this test less dependent on the value names in the produced IR.

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

12 years agoPR12145: Avoid emitting loads of constexpr variables in contexts where there
Richard Smith [Fri, 2 Mar 2012 03:16:32 +0000 (03:16 +0000)]
PR12145: Avoid emitting loads of constexpr variables in contexts where there
is no odr-use of the variable. Go slightly beyond what the standard requires
for variables of reference type.

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

12 years ago[analyzer diagnostics] Change CompactPathDiagnostic to recursively compact diagnostic...
Ted Kremenek [Fri, 2 Mar 2012 01:27:31 +0000 (01:27 +0000)]
[analyzer diagnostics] Change CompactPathDiagnostic to recursively compact diagnostics in calls into macro pieces.
Also fix handling of macros within calls in the HTMLDiagnostics.

This also adds a test case for r151774.

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

12 years agoc/objc: problem originally reported as an objective-c bug.
Fariborz Jahanian [Thu, 1 Mar 2012 23:42:00 +0000 (23:42 +0000)]
c/objc: problem originally reported as an objective-c bug.
But it is in the underlying c part of clang. clang crashes
in IRGen when passing an incomplete type argument to
variadic function (instead of diagnosing the bug).
// rdar://10961370

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

12 years agoadd documentation for -f[no-]thread-sanitizer and -f[no-]address-sanitizer to docs...
Kostya Serebryany [Thu, 1 Mar 2012 23:14:19 +0000 (23:14 +0000)]
add documentation for -f[no-]thread-sanitizer and -f[no-]address-sanitizer to docs/UsersManual.html

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

12 years agoTeach the analyzer to just ignore CXXBindTemporaryExpr. There's nothing special...
Ted Kremenek [Thu, 1 Mar 2012 23:06:04 +0000 (23:06 +0000)]
Teach the analyzer to just ignore CXXBindTemporaryExpr.  There's nothing special to do with it, since destructors are represented explicitly in the CFG.

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

12 years agoMoving tagging of '__experimental_modules_import' IdentifierInfo out of
Ted Kremenek [Thu, 1 Mar 2012 22:53:32 +0000 (22:53 +0000)]
Moving tagging of '__experimental_modules_import' IdentifierInfo out of
IndentifierTable::get() and into IdentifierTable's constructor.

This gets a 0.7% reducing on lexing time for Cocoa.h, and
about the same for PCH generation.

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

12 years agoMake CodeGenFunction::EmitBlockCopyAndAutorelease actually do what its name says.
Eli Friedman [Thu, 1 Mar 2012 22:52:28 +0000 (22:52 +0000)]
Make CodeGenFunction::EmitBlockCopyAndAutorelease actually do what its name says.

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

12 years agoUpdate test for llvm assembly output change. Also add a fixme that this
Eric Christopher [Thu, 1 Mar 2012 22:49:10 +0000 (22:49 +0000)]
Update test for llvm assembly output change. Also add a fixme that this
shouldn't be relying on assembly emission.

For the record we should check the metadata output from the front
end and then check in the backend that such a thing emits a pubtypes
entry.

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

12 years ago[analyzer] Turn inlining on by default for better testing exposure.
Anna Zaks [Thu, 1 Mar 2012 22:37:46 +0000 (22:37 +0000)]
[analyzer] Turn inlining on by default for better testing exposure.

Fix a test, which was most likely an unintended recursive call.

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

12 years agoAdd a flag -fthread-sanitizer.
Kostya Serebryany [Thu, 1 Mar 2012 22:27:08 +0000 (22:27 +0000)]
Add a flag -fthread-sanitizer.
This flag enables ThreadSanitizer instrumentation committed to llvm as r150423.
The patch includes one test for -fthread-sanitizer and one similar test for -faddress-sanitizer.
This patch does not modify the linker flags (as we do it for -faddress-sanitizer) because the run-time library is not yet
committed and it's structure in compiler-rt is not 100% clear.
The users manual wil be changed in a separate commit.

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

12 years agoChange @import to @__experimental_modules_import. We are not ready to commit to...
Ted Kremenek [Thu, 1 Mar 2012 22:07:04 +0000 (22:07 +0000)]
Change @import to @__experimental_modules_import.  We are not ready to commit to a particular syntax for modules,
and don't have time to push it forward in the near future.

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

12 years ago[analyzer] Fix a regression introduced in malloc with
Anna Zaks [Thu, 1 Mar 2012 22:06:06 +0000 (22:06 +0000)]
[analyzer] Fix a regression introduced in malloc with
attributes, introduced in r151188.

+ the test to catch it.

Thanks to Ahmed Charles for pointing this out.

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

12 years agoReapply r151702 with a small fix for a failure to cut and paste
Eric Christopher [Thu, 1 Mar 2012 21:36:52 +0000 (21:36 +0000)]
Reapply r151702 with a small fix for a failure to cut and paste
correctly.

Still rdar://10900684

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

12 years agoFix the isReferenced bit on parameters in a couple of edge cases. PR12153.
Eli Friedman [Thu, 1 Mar 2012 21:32:56 +0000 (21:32 +0000)]
Fix the isReferenced bit on parameters in a couple of edge cases.  PR12153.

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

12 years agoRemove test/Sema/many-logical-ops.c since it fails in linux variants.
Argyrios Kyrtzidis [Thu, 1 Mar 2012 19:47:26 +0000 (19:47 +0000)]
Remove test/Sema/many-logical-ops.c since it fails in linux variants.

Will bring it up once the issue is fixed properely.

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

12 years agoMove llvm/ADT/SaveAndRestore.h -> llvm/Support/SaveAndRestore.h.
Argyrios Kyrtzidis [Thu, 1 Mar 2012 19:45:56 +0000 (19:45 +0000)]
Move llvm/ADT/SaveAndRestore.h -> llvm/Support/SaveAndRestore.h.

Needs llvm update.

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

12 years agoMerge __has_attribute tests. Patch by Jonathan Sauer!
Jean-Daniel Dupas [Thu, 1 Mar 2012 17:45:53 +0000 (17:45 +0000)]
Merge __has_attribute tests. Patch by Jonathan Sauer!

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

12 years agoStmtProfiler: Add a null check for child statements.
Peter Collingbourne [Thu, 1 Mar 2012 16:34:31 +0000 (16:34 +0000)]
StmtProfiler: Add a null check for child statements.

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

12 years agoImplement double underscore names support in __has_attribute
Jean-Daniel Dupas [Thu, 1 Mar 2012 14:53:16 +0000 (14:53 +0000)]
Implement double underscore names support in __has_attribute

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

12 years agoAvoid examining the AST from the parser, and simplify somewhat.
Richard Smith [Thu, 1 Mar 2012 07:10:06 +0000 (07:10 +0000)]
Avoid examining the AST from the parser, and simplify somewhat.

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

12 years agoRevert r151800, which was committed without review and has correctness issues.
Richard Smith [Thu, 1 Mar 2012 06:49:39 +0000 (06:49 +0000)]
Revert r151800, which was committed without review and has correctness issues.

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

12 years agoFixing a buildbot complaint about nested templates.
Aaron Ballman [Thu, 1 Mar 2012 04:55:54 +0000 (04:55 +0000)]
Fixing a buildbot complaint about nested templates.

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

12 years agoImplements support for #pragma include_alias in ms compatibility mode. Fixes PR10705.
Aaron Ballman [Thu, 1 Mar 2012 04:18:49 +0000 (04:18 +0000)]
Implements support for #pragma include_alias in ms compatibility mode.  Fixes PR10705.

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

12 years agoAdded support for parsing declspecs on enumerations. Fixes PR8783
Aaron Ballman [Thu, 1 Mar 2012 04:09:28 +0000 (04:09 +0000)]
Added support for parsing declspecs on enumerations.  Fixes PR8783

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

12 years agoImplement "optimization" for lambda-to-block conversion which inlines the generated...
Eli Friedman [Thu, 1 Mar 2012 04:01:32 +0000 (04:01 +0000)]
Implement "optimization" for lambda-to-block conversion which inlines the generated block literal for lambdas which are immediately converted to block pointer type.  This simplifies the AST, avoids an unnecessary copy of the lambda and makes it much easier to avoid copying the result onto the heap.

Note that this transformation has a substantial semantic effect outside of ARC: it gives the converted lambda lifetime semantics similar to a block literal.  With ARC, the effect is much less obvious because the lifetime of blocks is already managed.

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

12 years agoReject 'a = {0} = {0}' rather than parsing it as '(a = {0}) = {0}'. Also
Richard Smith [Thu, 1 Mar 2012 02:59:17 +0000 (02:59 +0000)]
Reject 'a = {0} = {0}' rather than parsing it as '(a = {0}) = {0}'. Also
improve the diagnostics for some attempts to use initializer lists in
expressions.

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

12 years agoCorrect an example of a feature name to actually use a feature name rather
Richard Smith [Thu, 1 Mar 2012 02:12:07 +0000 (02:12 +0000)]
Correct an example of a feature name to actually use a feature name rather
than an attribute name. Patch by Michel Morin!

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

12 years agoFix regression from llvm-gcc where we should NOT emit a warning about __attribute__...
Ted Kremenek [Thu, 1 Mar 2012 01:40:32 +0000 (01:40 +0000)]
Fix regression from llvm-gcc where we should NOT emit a warning about __attribute__((NSObject)) on a property declaration.  This is needed to have retain properties for non-object pointers.  Fixes <rdar://problem/10930507>.

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

12 years ago[analyzer] Diagnostics - do not try to cleanup the path with macros, it
Anna Zaks [Thu, 1 Mar 2012 01:30:58 +0000 (01:30 +0000)]
[analyzer] Diagnostics - do not try to cleanup the path with macros, it
will be done by the general cleanup later on.
A Patch by Ted.

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

12 years agoTighten type-checking a bit to make it clearer how BuildCXXMemberCallExpr is used.
Eli Friedman [Thu, 1 Mar 2012 01:30:04 +0000 (01:30 +0000)]
Tighten type-checking a bit to make it clearer how BuildCXXMemberCallExpr is used.

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

12 years agoMove suport for redefining operator keywords from -fms-extensions to -fms-compatibility.
Nico Weber [Thu, 1 Mar 2012 00:13:46 +0000 (00:13 +0000)]
Move suport for redefining operator keywords from -fms-extensions to -fms-compatibility.

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

12 years agoChange if...else if...else if... to a switch.
Ted Kremenek [Thu, 1 Mar 2012 00:05:06 +0000 (00:05 +0000)]
Change if...else if...else if... to a switch.

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

12 years ago[analyzer] when scanning FIDs in a PathDiagnostic, correctly recurse calls and macros.
Ted Kremenek [Wed, 29 Feb 2012 23:59:20 +0000 (23:59 +0000)]
[analyzer] when scanning FIDs in a PathDiagnostic, correctly recurse calls and macros.

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

12 years agoAllow operator keywords to be #defined in ms-ext mode.
Nico Weber [Wed, 29 Feb 2012 22:54:43 +0000 (22:54 +0000)]
Allow operator keywords to be #defined in ms-ext mode.

Fixes PR10606.

I'm not sure if this is the best way to go about it, but
I locally enabled this code path without the msext conditional,
and all tests pass, except for test/Preprocessor/cxx_oper_keyword.cpp
which explicitly checks that operator keywords can't be redefined.

I also parsed chromium/win with a clang with and without this patch.
It introduced no new errors, but removes 43 existing errors.

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

12 years agoTest for my last patch. // rdar://10267155.
Fariborz Jahanian [Wed, 29 Feb 2012 22:21:36 +0000 (22:21 +0000)]
Test for my last patch. // rdar://10267155.

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

12 years agoobjective-c: provide fixit hint when atomic property does not
Fariborz Jahanian [Wed, 29 Feb 2012 22:18:55 +0000 (22:18 +0000)]
objective-c: provide fixit hint when atomic property does not
have matching user defined setter/getter and a warning is issued.
In this case, a fixit note is displayed. // rdar://10267155

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

12 years agoFix a couple -Wuninitialized warnings from gcc. Reported by David Greene.
Eli Friedman [Wed, 29 Feb 2012 20:59:56 +0000 (20:59 +0000)]
Fix a couple -Wuninitialized warnings from gcc.  Reported by David Greene.

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

12 years agoSerialization: Switch over to using the native SmallVector based BitstreamWriter
Daniel Dunbar [Wed, 29 Feb 2012 20:31:23 +0000 (20:31 +0000)]
Serialization: Switch over to using the native SmallVector based BitstreamWriter
ctor.

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

12 years agoI referenced the incorrect rdar in my previous commit (r151745). Add the
Chad Rosier [Wed, 29 Feb 2012 20:18:57 +0000 (20:18 +0000)]
I referenced the incorrect rdar in my previous commit (r151745).  Add the
correct radar number to the test case for tracking purposes.
rdar://10551066

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

12 years agoAllocate TargetLibraryInfo for the CodeGen passes. Otherwise, it's instantiated
Chad Rosier [Wed, 29 Feb 2012 20:14:59 +0000 (20:14 +0000)]
Allocate TargetLibraryInfo for the CodeGen passes.  Otherwise, it's instantiated
by the BAA pass, which uses the default TargetLibraryInfo constructor.
Unfortunately, the default TargetLibraryInfo constructor assumes all library
calls are available and thus ignores -fno-builtin.
rdar://10947759

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

12 years agoReverting test commit
Jason W Kim [Wed, 29 Feb 2012 19:12:10 +0000 (19:12 +0000)]
Reverting test commit

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

12 years agoTest commit. Please ignore
Jason W Kim [Wed, 29 Feb 2012 19:08:25 +0000 (19:08 +0000)]
Test commit. Please ignore

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

12 years ago[analyzer] Malloc: A pointer might escape through CFContainers APIs,
Anna Zaks [Wed, 29 Feb 2012 18:42:47 +0000 (18:42 +0000)]
[analyzer] Malloc: A pointer might escape through CFContainers APIs,
funopen, setvbuf.

Teach the checker and the engine about these APIs to resolve malloc
false positives. As I am adding more of these APIs, it is clear that all
this should be factored out into a separate callback (for example,
region escapes). Malloc, KeyChainAPI and RetainRelease checkers could
all use it.

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

12 years agoRevert r151702, "Add support for handling captured variables in lambda debug
Daniel Dunbar [Wed, 29 Feb 2012 16:28:29 +0000 (16:28 +0000)]
Revert r151702, "Add support for handling captured variables in lambda debug
info.", which broke some -O0 -g tests.

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

12 years agoAdd -C when linking on Solaris so that the error messages are understandable by actua...
David Chisnall [Wed, 29 Feb 2012 15:06:12 +0000 (15:06 +0000)]
Add -C when linking on Solaris so that the error messages are understandable by actual humans.

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