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

13 years agoConversions to bool count as integer conversions for the purposes of
Jeffrey Yasskin [Fri, 12 Aug 2011 20:56:43 +0000 (20:56 +0000)]
Conversions to bool count as integer conversions for the purposes of
the C++0x narrowing error.

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

13 years agometadata generated by the compiler does not include the weak
Fariborz Jahanian [Fri, 12 Aug 2011 20:47:08 +0000 (20:47 +0000)]
metadata generated by the compiler does not include the weak
attribute of a property. patch by Remy Demarest fixes it.

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

13 years agoPlace err_cfstring_literal_not_string_constant and warn_cfstring_truncated under...
Ted Kremenek [Fri, 12 Aug 2011 20:46:54 +0000 (20:46 +0000)]
Place err_cfstring_literal_not_string_constant and warn_cfstring_truncated under "-WCFString" flag.

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

13 years agoPlace diagnostic warn_stringcompare under the "-Wstring-compare" flag.
Ted Kremenek [Fri, 12 Aug 2011 20:46:52 +0000 (20:46 +0000)]
Place diagnostic warn_stringcompare under the "-Wstring-compare" flag.

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

13 years agoPlace warnings related to incorrect "main()" declaration under "-Wmain".
Ted Kremenek [Fri, 12 Aug 2011 20:46:49 +0000 (20:46 +0000)]
Place warnings related to incorrect "main()" declaration under "-Wmain".

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

13 years agoAdd -Wtypename-missing flag for diagnostic warn_typename_missing.
Ted Kremenek [Fri, 12 Aug 2011 20:46:45 +0000 (20:46 +0000)]
Add -Wtypename-missing flag for diagnostic warn_typename_missing.

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

13 years ago[analyzer] Introduce new MemRegion, "TypedValueRegion", so that we can separate Typed...
Ted Kremenek [Fri, 12 Aug 2011 20:02:48 +0000 (20:02 +0000)]
[analyzer] Introduce new MemRegion, "TypedValueRegion", so that we can separate TypedRegions that implement getValueType() from those that don't.

Patch by Olaf Krzikalla!

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

13 years agoFix some comments.
Richard Smith [Fri, 12 Aug 2011 18:44:32 +0000 (18:44 +0000)]
Fix some comments.

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

13 years agoswitch clang to use the new-new way of creating llvm::StructType's.
Chris Lattner [Fri, 12 Aug 2011 17:43:31 +0000 (17:43 +0000)]
switch clang to use the new-new way of creating llvm::StructType's.

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

13 years agoOverriding the predefined Protocol isn't something that's actually
Douglas Gregor [Fri, 12 Aug 2011 17:09:30 +0000 (17:09 +0000)]
Overriding the predefined Protocol isn't something that's actually
done and is likely to not work well anyway; take away this unnecessary
complexity.

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

13 years agoRevert "Fix crash in CFGBuilder involving implicit destructor calls and gotos jumping...
Ted Kremenek [Fri, 12 Aug 2011 14:41:23 +0000 (14:41 +0000)]
Revert "Fix crash in CFGBuilder involving implicit destructor calls and gotos jumping after an object was declared.  Fixes PR 10620."

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

13 years agoSwitch the __int128_t and __uint128_t types over to predefined types
Douglas Gregor [Fri, 12 Aug 2011 06:49:56 +0000 (06:49 +0000)]
Switch the __int128_t and __uint128_t types over to predefined types
in the AST format, which are built lazily by the ASTContext when
requested.

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

13 years agodocs/doxygen.css: Import .memitem, .memproto and .memdoc from llvm/doxygen.
NAKAMURA Takumi [Fri, 12 Aug 2011 06:24:04 +0000 (06:24 +0000)]
docs/doxygen.css: Import .memitem, .memproto and .memdoc from llvm/doxygen.

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

13 years agoSwitch the Objective-C 'SEL' type over to a predefined type in the
Douglas Gregor [Fri, 12 Aug 2011 06:17:30 +0000 (06:17 +0000)]
Switch the Objective-C 'SEL' type over to a predefined type in the
AST file format, lazily generating the actual declaration in
ASTContext as needed.

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

13 years agoSwitch the Objective-C 'Class' type over to a predefined type in the
Douglas Gregor [Fri, 12 Aug 2011 05:59:41 +0000 (05:59 +0000)]
Switch the Objective-C 'Class' type over to a predefined type in the
AST file format, lazily generating the actual declaration in
ASTContext as needed.

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

