]> granicus.if.org Git - clang/log
clang
13 years agoAdd a bit more comments to the BugReporter and friends.
Anna Zaks [Wed, 17 Aug 2011 20:25:08 +0000 (20:25 +0000)]
Add a bit more comments to the BugReporter and friends.

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

13 years ago[libclang] Implicit objc methods are skipped, no need to check isSynthesized.
Argyrios Kyrtzidis [Wed, 17 Aug 2011 20:15:55 +0000 (20:15 +0000)]
[libclang] Implicit objc methods are skipped, no need to check isSynthesized.

Plus, isSynthesized returning true does not mean that there is not a user-declared method declaration.

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

13 years agoMark objc methods that are implicitly declared for properties (not user-declared...
Argyrios Kyrtzidis [Wed, 17 Aug 2011 19:25:08 +0000 (19:25 +0000)]
Mark objc methods that are implicitly declared for properties (not user-declared) as implicit.
This results in libclang ignoring such methods.

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

13 years agoFix -ferror-limit= to properly emit notes following the last error
Douglas Gregor [Wed, 17 Aug 2011 19:13:00 +0000 (19:13 +0000)]
Fix -ferror-limit= to properly emit notes following the last error
messages. Fi from David Blaikie, tests from Nikola Smiljanic!

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

13 years agoFix iterator end for r137842.
Chad Rosier [Wed, 17 Aug 2011 18:51:56 +0000 (18:51 +0000)]
Fix iterator end for r137842.

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

13 years ago[driver] Clang doesn't support -mkernel/-fapple-kext for i386, so it's
Chad Rosier [Wed, 17 Aug 2011 18:24:55 +0000 (18:24 +0000)]
[driver] Clang doesn't support -mkernel/-fapple-kext for i386, so it's
automatically invoking llvm-gcc's cc1plus, which doesn't support all options
supported by Clang.  Therefore, filter out unsupported options.
rdar://9964354

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

13 years agoAdd additional path to Linux toolchain. Patch by Will Dietz. PR10690.
Eli Friedman [Wed, 17 Aug 2011 18:17:26 +0000 (18:17 +0000)]
Add additional path to Linux toolchain.  Patch by Will Dietz.  PR10690.

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

13 years agoAdd Gentoo gcc 4.3.4 include paths
Nico Weber [Wed, 17 Aug 2011 17:55:30 +0000 (17:55 +0000)]
Add Gentoo gcc 4.3.4 include paths

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

13 years ago[python] Fix bug of the SourceLocation binding.
Argyrios Kyrtzidis [Wed, 17 Aug 2011 17:20:24 +0000 (17:20 +0000)]
[python] Fix bug of the SourceLocation binding.
Patch by Anders Waldenborg!

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

13 years ago[python] Add test_type.py by Anders Waldenborg, which I forgot to commit in r137797.
Argyrios Kyrtzidis [Wed, 17 Aug 2011 17:01:10 +0000 (17:01 +0000)]
[python] Add test_type.py by Anders Waldenborg, which I forgot to commit in r137797.

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

13 years agoWhitelist operator== and operator!= as valid for unused value warnings,
Chandler Carruth [Wed, 17 Aug 2011 09:49:44 +0000 (09:49 +0000)]
Whitelist operator== and operator!= as valid for unused value warnings,
even when overloaded and user-defined. These operators are both more
valuable to warn on (due to likely typos) and extremely unlikely to be
reasonable for use to trigger side-effects.

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

13 years agoTreating the unused equality comparisons as something other than part of
Chandler Carruth [Wed, 17 Aug 2011 09:34:37 +0000 (09:34 +0000)]
Treating the unused equality comparisons as something other than part of
-Wunused was a mistake. It resulted in duplicate warnings and lots of
other hacks. Instead, this should be a special sub-category to
-Wunused-value, much like -Wunused-result is.

Moved to -Wunused-comparison, moved the implementation to piggy back on
the -Wunused-value implementation instead of rolling its own, different
mechanism for catching all of the "interesting" statements.

I like the unused-value mechanism for this better, but its currently
missing several top-level statements. For now, I've FIXME-ed out those
test cases. I'll enhance the generic infrastructure to catch these
statements in a subsequent patch.

This patch also removes the cast-to-void fixit hint. This hint isn't
available on any of the other -Wunused-value diagnostics, and if we want
it to be, we should add it generically rather than in one specific case.

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

13 years agoFix this test which had encoded the typo fixed in r137814.
Chandler Carruth [Wed, 17 Aug 2011 08:56:14 +0000 (08:56 +0000)]
Fix this test which had encoded the typo fixed in r137814.

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

13 years agoDon't suggest assignment in implausible situation. We still warn, as the
Chandler Carruth [Wed, 17 Aug 2011 08:38:11 +0000 (08:38 +0000)]
Don't suggest assignment in implausible situation. We still warn, as the
code is very likely to be buggy, but its going to require more
significant changes on the part of the user to correct it in this case.

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

13 years agoIntroduce a new warning, -Wtop-level-comparison. This warning is
Chandler Carruth [Wed, 17 Aug 2011 08:38:04 +0000 (08:38 +0000)]
Introduce a new warning, -Wtop-level-comparison. This warning is
a complement to the warnings we provide in condition expressions. Much
like we warn on conditions such as:

  int x, y;
  ...
  if (x = y) ... // Almost always a typo of '=='

This warning applies the complementary logic to "top-level" statements,
or statements whose value is not consumed or used in some way:

  int x, y;
  ...
  x == y; // Almost always a type for '='

We also mirror the '!=' vs. '|=' logic.

The warning is designed to fire even for overloaded operators for two reasons:

1) Especially in the presence of widespread templates that assume
   operator== and operator!= perform the expected comparison operations,
   it seems unreasonable to suppress warnings on the offchance that
   a user has written a class that abuses these operators, embedding
   side-effects or other magic within them.
