]> granicus.if.org Git - clang/log
clang
14 years agoWhen performing overload resolution, only compare the final conversion
Douglas Gregor [Sun, 12 Sep 2010 08:07:23 +0000 (08:07 +0000)]
When performing overload resolution, only compare the final conversion
sequences for two conversion functions when in fact we are in the text
of initialization by a user-defined conversion sequences. Fixes PR8034.

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

14 years agoDiagnose the instantiation of variables (including static data
Douglas Gregor [Sun, 12 Sep 2010 07:37:24 +0000 (07:37 +0000)]
Diagnose the instantiation of variables (including static data
members) with function type. Fixes PR8047.

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

14 years agoDon't complain about useless user-defined conversion functions when
Douglas Gregor [Sun, 12 Sep 2010 07:22:28 +0000 (07:22 +0000)]
Don't complain about useless user-defined conversion functions when
they were instantiated from a template. In template metaprogramming,
stuff happens. Fixes PR8065.

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

14 years agoWhen diagnosing C++ [temp.expl.spec]p3 in C++98/03 mode, downgrade the
Douglas Gregor [Sun, 12 Sep 2010 05:24:55 +0000 (05:24 +0000)]
When diagnosing C++ [temp.expl.spec]p3 in C++98/03 mode, downgrade the
error to a warning if we're in a case that would be allowed in
C++0x. This "fixes" PR8084 by making Clang accept more code than GCC
and (non-strict) EDG do.

Also, add the missing test case for the C++0x semantics, which should
have been in r113717.

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

14 years agoImplement C++0x semantics for [temp.expl.spec]p2, which loosens the
Douglas Gregor [Sun, 12 Sep 2010 05:08:28 +0000 (05:08 +0000)]
Implement C++0x semantics for [temp.expl.spec]p2, which loosens the
restrictions on out-of-line specializations to allow them anywhere in
an enclosing context. Motivated by PR8084.

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

14 years agoAdd basic support for Microsoft enum forward declaration.
Francois Pichet [Sun, 12 Sep 2010 05:06:55 +0000 (05:06 +0000)]
Add basic support for Microsoft enum forward declaration.
Assigning an underlying integral type to an enum forward declaration will come in a next patch.

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

14 years agoImplement the "note" in C++ [over.built]p1, which is actually meant to
Douglas Gregor [Sun, 12 Sep 2010 04:28:07 +0000 (04:28 +0000)]
Implement the "note" in C++ [over.built]p1, which is actually meant to
be a semantic requirement that a built-in overloaded operator is not
added to the overload set of there is already a user-defined
overloaded operator with the same parameter types. Fixes PR8087.

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

14 years agoDon't perform integral promotions from an incompletion enumeration
Douglas Gregor [Sun, 12 Sep 2010 03:38:25 +0000 (03:38 +0000)]
Don't perform integral promotions from an incompletion enumeration
type. Fixes PR8089 in a slightly different way than had been suggested.

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

14 years agoTeach the EvaluatedExprVisitor and its client, which marks
Douglas Gregor [Sat, 11 Sep 2010 23:32:50 +0000 (23:32 +0000)]
Teach the EvaluatedExprVisitor and its client, which marks
declarations in potentially-evaluated subexpressions, about
recursion. Fixes the release-mode self-host failure I introduced in
r113700.

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

14 years agoAugment -ftrapv to check for divide by zero, mod by zero, and INT_MIN % -1.
Chris Lattner [Sat, 11 Sep 2010 21:47:09 +0000 (21:47 +0000)]
Augment -ftrapv to check for divide by zero, mod by zero, and INT_MIN % -1.

Patch by John Regehr!

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

14 years agoUpdate website to reflect that tests are no longer failing on Windows.
Francois Pichet [Sat, 11 Sep 2010 21:16:11 +0000 (21:16 +0000)]
Update website to reflect that tests are no longer failing on Windows.

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

14 years agoAdd a completely unnecessary "template" keyword to appease GCC
Douglas Gregor [Sat, 11 Sep 2010 20:47:38 +0000 (20:47 +0000)]
Add a completely unnecessary "template" keyword to appease GCC

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

14 years agoFix last test still failing on Win32. 100% pass rate now!
Francois Pichet [Sat, 11 Sep 2010 20:43:12 +0000 (20:43 +0000)]
Fix last test still failing on Win32. 100% pass rate now!

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

14 years agoUpdate documentation to reflect the addition of support for in-class
Douglas Gregor [Sat, 11 Sep 2010 20:30:02 +0000 (20:30 +0000)]
Update documentation to reflect the addition of support for in-class
initialization of static const floating-point data membmers (John's
patch, in r113663).

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

14 years agoWhen parsing default function arguments, do not mark any declarations
Douglas Gregor [Sat, 11 Sep 2010 20:24:53 +0000 (20:24 +0000)]
When parsing default function arguments, do not mark any declarations
used in the default function argument as "used". Instead, when we
actually use the default argument, make another pass over the
expression to mark any used declarations as "used" at that point. This
addresses two kinds of related problems:

  1) We were marking some declarations "used" that shouldn't be,
  because we were marking them too eagerly.
  2) We were failing to mark some declarations as "used" when we
  should, if the first time it was instantiated happened to be an
  unevaluated context, we wouldn't mark them again at a later point.