13 years agoDe-Unicode-ify.
NAKAMURA Takumi [Fri, 12 Aug 2011 05:49:51 +0000 (05:49 +0000)]
De-Unicode-ify.

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

13 years agoMove the creation of the predefined typedef for Objective-C's 'id'
Douglas Gregor [Fri, 12 Aug 2011 05:46:01 +0000 (05:46 +0000)]
Move the creation of the predefined typedef for Objective-C's 'id'
type over into the AST context, then make that declaration a
predefined declaration in the AST format. This ensures that different
AST files will at least agree on the (global) declaration ID for 'id',
and eliminates one of the "special" types in the AST file format.

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

13 years agoFix a raw string literal test case to actually use a raw string literal.
Craig Topper [Fri, 12 Aug 2011 04:09:37 +0000 (04:09 +0000)]
Fix a raw string literal test case to actually use a raw string literal.

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

13 years agoFix crash in CFGBuilder involving implicit destructor calls and gotos jumping after...
Ted Kremenek [Fri, 12 Aug 2011 04:09:00 +0000 (04:09 +0000)]
Fix crash in CFGBuilder involving implicit destructor calls and gotos jumping after an object was declared.  Fixes PR 10620.

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

13 years agoFix a couple raw string literal tests
Craig Topper [Fri, 12 Aug 2011 03:20:18 +0000 (03:20 +0000)]
Fix a couple raw string literal tests

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

13 years agoAlignment of a va_arg must be at least as large as the ABI's minimum alignment.
Akira Hatanaka [Fri, 12 Aug 2011 02:30:14 +0000 (02:30 +0000)]
Alignment of a va_arg must be at least as large as the ABI's minimum alignment.

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

13 years agoinclude/clang/Config/config.h.cmake: Reorder and reword to follow (generated) llvm...
NAKAMURA Takumi [Fri, 12 Aug 2011 01:56:14 +0000 (01:56 +0000)]
include/clang/Config/config.h.cmake: Reorder and reword to follow (generated) llvm/Config/config.h.in.

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

13 years agoAdd definition of a static member of a class.
Akira Hatanaka [Fri, 12 Aug 2011 01:43:14 +0000 (01:43 +0000)]
Add definition of a static member of a class.

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

13 years agoCollapse ASTWriter::WriteASTChain into ASTWriter::WriteASTCore,
Douglas Gregor [Fri, 12 Aug 2011 01:39:19 +0000 (01:39 +0000)]
Collapse ASTWriter::WriteASTChain into ASTWriter::WriteASTCore,
eliminating a pile of redundant code (and probably some bugs in the
process). The variation between chained and non-chained PCH is fairly
small now anyway.

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

13 years agoRemove extra semicolons.
Bill Wendling [Fri, 12 Aug 2011 01:29:32 +0000 (01:29 +0000)]
Remove extra semicolons.

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

13 years agoThe diagtool registration system tries to use a global variable from a method
Nick Lewycky [Fri, 12 Aug 2011 01:14:22 +0000 (01:14 +0000)]
The diagtool registration system tries to use a global variable from a method
called on another global variable. Use ManagedStatic to ensure that the global
we register with actually exists when we need it.

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

13 years agoOptimizations for Dependent Symbol tracking (as per Ted's code review for r137309):
Anna Zaks [Fri, 12 Aug 2011 00:34:56 +0000 (00:34 +0000)]
Optimizations for Dependent Symbol tracking (as per Ted's code review for r137309):

1) Change SymbolDependTy map to keep pointers as data. And other small tweaks like making the DenseMap smaller 64->16 elements; remove removeSymbolDependencies() as it will probably not be used.

2) Do not mark dependents live more then once.

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

13 years agoIn the serialized AST format, make the translation unit a "predefined"
Douglas Gregor [Fri, 12 Aug 2011 00:15:20 +0000 (00:15 +0000)]
In the serialized AST format, make the translation unit a "predefined"
declaration that never actually gets serialized. Instead, serialize
the various kinds of update records (lexical decls, visible decls, the
addition of an anonymous namespace) for the translation unit, even if
we're not chaining. This way, we won't have to deal with multiple
loaded translation unit declarations.

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