2) There is a trivial source modification to silence the warning for
   truly exceptional cases:

     (void)(x == y); // No warning

A (greatly reduced) form of this warning has already caught a number of
bugs in our codebase, so there is precedent for it actually firing. That
said, its currently off by default, but enabled under -Wall.

There are several fixmes left here that I'm working on in follow-up
patches, including de-duplicating warnings from -Wunused, sharing code
with -Wunused's implementation (and creating a nice place to hook
diagnostics on "top-level" statements), and handling cases where a proxy
object with a bool conversion is returned, hiding the operation in the
cleanup AST nodes.

Suggestions for any of this code more than welcome. Also, I'd really
love suggestions for better naming than "top-level".

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

13 years agoHook up -W[no-]analyzer-incompatible-plugin to new warning, and unbreak buildbot.
Jordy Rose [Wed, 17 Aug 2011 06:25:12 +0000 (06:25 +0000)]
Hook up -W[no-]analyzer-incompatible-plugin to new warning, and unbreak buildbot.

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

13 years agoFix typo.
Jordy Rose [Wed, 17 Aug 2011 05:00:56 +0000 (05:00 +0000)]
Fix typo.

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

13 years ago[analyzer] Add a warning for an incompatible plugin version.
Jordy Rose [Wed, 17 Aug 2011 04:56:03 +0000 (04:56 +0000)]
[analyzer] Add a warning for an incompatible plugin version.

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

13 years agoSilence compiler warnings by casting object pointers to function pointers via intptr_t.
Benjamin Kramer [Wed, 17 Aug 2011 04:22:25 +0000 (04:22 +0000)]
Silence compiler warnings by casting object pointers to function pointers via intptr_t.

This is ugly but ISO C++ doesn't allow direct casts.

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

13 years agoDon't use BuiltinBug in analyzer plugin example.
Jordy Rose [Wed, 17 Aug 2011 03:23:51 +0000 (03:23 +0000)]
Don't use BuiltinBug in analyzer plugin example.

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

13 years ago[analyzer] Add some documentation for the new analyzer plugin infrastructure.
Jordy Rose [Wed, 17 Aug 2011 02:15:41 +0000 (02:15 +0000)]
[analyzer] Add some documentation for the new analyzer plugin infrastructure.

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