I've also added a potentially-handy visitor class template
EvaluatedExprVisitor, which only visits the potentially-evaluated
subexpressions of an expression. I bet this would have been useful for
noexcept...

Fixes PR5810 and PR8127.

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

14 years agoDocument our extension to constant-fold __builtin_strlen and strlen
Douglas Gregor [Sat, 11 Sep 2010 18:08:34 +0000 (18:08 +0000)]
Document our extension to constant-fold __builtin_strlen and strlen

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

14 years agoThe two libclang crash-recovery tests that involve precompiled
Douglas Gregor [Sat, 11 Sep 2010 18:05:19 +0000 (18:05 +0000)]
The two libclang crash-recovery tests that involve precompiled
preambles end up leaving the precompiled preambles around. This is by
design, since we do minimal cleanup during crash recovery. However,
it's unfortunate for testing, so introduce a hook that allows these
two tests to put the precompiled preamble somewhere where we can
delete them after testing.

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

14 years agoIf we fail to create a temporary file for the precompiled preamble,
Douglas Gregor [Sat, 11 Sep 2010 17:56:52 +0000 (17:56 +0000)]
If we fail to create a temporary file for the precompiled preamble,
just abort creation of the precompiled preamble rather than doing
silly things. This is the second part of the fix for the weird
preamble-related failures on Windows. Big thanks to Francois Pichet
for the great detective work!

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

14 years agoadd latest gentoo gcc path
Nuno Lopes [Sat, 11 Sep 2010 17:51:45 +0000 (17:51 +0000)]
add latest gentoo gcc path

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

14 years agoTweak GetPreamblePCHPath() to more closely match the behavior of the
Douglas Gregor [Sat, 11 Sep 2010 17:51:16 +0000 (17:51 +0000)]
Tweak GetPreamblePCHPath() to more closely match the behavior of the
Windows GetTempPath() function, and be sure to create the directory in
which the precompiled preamble will reside before creating the
temporary file itself.

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

14 years agoDisable cxa_atexit by default on MingW.
Anton Korobeynikov [Sat, 11 Sep 2010 11:17:06 +0000 (11:17 +0000)]
Disable cxa_atexit by default on MingW.
Patch by Dimitry Andric!

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

14 years agoCMake: Fix mingw32 build.
Michael J. Spencer [Sat, 11 Sep 2010 02:13:48 +0000 (02:13 +0000)]
CMake: Fix mingw32 build.

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

14 years agoFixes an obscure bug in importd block variable layout
Fariborz Jahanian [Sat, 11 Sep 2010 01:27:29 +0000 (01:27 +0000)]
Fixes an obscure bug in importd block variable layout
information when imported variable is used
more than once. Originally though to be a bug in importing
block varibles. Fixes radar 8417746.

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