13 years agoFix a PCH crash bug where we kept a reference inside a DenseMap while the map was...
Argyrios Kyrtzidis [Thu, 11 Aug 2011 23:26:42 +0000 (23:26 +0000)]
Fix a PCH crash bug where we kept a reference inside a DenseMap while the map was getting modified.

No test case, sorry. It's one of those bugs where it's really really hard to make one. rdar://9910862.

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

13 years agoscan-build: enable C++ support by default.
Ted Kremenek [Thu, 11 Aug 2011 22:47:20 +0000 (22:47 +0000)]
scan-build: enable C++ support by default.

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

13 years agoThe current warning in -Wnull-arithmetic for comparisons between NULL and non-pointer...
Richard Trieu [Thu, 11 Aug 2011 22:38:21 +0000 (22:38 +0000)]
The current warning in -Wnull-arithmetic for comparisons between NULL and non-pointers is not very helpful.  This patch will update the wording to be more helpful to users.

Old warning:

warning: use of NULL in arithmetic operation [-Wnull-arithmetic]
  return 10 <= NULL;
            ^  ~~~~

New warning:

warning: comparison between NULL and non-pointer ('int' and NULL) [-Wnull-arithmetic]
  return 10 <= NULL;
         ~~ ^  ~~~~

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

13 years agoWhen initializing a context from a particular AST file, check whether
Douglas Gregor [Thu, 11 Aug 2011 22:18:49 +0000 (22:18 +0000)]
When initializing a context from a particular AST file, check whether
either "special" type has already been initialized. Previously, we did
this check based on just the first special type (__builtin_va_list),
but now we have some NULL special type entries to content with.

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

13 years agoAdd diagtool-based test where we enforce that no additional warnings can be added...
Ted Kremenek [Thu, 11 Aug 2011 22:06:55 +0000 (22:06 +0000)]
Add diagtool-based test where we enforce that no additional warnings can be added to Clang without a -W flag.

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

13 years agoThe AST reader and writer don't need accessors for poking at the predefined Objective...
Douglas Gregor [Thu, 11 Aug 2011 22:04:35 +0000 (22:04 +0000)]
The AST reader and writer don't need accessors for poking at the predefined Objective-C types

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

13 years agoEncapsulate the Objective-C id/Class/SEL "redefinition" types in
Douglas Gregor [Thu, 11 Aug 2011 20:58:55 +0000 (20:58 +0000)]
Encapsulate the Objective-C id/Class/SEL "redefinition" types in
ASTContext with accessors/mutators. The only functional change is that
the AST writer won't bother writing the id/Class/SEL redefinition type
if it hasn't been explicitly set; previously, it ended up being
written as a synonym for the built-in id/Class/SEL.

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

13 years agoExtended the AST importer to support ParenTypes.
Sean Callanan [Thu, 11 Aug 2011 16:56:07 +0000 (16:56 +0000)]
Extended the AST importer to support ParenTypes.
This is necessary to support importing certain
function pointer types.

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