13 years ago[MSVC] Fix a warning C4334 "'operator' : result of 32-bit shift implicitly converted...
NAKAMURA Takumi [Wed, 17 Aug 2011 01:46:16 +0000 (01:46 +0000)]
[MSVC] Fix a warning C4334 "'operator' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)".

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

13 years ago[analyzer] Add basic support for pluggable checkers.
Jordy Rose [Wed, 17 Aug 2011 01:30:59 +0000 (01:30 +0000)]
[analyzer] Add basic support for pluggable checkers.

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

13 years agoAdd serialization support for ClassScopeFunctionSpecializationDecl.
Francois Pichet [Wed, 17 Aug 2011 01:06:54 +0000 (01:06 +0000)]
Add serialization support for ClassScopeFunctionSpecializationDecl.

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

13 years ago[python] Add support for CXType to python bindings.
Argyrios Kyrtzidis [Wed, 17 Aug 2011 00:43:03 +0000 (00:43 +0000)]
[python] Add support for CXType to python bindings.
Patch by Anders Waldenborg!

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

13 years ago[libclang] Make clang_getCursor able to handle locations that point inside macro...
Argyrios Kyrtzidis [Wed, 17 Aug 2011 00:31:25 +0000 (00:31 +0000)]
[libclang] Make clang_getCursor able to handle locations that point inside macro arguments.

e.g. for:

\define INVOKE(METHOD, CLASS) [CLASS METHOD]

void test2() {
  INVOKE(meth, MyClass);
}

Pointing at 'meth' will give a CXCursor_ObjCMessageExpr and pointing at 'MyClass'
will give a CXCursor_ObjCClassRef.

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

13 years agoMake Lexer::GetBeginningOfToken able to handle macro arg expansion locations.
Argyrios Kyrtzidis [Wed, 17 Aug 2011 00:31:23 +0000 (00:31 +0000)]
Make Lexer::GetBeginningOfToken able to handle macro arg expansion locations.

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

13 years agoIntroduce SourceManager::getMacroArgExpandedLocation function.
Argyrios Kyrtzidis [Wed, 17 Aug 2011 00:31:20 +0000 (00:31 +0000)]
Introduce SourceManager::getMacroArgExpandedLocation function.

If we pass it a source location that points inside a function macro argument,
the returned location will be the macro location in which the argument was expanded.
If a macro argument is used multiple times, the expanded location will
be at the first expansion of the argument.
 e.g.
   MY_MACRO(foo);
             ^
Passing a file location pointing at 'foo', will yield a macro location
where 'foo' was expanded into.

Make SourceManager::getLocation call getMacroArgExpandedLocation as well.

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

13 years agoMake SourceManager::isBeforeInTranslationUnit handle macro locations correctly.
Argyrios Kyrtzidis [Wed, 17 Aug 2011 00:31:18 +0000 (00:31 +0000)]
Make SourceManager::isBeforeInTranslationUnit handle macro locations correctly.

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

13 years ago[PCH] When writing out ExpansionInfo, make sure we don't lose track if it's a macro...
Argyrios Kyrtzidis [Wed, 17 Aug 2011 00:31:14 +0000 (00:31 +0000)]
[PCH] When writing out ExpansionInfo, make sure we don't lose track if it's a macro arg expansion or not.

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

13 years agoSwitch this code to use the more idiomatic 'dyn_cast' pattern.
Chandler Carruth [Tue, 16 Aug 2011 22:30:10 +0000 (22:30 +0000)]
Switch this code to use the more idiomatic 'dyn_cast' pattern.

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

13 years agoMigrate test from llvm/test/FrontendC++.
Eric Christopher [Tue, 16 Aug 2011 21:41:54 +0000 (21:41 +0000)]
Migrate test from llvm/test/FrontendC++.

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

13 years agoMigrate from llvm/test/FrontendC++ and FileCheckize.
Eric Christopher [Tue, 16 Aug 2011 21:41:52 +0000 (21:41 +0000)]
Migrate from llvm/test/FrontendC++ and FileCheckize.

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