14 years agoTest destructors in delete expressions and of temporaries for throwing.
Sebastian Redl [Fri, 10 Sep 2010 23:27:10 +0000 (23:27 +0000)]
Test destructors in delete expressions and of temporaries for throwing.

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

14 years agoSupport in-class initialization of static const floating-point data members.
John McCall [Fri, 10 Sep 2010 23:21:22 +0000 (23:21 +0000)]
Support in-class initialization of static const floating-point data members.

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

14 years agoFix my silly sorting predicate. I hate integer-to-bool conversions
Douglas Gregor [Fri, 10 Sep 2010 23:05:54 +0000 (23:05 +0000)]
Fix my silly sorting predicate. I hate integer-to-bool conversions

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

14 years agoAddress Doug's comments.
Sebastian Redl [Fri, 10 Sep 2010 22:34:40 +0000 (22:34 +0000)]
Address Doug's comments.

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

14 years agoMake sure we're producing a newline in the preprocessed output before
Douglas Gregor [Fri, 10 Sep 2010 22:27:29 +0000 (22:27 +0000)]
Make sure we're producing a newline in the preprocessed output before
emitting a #pragma, whenever one is needed. Fixes <rdar://problem/8417307>.

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

14 years agoEli helped me understand how evaluation contexts work.
Sebastian Redl [Fri, 10 Sep 2010 21:57:27 +0000 (21:57 +0000)]
Eli helped me understand how evaluation contexts work.

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

14 years agoDriver: Set TOOL_NO_EXPORTS when building a "production" compiler, we don't
Daniel Dunbar [Fri, 10 Sep 2010 21:42:03 +0000 (21:42 +0000)]
Driver: Set TOOL_NO_EXPORTS when building a "production" compiler, we don't
currently expect that to be useful for plugins, and this is important for
startup performance:
--
ddunbar@lordcrumb:tmp$ touch empty.c
ddunbar@lordcrumb:tmp$ runN 100 ~/llvm.obj.64/Release/bin/clang -c empty.c
name   avg     min     med     max      SD    total
user  0.0054  0.0052  0.0054  0.0055  0.0000  0.5350
 sys  0.0084  0.0090  0.0078  0.0087  0.0008  0.8390
wall  0.0149  0.0149  0.0149  0.0149  0.0003  1.4943
ddunbar@lordcrumb:tmp$ runN 100 ~/llvm.obj.64/Release/bin/clang -c empty.c
name   avg     min     med     max      SD    total
user  0.0036  0.0036  0.0036  0.0038  0.0000  0.3646
 sys  0.0072  0.0071  0.0068  0.0070  0.0006  0.7158
wall  0.0123  0.0123  0.0122  0.0136  0.0003  1.2262
--

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

14 years agoFollow Ted's example and hide CXXNoexceptExpr's setters from all but serialization.
Sebastian Redl [Fri, 10 Sep 2010 21:15:56 +0000 (21:15 +0000)]
Follow Ted's example and hide CXXNoexceptExpr's setters from all but serialization.

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

14 years agoCMake: Update to use standard CMake dependency tracking facilities instead
Michael J. Spencer [Fri, 10 Sep 2010 21:13:16 +0000 (21:13 +0000)]
CMake: Update to use standard CMake dependency tracking facilities instead
of whatever we were using before...

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

14 years agoTest CXXNoexceptExpr codegen and serialization.
Sebastian Redl [Fri, 10 Sep 2010 21:04:03 +0000 (21:04 +0000)]
Test CXXNoexceptExpr codegen and serialization.

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

14 years agoImplement CXXNoexceptExpr codegen.
Sebastian Redl [Fri, 10 Sep 2010 21:04:00 +0000 (21:04 +0000)]
Implement CXXNoexceptExpr codegen.

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

14 years agoAdd another small test case.
Sebastian Redl [Fri, 10 Sep 2010 21:03:58 +0000 (21:03 +0000)]
Add another small test case.

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

14 years agoSerialization support for CXXNoexceptExpr.
Sebastian Redl [Fri, 10 Sep 2010 20:55:54 +0000 (20:55 +0000)]
Serialization support for CXXNoexceptExpr.

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

