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

14 years agoDecl::CheckAccessDeclContext() keeps asserting. Access is not set in some cases.
Argyrios Kyrtzidis [Wed, 8 Sep 2010 21:58:42 +0000 (21:58 +0000)]
Decl::CheckAccessDeclContext() keeps asserting. Access is not set in some cases.

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

14 years agoRemoved test case.
Fariborz Jahanian [Wed, 8 Sep 2010 21:55:57 +0000 (21:55 +0000)]
Removed test case.

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

14 years agoClean up some of the CMake dependencies
Douglas Gregor [Wed, 8 Sep 2010 21:40:53 +0000 (21:40 +0000)]
Clean up some of the CMake dependencies

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

14 years agoUse the new-initialization code for initializing scalars with a
Douglas Gregor [Wed, 8 Sep 2010 21:40:08 +0000 (21:40 +0000)]
Use the new-initialization code for initializing scalars with a
function-style cast. Previously, we had a (redundant, incorrect)
semantic-checking path for non-class types, which allowed
value-initialization of a reference type and then crashed.

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

14 years agoReverse r113397 until we decide what to do with
Fariborz Jahanian [Wed, 8 Sep 2010 21:36:35 +0000 (21:36 +0000)]
Reverse r113397 until we decide what to do with
use of 'struct objc_object*' for 'is' (and others)
in clang.

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

14 years agoRe-enable CheckAccessDeclContext and make sure it doesn't trigger assertions.
Argyrios Kyrtzidis [Wed, 8 Sep 2010 21:32:35 +0000 (21:32 +0000)]
Re-enable CheckAccessDeclContext and make sure it doesn't trigger assertions.

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

14 years agoInitialize the MSVCGuidDecl variable in the correct order.
Bill Wendling [Wed, 8 Sep 2010 21:30:16 +0000 (21:30 +0000)]
Initialize the MSVCGuidDecl variable in the correct order.

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

14 years agoFix a crash when overloading id with objc_object*.
Fariborz Jahanian [Wed, 8 Sep 2010 20:08:18 +0000 (20:08 +0000)]
Fix a crash when overloading id with objc_object*.
Radar 8400356.

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

14 years agoFix C++ PCH issues.
Argyrios Kyrtzidis [Wed, 8 Sep 2010 19:31:22 +0000 (19:31 +0000)]
Fix C++ PCH issues.

PCH got a severe beating by the boost-using test case reported here: http://llvm.org/PR8099
Fix issues like:

-When PCH reading, make sure Decl's getASTContext() doesn't get called since a Decl in the parent hierarchy may be initializing.
-In ASTDeclReader::VisitFunctionDecl VisitRedeclarable should be called before using FunctionDecl's isCanonicalDecl()
-In ASTDeclReader::VisitRedeclarableTemplateDecl CommonOrPrev must be initialized before anything else.

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

14 years agoFrontend/-H: Add comment on why I used a temporary string here.
Daniel Dunbar [Wed, 8 Sep 2010 18:19:55 +0000 (18:19 +0000)]
Frontend/-H: Add comment on why I used a temporary string here.

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

14 years agoMicrosoft's __uuidof operator implementation part 1.
Francois Pichet [Wed, 8 Sep 2010 12:20:18 +0000 (12:20 +0000)]
Microsoft's __uuidof operator implementation part 1.

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

14 years agoAllow type definitions inside anonymous struct/union in Microsoft mode.
Francois Pichet [Wed, 8 Sep 2010 11:32:25 +0000 (11:32 +0000)]
Allow type definitions inside anonymous struct/union in Microsoft mode.

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

14 years agoDon't give 'global constructor' warnings for function statics, even if they have...
Sebastian Redl [Wed, 8 Sep 2010 04:46:19 +0000 (04:46 +0000)]
Don't give 'global constructor' warnings for function statics, even if they have a direct initializer. Fixes PR8095.

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

14 years agoPut the tautological-comparison-of-unsigned-against-zero warnings in
John McCall [Wed, 8 Sep 2010 02:01:27 +0000 (02:01 +0000)]
Put the tautological-comparison-of-unsigned-against-zero warnings in
-Wtautological-compare instead of -Wsign-compare, which also implies turning
them on by default.

Restoration of r112877.

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

14 years agoImplement ARM static local initialization guards, which are more compact than
John McCall [Wed, 8 Sep 2010 01:44:27 +0000 (01:44 +0000)]
Implement ARM static local initialization guards, which are more compact than
Itanium guards and use a slightly different compiled-in API.

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

14 years agoAllow (cv) void and incomplete arrays to be passed to the type traits.
Sebastian Redl [Wed, 8 Sep 2010 00:48:43 +0000 (00:48 +0000)]
Allow (cv) void and incomplete arrays to be passed to the type traits.

Fixes PR8110, and thus PR8109, PR8097, and parts of PR8101, PR8105 and PR8107. Only a few traits have tests for incomplete arrays, since I'm not yet clear what the result for them should be; Howards wants to file a DR to change the standard.

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

14 years agoadd a fixit when 'main' does ot return 'int'; review welcome
Gabor Greif [Wed, 8 Sep 2010 00:31:13 +0000 (00:31 +0000)]
add a fixit when 'main' does ot return 'int'; review welcome

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