13 years agoMigrate from llvm/test/FrontendC++.
Eric Christopher [Tue, 16 Aug 2011 21:41:50 +0000 (21:41 +0000)]
Migrate from llvm/test/FrontendC++.

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

13 years agoMigrate test from llvm/test/FrontendC++ and FileCheckize.
Eric Christopher [Tue, 16 Aug 2011 21:41:48 +0000 (21:41 +0000)]
Migrate test from llvm/test/FrontendC++ and FileCheckize.

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

13 years agoMigrate test from llvm/test/FrontendC++.
Eric Christopher [Tue, 16 Aug 2011 21:41:46 +0000 (21:41 +0000)]
Migrate test from llvm/test/FrontendC++.

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

13 years agoMigrate from llvm/test/FrontendC++.
Eric Christopher [Tue, 16 Aug 2011 21:41:44 +0000 (21:41 +0000)]
Migrate from llvm/test/FrontendC++.

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

13 years agoMigrate from llvm/test/FrontendC++.
Eric Christopher [Tue, 16 Aug 2011 21:41:41 +0000 (21:41 +0000)]
Migrate from llvm/test/FrontendC++.

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

13 years agoMigrate test from llvm/test/FrontendC++.
Eric Christopher [Tue, 16 Aug 2011 21:41:40 +0000 (21:41 +0000)]
Migrate test from llvm/test/FrontendC++.

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

13 years agoMigrate from llvm/test/FrontendC++.
Eric Christopher [Tue, 16 Aug 2011 21:41:38 +0000 (21:41 +0000)]
Migrate from llvm/test/FrontendC++.

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

13 years agoMigrate varargs.cpp from llvm/test/FrontendC++.
Eric Christopher [Tue, 16 Aug 2011 21:41:35 +0000 (21:41 +0000)]
Migrate varargs.cpp from llvm/test/FrontendC++.

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

13 years agoMigrate weak-external.cpp from llvm/test/FrontendC++.
Eric Christopher [Tue, 16 Aug 2011 21:41:33 +0000 (21:41 +0000)]
Migrate weak-external.cpp from llvm/test/FrontendC++.

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

13 years agoMigrate x86-64-abi-sret-vs-2word-struct-param.cpp from
Eric Christopher [Tue, 16 Aug 2011 21:41:31 +0000 (21:41 +0000)]
Migrate x86-64-abi-sret-vs-2word-struct-param.cpp from
llvm/test/FrontendC++ and FileCheckize.

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

13 years agoMigrate thunk-linkonce-odr.cpp from llvm/test/FrontendC++.
Eric Christopher [Tue, 16 Aug 2011 21:41:26 +0000 (21:41 +0000)]
Migrate thunk-linkonce-odr.cpp from llvm/test/FrontendC++.

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

13 years ago[analyzer] teach ExprEngine about loads from static C++ class fields. Fixes <rdar...
Ted Kremenek [Tue, 16 Aug 2011 21:37:52 +0000 (21:37 +0000)]
[analyzer] teach ExprEngine about loads from static C++ class fields.  Fixes <rdar://problem/9948787>.

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

13 years ago[analyzer] Overhaul of checker registration in preparation for basic plugin support...
Jordy Rose [Tue, 16 Aug 2011 21:24:21 +0000 (21:24 +0000)]
[analyzer] Overhaul of checker registration in preparation for basic plugin support. Removes support for checker groups (we can add them back in later if we decide they are still useful), and -analyzer-checker-help output is a little worse for the time being (no packages).

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

13 years agoRobustify test, there is no need to check metadata number which can change.
Devang Patel [Tue, 16 Aug 2011 21:01:06 +0000 (21:01 +0000)]
Robustify test, there is no need to check metadata number which can change.

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

13 years agoFinalize debug info after all deferred globals are emitted.
Devang Patel [Tue, 16 Aug 2011 20:58:22 +0000 (20:58 +0000)]
Finalize debug info after all deferred globals are emitted.

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

13 years agoMacOSKeychainAPIChecker: Turn it on by default.
Anna Zaks [Tue, 16 Aug 2011 20:02:05 +0000 (20:02 +0000)]
MacOSKeychainAPIChecker: Turn it on by default.

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