14 years agoMake 'setProperty()', 'setBase()', and 'setLocation()' private in ObjCPropertyRefExpr...
Ted Kremenek [Fri, 10 Sep 2010 20:55:52 +0000 (20:55 +0000)]
Make 'setProperty()', 'setBase()', and 'setLocation()' private in ObjCPropertyRefExpr, and friend ASTStmtReader so that it is the only class that can use them.

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

14 years agoTests for noexcept in templates.
Sebastian Redl [Fri, 10 Sep 2010 20:55:50 +0000 (20:55 +0000)]
Tests for noexcept in templates.

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

14 years agoFirst version of a testcase, plus fixes.
Sebastian Redl [Fri, 10 Sep 2010 20:55:47 +0000 (20:55 +0000)]
First version of a testcase, plus fixes.

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

14 years agoDefine and implement CXXNoexceptExpr. Create it in Sema.
Sebastian Redl [Fri, 10 Sep 2010 20:55:43 +0000 (20:55 +0000)]
Define and implement CXXNoexceptExpr. Create it in Sema.

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

14 years agoParse the noexcept operator and stub out sema.
Sebastian Redl [Fri, 10 Sep 2010 20:55:37 +0000 (20:55 +0000)]
Parse the noexcept operator and stub out sema.

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

14 years agoImplement Expr::CanThrow, a function that applies the noexcept operator rules to...
Sebastian Redl [Fri, 10 Sep 2010 20:55:33 +0000 (20:55 +0000)]
Implement Expr::CanThrow, a function that applies the noexcept operator rules to expressions.

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

14 years agoMake CallExpr::getCalleeDecl look through pointer derefs.
Sebastian Redl [Fri, 10 Sep 2010 20:55:30 +0000 (20:55 +0000)]
Make CallExpr::getCalleeDecl look through pointer derefs.

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

14 years agoFix a comment.
Sebastian Redl [Fri, 10 Sep 2010 20:55:27 +0000 (20:55 +0000)]
Fix a comment.

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

14 years agoPolish diagnostics for null dereferences via ObjC ivar accesses. Finishes up <rdar...
Ted Kremenek [Fri, 10 Sep 2010 20:20:49 +0000 (20:20 +0000)]
Polish diagnostics for null dereferences via ObjC ivar accesses.  Finishes up <rdar://problem/6352035>.

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

14 years agoIRGen fix for using property-dot syntax to pass
Fariborz Jahanian [Fri, 10 Sep 2010 18:56:35 +0000 (18:56 +0000)]
IRGen fix for using property-dot syntax to pass
reference object to a c++ member function.
fixes radar 8409336.

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

14 years agoRe-devirtualize this. A new virtual method snuck in.
Chandler Carruth [Fri, 10 Sep 2010 08:13:48 +0000 (08:13 +0000)]
Re-devirtualize this. A new virtual method snuck in.

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

14 years agoSupport strlen() and __builtin_strlen() as constant expressions with
Douglas Gregor [Fri, 10 Sep 2010 06:27:15 +0000 (06:27 +0000)]
Support strlen() and __builtin_strlen() as constant expressions with
the call argument is a string literal. Fixes
<rdar://problem/8413477>.

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

14 years agoAdd checker implementation for my previous commit!
Ted Kremenek [Fri, 10 Sep 2010 03:45:29 +0000 (03:45 +0000)]
Add checker implementation for my previous commit!

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

14 years agoImplement: <rdar://problem/6351970> rule request: warn if @synchronized mutex can...
Ted Kremenek [Fri, 10 Sep 2010 03:05:40 +0000 (03:05 +0000)]
Implement: <rdar://problem/6351970> rule request: warn if @synchronized mutex can be nil

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

