]> granicus.if.org Git - clang/log
clang
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

12 years agoobjc-arc: better diagnostic when block is declared
Fariborz Jahanian [Mon, 12 Dec 2011 23:17:04 +0000 (23:17 +0000)]
objc-arc: better diagnostic when block is declared
inside a struct/union.

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

12 years agoMake CGRecordLayoutBuilder correctly switch over to a packed class when a class has...
Eli Friedman [Mon, 12 Dec 2011 23:13:20 +0000 (23:13 +0000)]
Make CGRecordLayoutBuilder correctly switch over to a packed class when a class has a base whose alignment will break the class layout.  <rdar://problem/10551376>.

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

12 years agoAdd frontend flags to enable bitcode verifier pass.
Chad Rosier [Mon, 12 Dec 2011 23:05:47 +0000 (23:05 +0000)]
Add frontend flags to enable bitcode verifier pass.

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

12 years agoSuppress -Warray-bounds in certain cases involving macros from system headers.
Matt Beaumont-Gay [Mon, 12 Dec 2011 22:35:02 +0000 (22:35 +0000)]
Suppress -Warray-bounds in certain cases involving macros from system headers.

The motivation here is a "clever" implementation of strncmp(), which peels the first few comparisons via chained conditional expressions which ensure that the input arrays are known at compile time to be sufficiently large.

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

12 years agoFixes a bug in calculation of field offsets of ms_struct
Fariborz Jahanian [Mon, 12 Dec 2011 21:16:36 +0000 (21:16 +0000)]
Fixes a bug in calculation of field offsets of ms_struct
fields by just following what comment says.
// rdar://10513599

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

12 years agoHexagon backend support
Tony Linthicum [Mon, 12 Dec 2011 21:14:55 +0000 (21:14 +0000)]
Hexagon backend support

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

12 years agoFurther tweaking of diagnostic text for casts performing reinterpret_cast
Richard Smith [Mon, 12 Dec 2011 19:33:27 +0000 (19:33 +0000)]
Further tweaking of diagnostic text for casts performing reinterpret_cast
conversions in constant expressions.

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

12 years agoWhen we have an umbrella directory in a module map, recursively walk
Douglas Gregor [Mon, 12 Dec 2011 19:13:53 +0000 (19:13 +0000)]
When we have an umbrella directory in a module map, recursively walk
the subdirectories to find headers in submodules.

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

12 years agoClean up diagnostic wording for disallowed casts in C++11 constant expressions.
Richard Smith [Mon, 12 Dec 2011 19:10:03 +0000 (19:10 +0000)]
Clean up diagnostic wording for disallowed casts in C++11 constant expressions.

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

12 years agoDon't mark include guard macros as implicitly private. This isn't
Douglas Gregor [Mon, 12 Dec 2011 18:47:39 +0000 (18:47 +0000)]
Don't mark include guard macros as implicitly private. This isn't
actually a terribly good heuristic, and the world is too horrible for
it to work.

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

12 years agoFix signature of vsscanf in Builtins.def
Hans Wennborg [Mon, 12 Dec 2011 18:46:05 +0000 (18:46 +0000)]
Fix signature of vsscanf in Builtins.def

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

12 years agoFix signature of sscanf in Builtins.def
Hans Wennborg [Mon, 12 Dec 2011 18:33:02 +0000 (18:33 +0000)]
Fix signature of sscanf in Builtins.def

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

12 years agoImplement C++11 constant expression cast restrictions.
Richard Smith [Mon, 12 Dec 2011 12:46:16 +0000 (12:46 +0000)]
Implement C++11 constant expression cast restrictions.

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

12 years agoMake fscanf, vscanf, etc. be recognized as scanf-like functions.
Hans Wennborg [Mon, 12 Dec 2011 10:34:18 +0000 (10:34 +0000)]
Make fscanf, vscanf, etc. be recognized as scanf-like functions.

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

12 years agoFix some not-yet-used diagnostic code in a template, which gcc spotted and clang
Richard Smith [Mon, 12 Dec 2011 09:41:58 +0000 (09:41 +0000)]
Fix some not-yet-used diagnostic code in a template, which gcc spotted and clang
did not!

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

12 years agoPrepare constant expression infrastructure for the generation of richer
Richard Smith [Mon, 12 Dec 2011 09:28:41 +0000 (09:28 +0000)]
Prepare constant expression infrastructure for the generation of richer
diagnostics. No functionality change.

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