13 years agoUpdate createMCAsmParser() to match r137735.
Jim Grosbach [Tue, 16 Aug 2011 18:33:55 +0000 (18:33 +0000)]
Update createMCAsmParser() to match r137735.

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

13 years agoMacOSKeychainAPIChecker: Do not report double allocation if first allocation returned...
Anna Zaks [Tue, 16 Aug 2011 16:30:24 +0000 (16:30 +0000)]
MacOSKeychainAPIChecker: Do not report double allocation if first allocation returned an error.

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

13 years ago[analyzer] Enhance ConditionVisitor to handle arbitrary ValueDecls in binary expressi...
Ted Kremenek [Tue, 16 Aug 2011 10:57:37 +0000 (10:57 +0000)]
[analyzer] Enhance ConditionVisitor to handle arbitrary ValueDecls in binary expressions, and also handle inverting the order of comparison when the named decl appears on the RHS.

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

13 years agoCMake: "clang-test" may not depend on check.deps.
NAKAMURA Takumi [Tue, 16 Aug 2011 03:45:31 +0000 (03:45 +0000)]
CMake: "clang-test" may not depend on check.deps.

...I believe it would not break anything...

FIXME: "check-all" may not be generated w/o LLVM_INCLUDE_TESTS.

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

13 years ago[analyzer] fix operation inversion calculation in ConditionVisitor.
Ted Kremenek [Tue, 16 Aug 2011 03:44:38 +0000 (03:44 +0000)]
[analyzer] fix operation inversion calculation in ConditionVisitor.

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

13 years ago[analyzer] Enhance ConditionVisitor to understand eagerly evaluated (simple) binary...
Ted Kremenek [Tue, 16 Aug 2011 01:53:41 +0000 (01:53 +0000)]
[analyzer] Enhance ConditionVisitor to understand eagerly evaluated (simple) binary conditions, and teach it to only focus on constraint changes.

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

13 years ago[analyzer] add ExprEngine::getEagerlyAssumedTags() to allow externally querying of...
Ted Kremenek [Tue, 16 Aug 2011 01:53:39 +0000 (01:53 +0000)]
[analyzer] add ExprEngine::getEagerlyAssumedTags() to allow externally querying of "eagerly assumed" expressions.

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

13 years ago[analyzer] Remove PostStmtCustom ProgramPoint. It can be represented using tagged...
Ted Kremenek [Tue, 16 Aug 2011 00:49:19 +0000 (00:49 +0000)]
[analyzer] Remove PostStmtCustom ProgramPoint.  It can be represented using tagged PostStmts.

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

13 years agoFix tests for non-darwin hosts.
Argyrios Kyrtzidis [Mon, 15 Aug 2011 23:43:33 +0000 (23:43 +0000)]
Fix tests for non-darwin hosts.

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

13 years agoMove test from llvm/test/FrontendCXX and update.
Eric Christopher [Mon, 15 Aug 2011 23:24:31 +0000 (23:24 +0000)]
Move test from llvm/test/FrontendCXX and update.

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

13 years agoMacOSKeychainAPIChecker: The security API/memory leak checker should always generate...
Anna Zaks [Mon, 15 Aug 2011 23:23:15 +0000 (23:23 +0000)]
MacOSKeychainAPIChecker: The security API/memory leak checker should always generate regular nodes instead of sink nodes.

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

13 years agoAdd ProgramState.cpp.
Ted Kremenek [Mon, 15 Aug 2011 23:05:22 +0000 (23:05 +0000)]
Add ProgramState.cpp.

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

13 years agoAdd missing header files.
Ted Kremenek [Mon, 15 Aug 2011 23:03:51 +0000 (23:03 +0000)]
Add missing header files.

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

13 years agoUse new DIBuilder::finalize() at the end to wrap up debug info encoding for a transla...
Devang Patel [Mon, 15 Aug 2011 23:01:55 +0000 (23:01 +0000)]
Use new DIBuilder::finalize() at the end to wrap up debug info encoding for a translation unit.

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