14 years agoAdd ObjCAtSynchronizedStmt to the CFG and add GRExprEngine support (PreVisit for...
Ted Kremenek [Fri, 10 Sep 2010 03:05:33 +0000 (03:05 +0000)]
Add ObjCAtSynchronizedStmt to the CFG and add GRExprEngine support (PreVisit for checkers).

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

14 years agoUpdate checker build.
Ted Kremenek [Fri, 10 Sep 2010 01:20:17 +0000 (01:20 +0000)]
Update checker build.

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

14 years agoAdded AnalyzerStatsChecker, a path sensitive check that reports visitation statistics...
Tom Care [Fri, 10 Sep 2010 00:44:44 +0000 (00:44 +0000)]
Added AnalyzerStatsChecker, a path sensitive check that reports visitation statistics about analysis. Running clang with the -analyzer-stats flag will emit warnings containing the information. We can then run a postanalysis script to take this data and give useful information about how much the analyzer missed in a project.

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

14 years agoAdd libclang support for label statements, gotos, and taking the
Douglas Gregor [Fri, 10 Sep 2010 00:22:18 +0000 (00:22 +0000)]
Add libclang support for label statements, gotos, and taking the
address of a label (GNU extension).

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

14 years agoAdd libclang visitation for C99 designated initializers.
Douglas Gregor [Thu, 9 Sep 2010 23:28:23 +0000 (23:28 +0000)]
Add libclang visitation for C99 designated initializers.

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

14 years agoAdd libclang visitation for __builtin_offsetof's components (fields
Douglas Gregor [Thu, 9 Sep 2010 23:10:46 +0000 (23:10 +0000)]
Add libclang visitation for __builtin_offsetof's components (fields
and array references).

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

14 years agoproperty reference expression used on lhs of assignment
Fariborz Jahanian [Thu, 9 Sep 2010 23:01:10 +0000 (23:01 +0000)]
property reference expression used on lhs of assignment
follows objective's semantics and is not overload'able
with an assignment operator. Fixes a crash and a missing
diagnostics. Radar 8379892.

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

14 years agoClean up obtuse wording of checker diagnostic of using an uninitialized value in...
Ted Kremenek [Thu, 9 Sep 2010 22:51:55 +0000 (22:51 +0000)]
Clean up obtuse wording of checker diagnostic of using an uninitialized value in a function call.

