Commit Graph

31791 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis 5ef35b7ce2 Fix the buildbot test.
llvm-svn: 137660
2011-08-15 21:45:01 +00:00
Richard Smith a77a0a6bf2 Track in the AST whether a function is constexpr.
llvm-svn: 137653
2011-08-15 21:04:07 +00:00
Bob Wilson 11403367c0 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.

llvm-svn: 137639
2011-08-15 19:13:06 +00:00
Bob Wilson 08b3756633 Remove duplicate option.
llvm-svn: 137638
2011-08-15 19:13:02 +00:00
Argyrios Kyrtzidis 48ff9a0bd5 [libclang] Handle AttributedTypeLoc for cursor visitation. Fixes rdar://9535717.
llvm-svn: 137634
2011-08-15 18:44:43 +00:00
Anna Zaks 29f9b7adc3 MacOSKeychainAPIChecker: Use llvm::SmallString instead of std::string (as per code review for r137523).
llvm-svn: 137633
2011-08-15 18:42:00 +00:00
Matt Beaumont-Gay 0a0ba9d883 Add fixit notes for -Wconstant-logical-operand.
llvm-svn: 137620
2011-08-15 17:50:06 +00:00
Douglas Gregor 3ec7910e10 Teach reference initialization from the result of a user-defined
conversion to initialize the standard conversion *after* the
user-defined conversion properly. Fixes PR10644.

llvm-svn: 137608
2011-08-15 13:59:46 +00:00
Francois Pichet 127bea8f48 fix typo in test.
llvm-svn: 137592
2011-08-14 22:30:29 +00:00
Francois Pichet daa7f2d613 Another typo found by Nico; Doug also warned me about it, but I didn't listen to him.
llvm-svn: 137591
2011-08-14 21:38:35 +00:00
Francois Pichet 5792825fb2 Fix typo.
llvm-svn: 137585
2011-08-14 14:28:49 +00:00
Eli Friedman 0be3970804 Fix r137086 to actually work properly in general. PR10650.
llvm-svn: 137574
2011-08-14 04:50:34 +00:00
Francois Pichet 00c7e6ceb1 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.

llvm-svn: 137573
2011-08-14 03:52:19 +00:00
NAKAMURA Takumi c77574a2e3 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.

llvm-svn: 137568
2011-08-14 00:37:22 +00:00
Bob Wilson 0d45f58cbb 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.

llvm-svn: 137566
2011-08-13 23:48:55 +00:00
Nico Weber ed8080cb9f 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.

llvm-svn: 137563
2011-08-13 23:13:37 +00:00
Nico Weber c687cae11d 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.

llvm-svn: 137560
2011-08-13 19:03:50 +00:00
Jeffrey Yasskin 9a56e37927 Fix C++0x narrowing conversion errors in Clang.
llvm-svn: 137552
2011-08-13 05:47:04 +00:00
Bob Wilson 445c24f8f0 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.

llvm-svn: 137550
2011-08-13 05:03:46 +00:00
Anna Zaks 80319c1702 MacOSKeychainAPIChecker: Test all APIs.
llvm-svn: 137549
2011-08-13 02:10:15 +00:00
Chad Rosier 58b662c3e3 [driver] Make sure to update the iterator end when erasing for Args.
llvm-svn: 137539
2011-08-12 23:38:19 +00:00
Ted Kremenek 5ef32dbf2a Cleanup various declarations of 'Stmt*' to be 'Stmt *', etc. in libAnalyzer and libStaticAnalyzer[*]. It was highly inconsistent, and very ugly to look at.
llvm-svn: 137537
2011-08-12 23:37:29 +00:00
Eli Friedman 729ed799c7 Update clang tests for r137527.
llvm-svn: 137535
2011-08-12 23:33:52 +00:00
Chad Rosier 4f81fc21a0 [driver] When generating clang failure diagnostics, don't try to preprocess
inputs that aren't preprocessable.