13 years agoFileCheckize this test.
Eric Christopher [Mon, 15 Aug 2011 22:48:14 +0000 (22:48 +0000)]
FileCheckize this test.

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

13 years ago[libclang] Require explicit cursor visitation for all TypeLocs (compilation will
Argyrios Kyrtzidis [Mon, 15 Aug 2011 22:40:24 +0000 (22:40 +0000)]
[libclang] Require explicit cursor visitation for all TypeLocs (compilation will
fail if a TypeLoc kind is not handled) and handle DecltypeTypeLoc and InjectedClassNameTypeLoc.

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

13 years ago'pure' and 'const' functions should also be marked nounwind. Migrate
Eric Christopher [Mon, 15 Aug 2011 22:38:22 +0000 (22:38 +0000)]
'pure' and 'const' functions should also be marked nounwind. Migrate
test over from llvm/test/FrontendC++ and update others to account for
the change.

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

13 years agoTake 2 (take 3?) at removing derelict clang.xcodeproj. All Xcode users should be...
Ted Kremenek [Mon, 15 Aug 2011 22:10:47 +0000 (22:10 +0000)]
Take 2 (take 3?) at removing derelict clang.xcodeproj.  All Xcode users should be using CMake, as the clang.xcodeproj is never up-to-date and cannot actually build Clang.

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

13 years agoRename GRState to ProgramState, and cleanup some code formatting along the way.
Ted Kremenek [Mon, 15 Aug 2011 22:09:50 +0000 (22:09 +0000)]
Rename GRState to ProgramState, and cleanup some code formatting along the way.

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

13 years agoFix the buildbot test.
Argyrios Kyrtzidis [Mon, 15 Aug 2011 21:45:01 +0000 (21:45 +0000)]
Fix the buildbot test.

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

13 years agoTrack in the AST whether a function is constexpr.
Richard Smith [Mon, 15 Aug 2011 21:04:07 +0000 (21:04 +0000)]
Track in the AST whether a function is constexpr.

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

13 years agoMake -findirect-virtual-calls and -fterminated-vtables aliases of -fapple-kext.
Bob Wilson [Mon, 15 Aug 2011 19:13:06 +0000 (19:13 +0000)]
Make -findirect-virtual-calls and -fterminated-vtables aliases of -fapple-kext.
Outside the driver, they were already treated that way, but the driver was not
giving them the same special treatment as -fapple-kext, e.g., falling back to
llvm-gcc for i386/Darwin kexts.  Radar 9868422.

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

13 years agoRemove duplicate option.
Bob Wilson [Mon, 15 Aug 2011 19:13:02 +0000 (19:13 +0000)]
Remove duplicate option.

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

13 years ago[libclang] Handle AttributedTypeLoc for cursor visitation. Fixes rdar://9535717.
Argyrios Kyrtzidis [Mon, 15 Aug 2011 18:44:43 +0000 (18:44 +0000)]
[libclang] Handle AttributedTypeLoc for cursor visitation. Fixes rdar://9535717.

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

13 years agoMacOSKeychainAPIChecker: Use llvm::SmallString instead of std::string (as per code...
Anna Zaks [Mon, 15 Aug 2011 18:42:00 +0000 (18:42 +0000)]
MacOSKeychainAPIChecker: Use llvm::SmallString instead of std::string (as per code review for r137523).

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

13 years agoAdd fixit notes for -Wconstant-logical-operand.
Matt Beaumont-Gay [Mon, 15 Aug 2011 17:50:06 +0000 (17:50 +0000)]
Add fixit notes for -Wconstant-logical-operand.

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

13 years agoTeach reference initialization from the result of a user-defined
Douglas Gregor [Mon, 15 Aug 2011 13:59:46 +0000 (13:59 +0000)]
Teach reference initialization from the result of a user-defined
conversion to initialize the standard conversion *after* the
user-defined conversion properly. Fixes PR10644.

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

13 years agofix typo in test.
Francois Pichet [Sun, 14 Aug 2011 22:30:29 +0000 (22:30 +0000)]
fix typo in test.

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

13 years agoAnother typo found by Nico; Doug also warned me about it, but I didn't listen to...
Francois Pichet [Sun, 14 Aug 2011 21:38:35 +0000 (21:38 +0000)]
Another typo found by Nico; Doug also warned me about it, but I didn't listen to him.

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

13 years agoFix typo.
Francois Pichet [Sun, 14 Aug 2011 14:28:49 +0000 (14:28 +0000)]
Fix typo.

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

13 years agoFix r137086 to actually work properly in general. PR10650.
Eli Friedman [Sun, 14 Aug 2011 04:50:34 +0000 (04:50 +0000)]
Fix r137086 to actually work properly in general.  PR10650.

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

13 years agoImplement function template specialization at class scope extension in Microsoft...
Francois Pichet [Sun, 14 Aug 2011 03:52:19 +0000 (03:52 +0000)]
Implement function template specialization at class scope extension in Microsoft mode. A new AST node is introduced: ClassScopeFunctionSpecialization. This node holds a FunctionDecl that is not yet specialized; then during the class template instantiation the ClassScopeFunctionSpecialization will spawn the actual function specialization.

Example:
template <class T>
class A {
public:
  template <class U> void f(U p) {  }
  template <> void f(int p) {  } // <== class scope specialization
};

This extension is necessary to parse MSVC standard C++ headers, MFC and ATL code.
BTW, with this feature in, clang can parse (-fsyntax-only) all the MSVC 2010 standard header files without any error.

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

13 years agoFix "Uninitialized" warnings on g++-4.4.
NAKAMURA Takumi [Sun, 14 Aug 2011 00:37:22 +0000 (00:37 +0000)]
Fix "Uninitialized" warnings on g++-4.4.

In fact, they are false warnings but it seems g++-4.4 might be unable to know they must be false.

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

13 years agoReject -mkernel for i386/Darwin C++ code; fall back to llvm-gcc instead.
Bob Wilson [Sat, 13 Aug 2011 23:48:55 +0000 (23:48 +0000)]
Reject -mkernel for i386/Darwin C++ code; fall back to llvm-gcc instead.
Since -mkernel implies -fapple-kext, this just extends the current behavior
for -fapple-kext to apply for -mkernel as well.  Radar 9933387.

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

13 years agoAdd support of -x objc-cpp-output, -x objc++-cpp-output to the Driver.
Nico Weber [Sat, 13 Aug 2011 23:13:37 +0000 (23:13 +0000)]
Add support of -x objc-cpp-output, -x objc++-cpp-output to the Driver.

Matches gcc, and is also required for using ccache with clang.

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

13 years agoAccept -x objc++-cpp-output as an alias for -x objective-c++-cpp-output
Nico Weber [Sat, 13 Aug 2011 19:03:50 +0000 (19:03 +0000)]
Accept -x objc++-cpp-output as an alias for -x objective-c++-cpp-output

This is the ObjC++ version of r129201. It's for example needed to use
ccache with clang.

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

13 years agoFix C++0x narrowing conversion errors in Clang.
Jeffrey Yasskin [Sat, 13 Aug 2011 05:47:04 +0000 (05:47 +0000)]
Fix C++0x narrowing conversion errors in Clang.

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

13 years agoMove handling of vget_lane/vset_lane before the code that checks the type.
Bob Wilson [Sat, 13 Aug 2011 05:03:46 +0000 (05:03 +0000)]
Move handling of vget_lane/vset_lane before the code that checks the type.

Unlike most of the other Neon intrinsics, these are not overloaded and do not
have the extra argument that specifies the vector type.  This has not been
fatal because the lane number operand is supposed to be an ICE and so that
value has harmlessly been used as the type identifier.  Radar 9901281.

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

13 years agoMacOSKeychainAPIChecker: Test all APIs.
Anna Zaks [Sat, 13 Aug 2011 02:10:15 +0000 (02:10 +0000)]
MacOSKeychainAPIChecker: Test all APIs.

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

13 years ago[driver] Make sure to update the iterator end when erasing for Args.
Chad Rosier [Fri, 12 Aug 2011 23:38:19 +0000 (23:38 +0000)]
[driver] Make sure to update the iterator end when erasing for Args.

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

13 years agoCleanup various declarations of 'Stmt*' to be 'Stmt *', etc. in libAnalyzer and libSt...
Ted Kremenek [Fri, 12 Aug 2011 23:37:29 +0000 (23:37 +0000)]
Cleanup various declarations of 'Stmt*' to be 'Stmt *', etc. in libAnalyzer and libStaticAnalyzer[*].  It was highly inconsistent, and very ugly to look at.

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

13 years agoUpdate clang tests for r137527.
Eli Friedman [Fri, 12 Aug 2011 23:33:52 +0000 (23:33 +0000)]
Update clang tests for r137527.

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

13 years ago[driver] When generating clang failure diagnostics, don't try to preprocess
Chad Rosier [Fri, 12 Aug 2011 23:30:05 +0000 (23:30 +0000)]
[driver] When generating clang failure diagnostics, don't try to preprocess
inputs that aren't preprocessable.

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

13 years agoReturn the proper type for objects when given a .o extension.
Chad Rosier [Fri, 12 Aug 2011 23:16:53 +0000 (23:16 +0000)]
Return the proper type for objects when given a .o extension.

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

13 years agoDocument purpose of ProgramPointTag::getTagKind().
Ted Kremenek [Fri, 12 Aug 2011 23:06:47 +0000 (23:06 +0000)]
Document purpose of ProgramPointTag::getTagKind().

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

13 years ago[analyzer] change "tag" in ProgramPoint from "void*" to a ProgramPointTag*.
Ted Kremenek [Fri, 12 Aug 2011 23:04:46 +0000 (23:04 +0000)]
[analyzer] change "tag" in ProgramPoint from "void*" to a ProgramPointTag*.

Having a notion of an actual ProgramPointTag will aid in introspection of the analyzer's behavior.
For example, the GraphViz output of the analyzer will pretty-print the tags in a useful manner.

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

13 years agoMacOSKeychainAPIChecker: If the allocated data address entered as an enclosing functi...
Anna Zaks [Fri, 12 Aug 2011 22:47:22 +0000 (22:47 +0000)]
MacOSKeychainAPIChecker: If the allocated data address entered as an enclosing function parameter, skip it to avoid false positives.

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

13 years ago[driver] Refactor a bit to enable a few fixes when generating diagnostics. No functi...
Chad Rosier [Fri, 12 Aug 2011 22:08:57 +0000 (22:08 +0000)]
[driver] Refactor a bit to enable a few fixes when generating diagnostics.  No functional change intended.

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

13 years agoMacOSKeychainAPIChecker:
Anna Zaks [Fri, 12 Aug 2011 21:56:43 +0000 (21:56 +0000)]
MacOSKeychainAPIChecker:
Report errors earlier: on checkDeadSymbols() and clear the state after the symbol we are tracking goes out of scope.

Also, perform lazy error checking. Instead of forcing the paths to be split depending one the return value of the allocator, make the return symbol depend on the allocated data symbol, which prolongs its life span to the time when the allocated data symbol becomes dead.

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

13 years ago[analyzer] Nitpicks on Olaf's patch, which I meant to e-mail but then didn't in
Jordy Rose [Fri, 12 Aug 2011 21:41:07 +0000 (21:41 +0000)]
[analyzer] Nitpicks on Olaf's patch, which I meant to e-mail but then didn't in
time. One is cleanup, the other is me being OCD about enum group nesting.

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

13 years agoMacOSKeychainAPIChecker: There is no need to use SymbolMetadata to represent the...
Anna Zaks [Fri, 12 Aug 2011 21:14:26 +0000 (21:14 +0000)]
MacOSKeychainAPIChecker: There is no need to use SymbolMetadata to represent the allocated data symbol, we can just use the symbol corresponding to the SymbolicRegion. This simplifies tracking of the symbol, for example, SymbolMetadata needs to go through extra hoops to stay alive.

Make AllocationState internal to the MacOSKeychainAPIChecker class.

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