Fixes: <rdar://problem/8409480> “warning: Pass-by-value argument in function call is undefined” message can be improved
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113554 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen we parse a pragma, keep track of how that pragma was originally
Douglas Gregor [Thu, 9 Sep 2010 22:45:38 +0000 (22:45 +0000)]
When we parse a pragma, keep track of how that pragma was originally
spelled (#pragma, _Pragma, __pragma). In -E mode, use that information
to add appropriate newlines when translating _Pragma and __pragma into
#pragma, like GCC does. Fixes <rdar://problem/8412013>.

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

14 years agoDriver/Darwin: Make the compilation object available in AddLinkArgs.
Daniel Dunbar [Thu, 9 Sep 2010 21:51:05 +0000 (21:51 +0000)]
Driver/Darwin: Make the compilation object available in AddLinkArgs.

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

14 years agoTeach libclang to walk the base and member initializers of a
Douglas Gregor [Thu, 9 Sep 2010 21:42:20 +0000 (21:42 +0000)]
Teach libclang to walk the base and member initializers of a
constructor, in source order. Also introduces a new reference kind for
class members, which is used here (for member initializers) and will
also be used for designated initializers and offsetof.

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

14 years agoFix typo in diagnostic.
Daniel Dunbar [Thu, 9 Sep 2010 21:27:25 +0000 (21:27 +0000)]
Fix typo in diagnostic.

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

14 years agoDriver: Mark function as nounwind when -mkernel or -fapple-kext is present.
Daniel Dunbar [Thu, 9 Sep 2010 21:17:44 +0000 (21:17 +0000)]
Driver: Mark function as nounwind when -mkernel or -fapple-kext is present.

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

14 years agoRemove the 'rc' suffix. It indicates a "release candidate" during LLVM release
Bill Wendling [Thu, 9 Sep 2010 20:27:36 +0000 (20:27 +0000)]
Remove the 'rc' suffix. It indicates a "release candidate" during LLVM release
qualification.

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

14 years agoUse FindReportInEquivalenceClass to identify all the nodes used for the trimmed graph...
Ted Kremenek [Thu, 9 Sep 2010 19:05:34 +0000 (19:05 +0000)]
Use FindReportInEquivalenceClass to identify all the nodes used for the trimmed graph (in BugReporter).  This fixes a problem where a leak that happened to occur on both an exit() path and a non-exit() path was getting reported with the exit() path (which users don't care about).

This fixes:

<rdar://problem/8331641> leak reports should not show paths that end with exit() (but ones that don't end with exit())

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

14 years agoFrontend: Add -cxx-system-include option which can be used to specify an
Daniel Dunbar [Thu, 9 Sep 2010 17:38:22 +0000 (17:38 +0000)]
Frontend: Add -cxx-system-include option which can be used to specify an
explicit list for the C++ system include directories at the -cc1 level, as an
alternative to the horrible AddDefaultCPlusPlusIncludePaths().

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

14 years agoFix indentation.
Daniel Dunbar [Thu, 9 Sep 2010 17:38:18 +0000 (17:38 +0000)]
Fix indentation.

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

14 years agoSimplify template instantiation for C++ exception declarations,
Douglas Gregor [Thu, 9 Sep 2010 17:09:21 +0000 (17:09 +0000)]
Simplify template instantiation for C++ exception declarations,
eliminating an unnecessary use of TemporaryBase in the process.

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

14 years agoEliminate some unnecessary uses of TreeTransform::TemporaryBase. There
Douglas Gregor [Thu, 9 Sep 2010 16:55:46 +0000 (16:55 +0000)]
Eliminate some unnecessary uses of TreeTransform::TemporaryBase. There
are still a few (legitimate, unfortunate) uses of this hack around,
but at least now there are fewer.

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

14 years agoEliminate the comma locations from all of the Sema routines that deal
Douglas Gregor [Thu, 9 Sep 2010 16:33:13 +0000 (16:33 +0000)]
Eliminate the comma locations from all of the Sema routines that deal
with comma-separated lists. We never actually used the comma
locations, nor did we store them in the AST, but we did manage to
waste time during template instantiation to produce fake locations.

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

14 years agoUse temporary files for this test, to see if we can flush out an inexplicable error...
Douglas Gregor [Thu, 9 Sep 2010 16:16:39 +0000 (16:16 +0000)]
Use temporary files for this test, to see if we can flush out an inexplicable error on Windows

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

14 years agoAdd proper type-source information to UnaryTypeTraitExpr, including
Douglas Gregor [Thu, 9 Sep 2010 16:14:44 +0000 (16:14 +0000)]
Add proper type-source information to UnaryTypeTraitExpr, including
libclang visitation.

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

14 years agoClean up CMake dependencies
Douglas Gregor [Thu, 9 Sep 2010 15:44:58 +0000 (15:44 +0000)]
Clean up CMake dependencies

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

14 years agoRemove unused variable.
Benjamin Kramer [Thu, 9 Sep 2010 12:27:34 +0000 (12:27 +0000)]
Remove unused variable.

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

14 years agoFix C++ PCH issue.
Argyrios Kyrtzidis [Thu, 9 Sep 2010 11:28:23 +0000 (11:28 +0000)]
Fix C++ PCH issue.

Another beating by boost in this test case: http://llvm.org/PR8117
A function specialization wasn't properly initialized if it wasn't canonical.

I wish there was a nice little test case but this was boost.

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

14 years agodo not bind temporaries to non-const references
Gabor Greif [Thu, 9 Sep 2010 10:51:37 +0000 (10:51 +0000)]
do not bind temporaries to non-const references

this fixes all analyser test failures in my gcc34-based
environment

how the cast result could bind to the non-const ref is
somewhat mysterious and remains to be investigated; to
avoid similar miscompilations (by gcc34 only?)

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

14 years agoRename GRState::getSVal() -> getRawSVal() and getSimplifiedSVal() -> getSVal().
Ted Kremenek [Thu, 9 Sep 2010 07:13:00 +0000 (07:13 +0000)]
Rename GRState::getSVal() -> getRawSVal() and getSimplifiedSVal() -> getSVal().

The end result is now we eagarly constant-fold symbols in the analyzer that are perfectly constrained
to be a constant value.  This allows us to recover some path-sensitivity in some cases by lowering
the required level of reasoning power needed to evaluate some expressions.

The net win from this change is that the false positive in PR 8015 is fixed, and we also
find more idempotent operations bugs.

We do, however, regress with the BugReporterVisitors, which need to be modified to understand
this constant folding (and look past it).  This causes some diagnostic regressions in plist-output.m
which will get addressed in a future patch.  plist-output.m is now marked XFAIL, while
plist-output-alternate.m now tests that the plist output is working, but with the suboptimal
diagnostics.  This second test file will eventually be removed.

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

14 years agoFix indentation.
Ted Kremenek [Thu, 9 Sep 2010 06:53:59 +0000 (06:53 +0000)]
Fix indentation.

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

14 years agoCheck format strings when a called function has more than one FormatAttr (one for...
Ted Kremenek [Thu, 9 Sep 2010 04:33:05 +0000 (04:33 +0000)]
Check format strings when a called function has more than one FormatAttr (one for 'scanf' and one for 'printf').  Fixes <rdar://problem/8409437>.

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

14 years agoIt appears that technically a null format string is not warned under -Wformat-nonlite...
Ted Kremenek [Thu, 9 Sep 2010 03:51:42 +0000 (03:51 +0000)]
It appears that technically a null format string is not warned under -Wformat-nonliteral, as
the function processing the format string can decided whether or not to accept a null format string (e.g., asl_log).  Fixes <rdar://problem/8269537>.

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

14 years agoAvoid redundant recursive calls in SemaCheckStringLiteral by just updating the expression
Ted Kremenek [Thu, 9 Sep 2010 03:51:39 +0000 (03:51 +0000)]
Avoid redundant recursive calls in SemaCheckStringLiteral by just updating the expression
and trying again.

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

14 years agoRemove tabs I accidentally introduced.
Ted Kremenek [Thu, 9 Sep 2010 02:57:51 +0000 (02:57 +0000)]
Remove tabs I accidentally introduced.

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

14 years agoRemove stray ';' and convert tabs to spaces.
Ted Kremenek [Thu, 9 Sep 2010 02:57:48 +0000 (02:57 +0000)]
Remove stray ';' and convert tabs to spaces.

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

14 years agoSimplified reachability checking in IdempotentOperationChecker and added a helper...
Tom Care [Thu, 9 Sep 2010 02:04:52 +0000 (02:04 +0000)]
Simplified reachability checking in IdempotentOperationChecker and added a helper function for path display.
- Created private class CFGReachabilityAnalysis, which provides cached reachability lookups in the CFG
- Simplified PathWasCompletelyAnalyzed to use the new reachability class
- Added getLastRelevantNodes function for future use with path displaying in BugReporter

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

14 years agoRelax __attribute_((nonnull)) checking to allow the attribute on functions with no...
Ted Kremenek [Thu, 9 Sep 2010 01:17:32 +0000 (01:17 +0000)]
Relax __attribute_((nonnull)) checking to allow the attribute on functions with no pointer arguments.  GCC doesn't warn
in this case, and the attribute is trivially satisfied (and benign).  Fixes <rdar://problem/8364828>.

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

14 years agoInclude test case for <rdar://problem/5880430>.
Ted Kremenek [Thu, 9 Sep 2010 00:40:43 +0000 (00:40 +0000)]
Include test case for <rdar://problem/5880430>.

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

14 years agoStatic analyzer fix: <rdar://problem/5880430> Switch on enum should not consider...
Ted Kremenek [Thu, 9 Sep 2010 00:40:40 +0000 (00:40 +0000)]
Static analyzer fix: <rdar://problem/5880430> Switch on enum should not consider default case live if all enum values are covered

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

14 years agoBlock ivar layout must assume that the 'isa'
Fariborz Jahanian [Thu, 9 Sep 2010 00:21:45 +0000 (00:21 +0000)]
Block ivar layout must assume that the 'isa'
field of the block descriptor is GC'able (scanned)
as this what the runtime expects (one can send it
messages). Radar 8394947.

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

14 years agoEnhance -Wunreachable-code to not consider the 'default:' branch of a switch statemen...
Ted Kremenek [Thu, 9 Sep 2010 00:06:10 +0000 (00:06 +0000)]
Enhance -Wunreachable-code to not consider the 'default:' branch of a switch statement live if a switch on an enum value has
explicit 'case:' statements for each enum value.

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

14 years agoEnhance -Wreturn-type to not warn when control-flow is most likely limited by a switc...
Ted Kremenek [Thu, 9 Sep 2010 00:06:07 +0000 (00:06 +0000)]
Enhance -Wreturn-type to not warn when control-flow is most likely limited by a switch statement explicitly covering
all the cases for an enum value.

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

14 years agoAdd 'filtered_pred_iterator' and 'filtered_succ_iterator' to CFGBlock. This allows...
Ted Kremenek [Thu, 9 Sep 2010 00:06:04 +0000 (00:06 +0000)]
Add 'filtered_pred_iterator' and 'filtered_succ_iterator' to CFGBlock.  This allows a client
to selectively walk successors/predecessors based on commonly used filters.  For starters, add
a filter to ignore 'default:' cases for SwitchStmts when all enum values are covered by CaseStmts.

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

14 years agoInitialize 'AllEnumCasesCovered' in SwitchStmt's constructor.
Ted Kremenek [Thu, 9 Sep 2010 00:06:01 +0000 (00:06 +0000)]
Initialize 'AllEnumCasesCovered' in SwitchStmt's constructor.

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

14 years agoWhen building SwitchStmts in Sema, record whether all the enum values of a switch...
Ted Kremenek [Thu, 9 Sep 2010 00:05:53 +0000 (00:05 +0000)]
When building SwitchStmts in Sema, record whether all the enum values of a switch(enum) where
covered by individual case statements.  Flow-based analyses may wish to consult this information,
and recording this in the AST allows us to obviate reconstructing this information later when
we build the CFG.

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

14 years agoPush the range associated with a nested-name-specifier further through
Douglas Gregor [Wed, 8 Sep 2010 23:56:00 +0000 (23:56 +0000)]
Push the range associated with a nested-name-specifier further through
TreeTransform, since we were getting an empty source range where we
shouldn't. Sadly, the test case is Boost.Proto, and isn't worth
reducing.

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

14 years agoFix warnings caused by new CXXUuidofExprClass enumerator.
Francois Pichet [Wed, 8 Sep 2010 23:47:05 +0000 (23:47 +0000)]
Fix warnings caused by new CXXUuidofExprClass enumerator.

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

14 years agoAdd another missing CMake dependency.
Daniel Dunbar [Wed, 8 Sep 2010 23:40:30 +0000 (23:40 +0000)]
Add another missing CMake dependency.

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

14 years agoFix a few minor issues with parsing and semantic analysis of C++
Douglas Gregor [Wed, 8 Sep 2010 23:14:30 +0000 (23:14 +0000)]
Fix a few minor issues with parsing and semantic analysis of C++
typeid expressions:
  - make sure we have a proper source location for the closing ')'
  - cache the declaration of std::type_info once we've found it

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

14 years agoAdd support for a few MS extensions supported by the Borland compiler
Dawn Perchik [Wed, 8 Sep 2010 22:56:24 +0000 (22:56 +0000)]
Add support for a few MS extensions supported by the Borland compiler
(__uuidof, _fastcall, etc.).

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

14 years agoWhen providing a completion for a function/method parameter of block
Douglas Gregor [Wed, 8 Sep 2010 22:47:51 +0000 (22:47 +0000)]
When providing a completion for a function/method parameter of block
pointer type, actually provide a usable block literal expression.

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

14 years agoTest removed.
Fariborz Jahanian [Wed, 8 Sep 2010 22:36:14 +0000 (22:36 +0000)]
Test removed.

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