12 years agoUpdate Clang to emit the new form of llvm.cttz and llvm.ctlz intrinsics,
Chandler Carruth [Mon, 12 Dec 2011 04:28:35 +0000 (04:28 +0000)]
Update Clang to emit the new form of llvm.cttz and llvm.ctlz intrinsics,
setting the is_zero_undef flag appropriately to true as that matches the
semantics of these GCC builtins.

This is the Clang side of r146357 in LLVM.

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

12 years agoFix/test decltype dtor calls with invalid base expression.
David Blaikie [Mon, 12 Dec 2011 04:13:55 +0000 (04:13 +0000)]
Fix/test decltype dtor calls with invalid base expression.

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

12 years ago[analyzer] CStringChecker should not rely on the analyzer generating UndefOrUnknown...
Anna Zaks [Sun, 11 Dec 2011 18:43:40 +0000 (18:43 +0000)]
[analyzer] CStringChecker should not rely on the analyzer generating UndefOrUnknown value when it cannot reason about the expression.

We are now often generating expressions even if the solver is not known to be able to simplify it. This is another cleanup of the existing code, where the rest of the analyzer and checkers should not base their logic on knowing ahead of the time what the solver can reason about.

In this case, CStringChecker is performing a check for overflow of 'left+right' operation. The overflow can be checked with either 'maxVal-left' or 'maxVal-right'. Previously, the decision was based on whether the expresion evaluated to undef or not. With this patch, we check if one of the arguments is a constant, in which case we know that 'maxVal-const' is easily simplified. (Another option is to use canReasonAbout() method of the solver here, however, it's currently is protected.)

This patch also contains 2 small bug fixes:
 - swap the order of operators inside SValBuilder::makeGenericVal.
 - handle a case when AddeVal is unknown in GenericTaintChecker::getPointedToSymbol.

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

12 years agoReuse forAddr to create ignored AggValueSlots.
Benjamin Kramer [Sun, 11 Dec 2011 16:34:24 +0000 (16:34 +0000)]
Reuse forAddr to create ignored AggValueSlots.

Silences valgrind warnings about uninitalized alignment values.

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

12 years ago[analyzer]Fixup r146336.
Anna Zaks [Sat, 10 Dec 2011 23:42:38 +0000 (23:42 +0000)]
[analyzer]Fixup r146336.

Forgot to commit the Header files.
Rename generateUnknownVal -> makeGenericVal.

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

12 years ago[analyzer] Introduce IntSymExpr, where the integer is on the lhs.
Anna Zaks [Sat, 10 Dec 2011 23:36:51 +0000 (23:36 +0000)]
[analyzer] Introduce IntSymExpr, where the integer is on the lhs.

Fix a bug in SimpleSValBuilder, where we should swap lhs and rhs when calling generateUnknownVal(), - the function which creates symbolic expressions when data is tainted. The issue is not visible when we only create the expressions for taint since all expressions are commutative from taint perspective.

Refactor SymExpr::symbol_iterator::expand() to use a switch instead of a chain of ifs.

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

12 years agoCheck that arguments to a scanf call match the format specifier,
Hans Wennborg [Sat, 10 Dec 2011 13:20:11 +0000 (13:20 +0000)]
Check that arguments to a scanf call match the format specifier,
and offer fixits when there is a mismatch.

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

12 years agotest/Sema/attr-availability.c: Add explicit -triple x86_64-apple-darwin9, for now.
NAKAMURA Takumi [Sat, 10 Dec 2011 07:50:30 +0000 (07:50 +0000)]
test/Sema/attr-availability.c: Add explicit -triple x86_64-apple-darwin9, for now.

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

12 years ago[libclang] Add defensive checks to make sure we don't try to dereference
Argyrios Kyrtzidis [Sat, 10 Dec 2011 02:36:25 +0000 (02:36 +0000)]
[libclang] Add defensive checks to make sure we don't try to dereference
a null pointer after getCursorDecl() is called. rdar://10298421.

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

12 years agoIn ContentCache::replaceBuffer, add sanity check to make sure that we do not free...
Argyrios Kyrtzidis [Sat, 10 Dec 2011 01:38:26 +0000 (01:38 +0000)]
In ContentCache::replaceBuffer, add sanity check to make sure that we do not free a buffer
and then continue using it. rdar://10359140.

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

12 years agoMake sure that we infer __strong, etc. when we instantiate variables
Douglas Gregor [Sat, 10 Dec 2011 01:22:52 +0000 (01:22 +0000)]
Make sure that we infer __strong, etc. when we instantiate variables
under ARC. Fixes <rdar://problem/10530209>.

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

12 years agoAdd a fast path to the constant evaluator for integer literals. This speeds up
Richard Smith [Sat, 10 Dec 2011 01:10:13 +0000 (01:10 +0000)]
Add a fast path to the constant evaluator for integer literals. This speeds up
compilation of some translation units of SPEC's 445.gobmk by ~4%, and does not
seem to cause a measurable slowdown in other cases.

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

12 years agoAdd a sanity check in SourceManager::getColumnNumber, make sure
Argyrios Kyrtzidis [Sat, 10 Dec 2011 00:30:38 +0000 (00:30 +0000)]
Add a sanity check in SourceManager::getColumnNumber, make sure
we don't try to access beyond the buffer.

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

12 years agoAdd ability to supply additional message to availability macros,
Fariborz Jahanian [Sat, 10 Dec 2011 00:28:41 +0000 (00:28 +0000)]
Add ability to supply additional message to availability macros,
// rdar://10095131

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

12 years agoUse the right CHECK prefix so that we actually do this checking. Miraculously, this...
Douglas Gregor [Sat, 10 Dec 2011 00:28:18 +0000 (00:28 +0000)]
Use the right CHECK prefix so that we actually do this checking. Miraculously, this hasn't broken

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

12 years agoWhen we manage to re-use an expression during tree transformation (=
Douglas Gregor [Sat, 10 Dec 2011 00:23:21 +0000 (00:23 +0000)]
When we manage to re-use an expression during tree transformation (=
template instantiation), and that expression might produce a
temporary, invoke MaybeBindToTemporary. Otherwise, we forget to
destroy objects, release objects, etc. Fixes <rdar://problem/10531073>.

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

12 years agoDriver: Handle -f{no-}honor-infinities, -f{no-}honor-nans, and
Daniel Dunbar [Fri, 9 Dec 2011 23:41:18 +0000 (23:41 +0000)]
Driver: Handle -f{no-}honor-infinities, -f{no-}honor-nans, and
-ffinite-math-only.
 - No test case yet, I don't know how to construct a situation where this
   matters.

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

12 years agoFix up doxyments (\arg vs \p).
Matt Beaumont-Gay [Fri, 9 Dec 2011 23:16:01 +0000 (23:16 +0000)]
Fix up doxyments (\arg vs \p).

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

12 years agoMake array new on a pointer to data member type work correctly. PR11523.
Eli Friedman [Fri, 9 Dec 2011 23:05:37 +0000 (23:05 +0000)]
Make array new on a pointer to data member type work correctly.  PR11523.

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

12 years agoMechanically convert static_assert_fold to static_assert, now we implement the
Richard Smith [Fri, 9 Dec 2011 23:00:37 +0000 (23:00 +0000)]
Mechanically convert static_assert_fold to static_assert, now we implement the
C++11 ICE rules.

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

12 years agoC++11 constant expressions: Don't use CheckICE in C++11; instead, determine
Richard Smith [Fri, 9 Dec 2011 22:58:01 +0000 (22:58 +0000)]
C++11 constant expressions: Don't use CheckICE in C++11; instead, determine
whether an expression is a (core) constant expression as a side-effect of
evaluation. This takes us from accepting far too few expressions as ICEs to
accepting slightly too many -- fixes for the remaining cases are coming next.

The diagnostics produced when an expression is found to be non-constant are
currently quite poor (with generic wording but reasonable source locations),
and will be improved in subsequent commits.

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

12 years agoAdd clang_getDiagnosticSetFromTU() to libclang. Fixes <rdar://problem/10553081>.
Ted Kremenek [Fri, 9 Dec 2011 22:28:32 +0000 (22:28 +0000)]
Add clang_getDiagnosticSetFromTU() to libclang.  Fixes <rdar://problem/10553081>.

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

12 years agoSort exports list.
Ted Kremenek [Fri, 9 Dec 2011 22:28:29 +0000 (22:28 +0000)]
Sort exports list.

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

12 years agoAdd notes for suppressing and (if it's a zero-arg function returning bool) fixing...
David Blaikie [Fri, 9 Dec 2011 21:42:37 +0000 (21:42 +0000)]
Add notes for suppressing and (if it's a zero-arg function returning bool) fixing the function-to-bool conversion warning.

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

12 years agoobjc-arc: diagnose synthesis of a 'weak unavailable' property.
Fariborz Jahanian [Fri, 9 Dec 2011 19:55:11 +0000 (19:55 +0000)]
objc-arc: diagnose synthesis of a 'weak unavailable' property.
// rdar://10535245

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

12 years agoProvide a separate warning for weak vtables in explicit template instantiations....
David Blaikie [Fri, 9 Dec 2011 18:32:50 +0000 (18:32 +0000)]
Provide a separate warning for weak vtables in explicit template instantiations. There's no (current) way to fix such templates to emit strong symbols/vtables, but perhaps users want to know about the cost being incurred anyway.

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

12 years agoWhen performing subframework header lookup, don't search for
Douglas Gregor [Fri, 9 Dec 2011 16:48:01 +0000 (16:48 +0000)]
When performing subframework header lookup, don't search for
".framework/" in the path name, because it could be ".framework\" on
Windows. This whole function needs to be rewritten with PathV2.

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

12 years agoUse llvm::sys::fs::equivalent rather than comparing inodes, because
Douglas Gregor [Fri, 9 Dec 2011 16:22:07 +0000 (16:22 +0000)]
Use llvm::sys::fs::equivalent rather than comparing inodes, because
comparing inodes doesn't actually work on Windows.

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

12 years agoRemove unnecessary braces from my previous commit.
Hans Wennborg [Fri, 9 Dec 2011 15:57:33 +0000 (15:57 +0000)]
Remove unnecessary braces from my previous commit.

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

12 years agoMake printf warnings refer to wint_t and wchar_t by name
Hans Wennborg [Fri, 9 Dec 2011 12:22:12 +0000 (12:22 +0000)]
Make printf warnings refer to wint_t and wchar_t by name
in addition to underlying type.

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

12 years agoMove definition of ConversionSpecifier::toString() to FormatString.cpp
Hans Wennborg [Fri, 9 Dec 2011 11:11:07 +0000 (11:11 +0000)]
Move definition of ConversionSpecifier::toString() to FormatString.cpp

It's declared in FormatString.h, so it shouldn't be defined in
PrintfFormatString.cpp.

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

12 years agofix format specifier fixit for printf("%ld", "foo");
Hans Wennborg [Fri, 9 Dec 2011 10:51:29 +0000 (10:51 +0000)]
fix format specifier fixit for printf("%ld", "foo");

It should reset the length modifier (unless it's a wchar_t string).

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

12 years agoFix a blatant typo or cut/paste-o reported by users of this header.
Chandler Carruth [Fri, 9 Dec 2011 09:23:55 +0000 (09:23 +0000)]
Fix a blatant typo or cut/paste-o reported by users of this header.

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

12 years agoTeach isConstantInitializer that numeric literals are constants, rather than
Richard Smith [Fri, 9 Dec 2011 06:47:34 +0000 (06:47 +0000)]
Teach isConstantInitializer that numeric literals are constants, rather than
having it evaluate them. No change in functionality, but a speed up of about 5%
on some translation units in SPEC 445.gobmk.

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

12 years agoFix the --hash-style option when the target is MIPS as it is
Chandler Carruth [Fri, 9 Dec 2011 04:45:18 +0000 (04:45 +0000)]
Fix the --hash-style option when the target is MIPS as it is
incompatible with the MIPS ABI.

Patch by Simon Atanasyan.

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

12 years agoDocument the updated behaviour of __builtin_constant_p introduced in r146236.
Richard Smith [Fri, 9 Dec 2011 03:40:28 +0000 (03:40 +0000)]
Document the updated behaviour of __builtin_constant_p introduced in r146236.

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

12 years ago[analyzer] Fix inconsistency on when SValBuilder assumes that 2
Anna Zaks [Fri, 9 Dec 2011 03:34:02 +0000 (03:34 +0000)]
[analyzer] Fix inconsistency on when SValBuilder assumes that 2
types are equivalent.

+ A taint test which tests bitwise operations and which was
triggering an assertion due to presence of the integer to integer cast.

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

12 years agoIn ExprEvaluatorBase::VisitOpaqueValueExpr() add a sanity check to avoid
Argyrios Kyrtzidis [Fri, 9 Dec 2011 02:44:48 +0000 (02:44 +0000)]
In ExprEvaluatorBase::VisitOpaqueValueExpr() add a sanity check to avoid
infinite recursion due to bad OpaqueValueExpr.

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

12 years agoReplace the implementation of __builtin_constant_p (which was based on the GCC
Richard Smith [Fri, 9 Dec 2011 02:04:48 +0000 (02:04 +0000)]
Replace the implementation of __builtin_constant_p (which was based on the GCC
documentation) with one based on what GCC's __builtin_constant_p is actually
intended to do (discovered by asking a friendly GCC developer).

In particular, an expression which folds to a pointer is now only considered to
be a "constant" by this builtin if it refers to the first character in a string
literal.

This fixes a rather subtle wrong-code issue when building with glibc. Given:

const char cs[4] = "abcd";
int f(const char *p) { return strncmp(p, cs, 4); }

... the macro magic for strncmp produces a (potentially crashing) call to
strlen(cs), because it expands to an expression starting with:

  __builtin_constant_p(cs) && strlen(cs) < 4 ? /* ... */

Under the secret true meaning of __builtin_constant_p, this is guaranteed to be
safe!

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

12 years agoImplement the notion of umbrella directories, which implicity cover
Douglas Gregor [Fri, 9 Dec 2011 02:04:43 +0000 (02:04 +0000)]
Implement the notion of umbrella directories, which implicity cover
all of the headers below that particular directory. Use umbrella
directories as a clean way to deal with (1) directories/frameworks
that don't have an umbrella header, but don't want to enumerate all of
their headers, and (2) PrivateHeaders, which we never want to
enumerate and want to keep separate from the main umbrella header.

This also eliminates a little more of the "magic" for private headers,
and frameworks in general.

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

12 years agoMove ChainedIncludesSource into the Frontend library. This never really
Chandler Carruth [Fri, 9 Dec 2011 01:55:54 +0000 (01:55 +0000)]
Move ChainedIncludesSource into the Frontend library. This never really
belonged in the Serialization library, it's setting up a compilation,
not just deserializing.

This should fix PR11512, making Serialization actually be layered below
Frontend, a long standing layering violation in Clang.

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

12 years agoClean up the comments for this file now that its contents are totally
Chandler Carruth [Fri, 9 Dec 2011 01:45:42 +0000 (01:45 +0000)]
Clean up the comments for this file now that its contents are totally
different from what the comments indicated. Also drop a no longer used
include that also violates the layering between Serialization and
Frontend.

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

12 years agoMove a free function from the Frontend library into the Lex library as
Chandler Carruth [Fri, 9 Dec 2011 01:33:57 +0000 (01:33 +0000)]
Move a free function from the Frontend library into the Lex library as
part of HeaderSearch. This function just normalizes filenames for use
inside of a synthetic include directive, but it is used in both the
Frontend and Serialization libraries so it needs a common home.

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

12 years agodeprecated enum should not warn when used initializing another deprecated enumerator.
Fariborz Jahanian [Fri, 9 Dec 2011 01:15:54 +0000 (01:15 +0000)]
deprecated enum should not warn when used initializing another deprecated enumerator.
// rdar://10535640

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

12 years agoSave category name loc in ObjCCategoryImplDecl, patch by Jason Haslam!
Argyrios Kyrtzidis [Fri, 9 Dec 2011 00:31:40 +0000 (00:31 +0000)]
Save category name loc in ObjCCategoryImplDecl, patch by Jason Haslam!

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

12 years ago[libclang] Make sure we don't try to handle a CXCursor_NoDeclFound
Argyrios Kyrtzidis [Fri, 9 Dec 2011 00:17:49 +0000 (00:17 +0000)]
[libclang] Make sure we don't try to handle a CXCursor_NoDeclFound
passed to clang_findReferencesInFile.

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

12 years ago[arcmt] Un-XFAIL a test.
Argyrios Kyrtzidis [Fri, 9 Dec 2011 00:17:47 +0000 (00:17 +0000)]
[arcmt] Un-XFAIL a test.

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

12 years agoTeach the Makefile build about the new diagnostic file from r146207.
Chandler Carruth [Fri, 9 Dec 2011 00:09:20 +0000 (00:09 +0000)]
Teach the Makefile build about the new diagnostic file from r146207.
Amazingly this is all that's required.

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

12 years agoUse default visibility in the the symbols declared in unwind.h. This matches
Rafael Espindola [Fri, 9 Dec 2011 00:08:01 +0000 (00:08 +0000)]
Use default visibility in the the symbols declared in unwind.h. This matches
the behavior of gcc's unwind.h.

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

12 years agoSeparate the serialization library's diagnostics from the frontend's
Chandler Carruth [Fri, 9 Dec 2011 00:02:23 +0000 (00:02 +0000)]
Separate the serialization library's diagnostics from the frontend's
diagnostics. Conflating them was highly confusing and makes it harder to
establish a firm layering separation between these two libraries.

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

12 years agoMisc Minix-specific changes to clang:
Eli Friedman [Thu, 8 Dec 2011 23:54:21 +0000 (23:54 +0000)]
Misc Minix-specific changes to clang:

. move compiler-rt to a separate directory so the -L argument only includes compiler-rt (thanks joerg)
. build all clang subdirs
. switches the Minix platform to ELF
. normalizes toolchain invocation

Patch by Ben Gras.

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