llvm-svn: 137532
2011-08-12 23:30:05 +00:00
Chad Rosier 4bc3de4070 Return the proper type for objects when given a .o extension.
llvm-svn: 137531
2011-08-12 23:16:53 +00:00
Ted Kremenek 75fd43c61d Document purpose of ProgramPointTag::getTagKind().
llvm-svn: 137530
2011-08-12 23:06:47 +00:00
Ted Kremenek e8f7316fee [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.

llvm-svn: 137529
2011-08-12 23:04:46 +00:00
Anna Zaks 59d741fec6 MacOSKeychainAPIChecker: If the allocated data address entered as an enclosing function parameter, skip it to avoid false positives.
llvm-svn: 137526
2011-08-12 22:47:22 +00:00
Chad Rosier ecdede8f5f [driver] Refactor a bit to enable a few fixes when generating diagnostics. No functional change intended.
llvm-svn: 137524
2011-08-12 22:08:57 +00:00
Anna Zaks fdd0aca0a5 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.

llvm-svn: 137523
2011-08-12 21:56:43 +00:00
Jordy Rose add45b78dd [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.

llvm-svn: 137517
2011-08-12 21:41:07 +00:00
Anna Zaks c94894fbc2 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.

llvm-svn: 137514
2011-08-12 21:14:26 +00:00
Jeffrey Yasskin 94f8c77931 Conversions to bool count as integer conversions for the purposes of
the C++0x narrowing error.

llvm-svn: 137512
2011-08-12 20:56:43 +00:00
Fariborz Jahanian 70a315c363 metadata generated by the compiler does not include the weak
attribute of a property. patch by Remy Demarest fixes it.

llvm-svn: 137509
2011-08-12 20:47:08 +00:00
Ted Kremenek 26794fe096 Place err_cfstring_literal_not_string_constant and warn_cfstring_truncated under "-WCFString" flag.
llvm-svn: 137508
2011-08-12 20:46:54 +00:00
Ted Kremenek 95c3b73f3a Place diagnostic warn_stringcompare under the "-Wstring-compare" flag.
llvm-svn: 137507
2011-08-12 20:46:52 +00:00
Ted Kremenek d713fec9cc Place warnings related to incorrect "main()" declaration under "-Wmain".
llvm-svn: 137506
2011-08-12 20:46:49 +00:00
Ted Kremenek 8facefab10 Add -Wtypename-missing flag for diagnostic warn_typename_missing.
llvm-svn: 137505
2011-08-12 20:46:45 +00:00
Ted Kremenek 8df44b2632 [analyzer] Introduce new MemRegion, "TypedValueRegion", so that we can separate TypedRegions that implement getValueType() from those that don't.
Patch by Olaf Krzikalla!

llvm-svn: 137498
2011-08-12 20:02:48 +00:00
Richard Smith def8bdbfac Fix some comments.
llvm-svn: 137491
2011-08-12 18:44:32 +00:00
Chris Lattner 5ec04a51fa switch clang to use the new-new way of creating llvm::StructType's.
llvm-svn: 137472
2011-08-12 17:43:31 +00:00
Douglas Gregor c45c287ab6 Overriding the predefined Protocol isn't something that's actually
done and is likely to not work well anyway; take away this unnecessary
complexity.

llvm-svn: 137465
2011-08-12 17:09:30 +00:00
Ted Kremenek 50aa2d480c Revert "Fix crash in CFGBuilder involving implicit destructor calls and gotos jumping after an object was declared. Fixes PR 10620."
llvm-svn: 137459
2011-08-12 14:41:23 +00:00
Douglas Gregor 801c99d22d 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.

llvm-svn: 137437
2011-08-12 06:49:56 +00:00
NAKAMURA Takumi 5ae5353894 docs/doxygen.css: Import .memitem, .memproto and .memdoc from llvm/doxygen.
llvm-svn: 137435
2011-08-12 06:24:04 +00:00
Douglas Gregor 52e02808c5 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.

llvm-svn: 137434
2011-08-12 06:17:30 +00:00
Douglas Gregor 0a58618a09 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.

llvm-svn: 137431
2011-08-12 05:59:41 +00:00
NAKAMURA Takumi 9f8a02d34e De-Unicode-ify.
llvm-svn: 137430
2011-08-12 05:49:51 +00:00
Douglas Gregor 3ea7269b54 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.

llvm-svn: 137429
2011-08-12 05:46:01 +00:00
Craig Topper a2dee81dec Fix a raw string literal test case to actually use a raw string literal.
llvm-svn: 137427
2011-08-12 04:09:37 +00:00