13 years agoAnalyzer Core: Adding support for user-defined symbol dependencies. (For example...
Anna Zaks [Thu, 11 Aug 2011 16:43:28 +0000 (16:43 +0000)]
Analyzer Core: Adding support for user-defined symbol dependencies. (For example, the allocated resource symbol only needs to be freed if no error has been returned by the allocator, so a checker might want to make the lifespan of the error code symbol depend on the allocated resource symbol.) Note, by default, the map that holds the dependencies will get destroyed along with the SymbolManager at the end of function exploration.

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

13 years agoAdd tests for string literal concatenation.
Craig Topper [Thu, 11 Aug 2011 05:57:09 +0000 (05:57 +0000)]
Add tests for string literal concatenation.

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

13 years agoRaw string followup. Pass a couple StringRefs by value.
Craig Topper [Thu, 11 Aug 2011 05:10:55 +0000 (05:10 +0000)]
Raw string followup. Pass a couple StringRefs by value.

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

13 years agoUpdate C++0x status page to reflect support for raw string literals.
Craig Topper [Thu, 11 Aug 2011 04:09:26 +0000 (04:09 +0000)]
Update C++0x status page to reflect support for raw string literals.

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

13 years agoAdd support for C++0x raw string literals.
Craig Topper [Thu, 11 Aug 2011 04:06:15 +0000 (04:06 +0000)]
Add support for C++0x raw string literals.

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

13 years agoSimplify EH control flow by observing that EH scopes form a simple
John McCall [Thu, 11 Aug 2011 02:22:43 +0000 (02:22 +0000)]
Simplify EH control flow by observing that EH scopes form a simple
hierarchy of delegation, and that EH selector values are meaningful
function-wide (good thing, too, or inlining wouldn't work).
2,3d
1a
hierarchy of delegation and that EH selector values have the same
meaning everywhere in the function instead of being meaningful only
in the context of a specific selector.

This removes the need for routing edges through EH cleanups,
since a cleanup simply always branches to its enclosing scope.

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

13 years agoMake SymbolManager comments doxygen friendly.
Anna Zaks [Thu, 11 Aug 2011 01:03:22 +0000 (01:03 +0000)]
Make SymbolManager comments doxygen friendly.

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

13 years agoCleanup: remove CleanedSate member and GetState() wrapper from StmtNodeBuilder, not...
Anna Zaks [Thu, 11 Aug 2011 00:11:21 +0000 (00:11 +0000)]
Cleanup: remove CleanedSate member and GetState() wrapper from StmtNodeBuilder, not needed as of r137273.

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

13 years agoCleanup: remove GetState() wrapper from ExprEngine, not needed as of r137273.
Anna Zaks [Wed, 10 Aug 2011 23:34:53 +0000 (23:34 +0000)]
Cleanup: remove GetState() wrapper from ExprEngine, not needed as of r137273.

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

13 years agoAnalyzer Core: In checkDeadSymbols checker callback, provide the state in which the...
Anna Zaks [Wed, 10 Aug 2011 23:14:54 +0000 (23:14 +0000)]
Analyzer Core: In checkDeadSymbols checker callback, provide the state in which the symbols are not yet deleted so that checkers could inspect them. Since we are now always creating a transition in ProcessStmt(), remove the logic for adding a transition when none was generated. TODO: the extra transitions will have to be removed; more cleanups; a checker that tests teh new fucntionality.

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

13 years agoRefactoring of DiagnoseBitwisePrecedence() in SemaExpr.cpp to reduce code duplication.
Richard Trieu [Wed, 10 Aug 2011 22:41:34 +0000 (22:41 +0000)]
Refactoring of DiagnoseBitwisePrecedence() in SemaExpr.cpp to reduce code duplication.

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

13 years agoWhen performing the lookup in the current scope for a member access to
Douglas Gregor [Wed, 10 Aug 2011 21:59:45 +0000 (21:59 +0000)]
When performing the lookup in the current scope for a member access to
a member template, e.g.,

  x.f<int>

if we have found a template in the type of x, but the lookup in the
current scope is ambiguous, just ignore the lookup in the current
scope.  Fixes <rdar://problem/9915664>.

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

13 years ago[arcmt] When checking whether properties needs to be strong or not, take into account
Argyrios Kyrtzidis [Wed, 10 Aug 2011 21:46:48 +0000 (21:46 +0000)]
[arcmt] When checking whether properties needs to be strong or not, take into account
that assigning result of -retain means it should be strong. rdar://9931757.

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

13 years ago[libclang] When pointing at an objc property don't return a cursor that points at the
Argyrios Kyrtzidis [Wed, 10 Aug 2011 21:12:04 +0000 (21:12 +0000)]
[libclang] When pointing at an objc property don't return a cursor that points at the
synthesized method for the property. rdar://9771715

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

13 years agoAdd the new unit test that I managed to leave out of r136997 :/
Kaelyn Uhrain [Wed, 10 Aug 2011 19:49:27 +0000 (19:49 +0000)]
Add the new unit test that I managed to leave out of r136997 :/

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

13 years agoAdd a test case for the divide-by-zero fix in r137234
Kaelyn Uhrain [Wed, 10 Aug 2011 19:47:25 +0000 (19:47 +0000)]
Add a test case for the divide-by-zero fix in r137234

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

13 years agoMake sure ptrarith_typesize is at least 1 to avoid division by zero
Kaelyn Uhrain [Wed, 10 Aug 2011 18:49:28 +0000 (18:49 +0000)]
Make sure ptrarith_typesize is at least 1 to avoid division by zero

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

13 years agoRenamings to consistently use 'Constexpr' not 'ConstExpr' when referring to the C...
Richard Smith [Wed, 10 Aug 2011 18:11:37 +0000 (18:11 +0000)]
Renamings to consistently use 'Constexpr' not 'ConstExpr' when referring to the C++0x 'constexpr' keyword.

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