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

13 years agoobjective-c: Using existing infrastructure for finding
Fariborz Jahanian [Wed, 10 Aug 2011 17:16:30 +0000 (17:16 +0000)]
objective-c: Using existing infrastructure for finding
overridden  methods to diagnose their type mismatch.
This is a general solution for previous fixes
for // rdar://6191214 and // rdar://9352731
and removes lots of duplicate code.

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

13 years agoExpand test of C++0x [class.copymove]p15 to make sure we're actually calling the...
Douglas Gregor [Wed, 10 Aug 2011 16:59:20 +0000 (16:59 +0000)]
Expand test of C++0x [class.copymove]p15 to make sure we're actually calling the copy constructor of a base/member from an explicitly-defaulted copy constructor, rather than the default constructor

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

13 years agoWhen adding the base and member initializers for an implicitly-defined
Douglas Gregor [Wed, 10 Aug 2011 16:51:53 +0000 (16:51 +0000)]
When adding the base and member initializers for an implicitly-defined
special member function, make sure to classify an explicitly-defaulted
copy constructor as a "copy" operation. Fixes PR10622.

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

13 years agoSwitch a C-style cast over to a const_cast. No functionality change
Douglas Gregor [Wed, 10 Aug 2011 16:34:38 +0000 (16:34 +0000)]
Switch a C-style cast over to a const_cast. No functionality change

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

13 years agoUpdate a comment to match the recently-changed code
Douglas Gregor [Wed, 10 Aug 2011 16:09:55 +0000 (16:09 +0000)]
Update a comment to match the recently-changed code

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

13 years agoFor the availability attribute, allow a declaration to be deprecated
Douglas Gregor [Wed, 10 Aug 2011 15:31:35 +0000 (15:31 +0000)]
For the availability attribute, allow a declaration to be deprecated
in the same version that it is introduced. Stuff happens.

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

13 years agoRewrite default initialization of anonymous structs/unions within a
Douglas Gregor [Wed, 10 Aug 2011 15:22:55 +0000 (15:22 +0000)]
Rewrite default initialization of anonymous structs/unions within a
constructor. Previously, we did some bogus recursion into the fields
of anonymous structs (recursively), which ended up building invalid
ASTs that would cause CodeGen to crash due to invalid GEPs.

Now, we instead build the default initializations based on the
indirect field declarations at the top level, which properly generates
the sequence of GEPs needed to initialize the proper member. Fixes
PR10512 and <rdar://problem/9924046>.

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

13 years agoChange an assert into a check. I'm pretty sure there was a point
John McCall [Wed, 10 Aug 2011 04:12:23 +0000 (04:12 +0000)]
Change an assert into a check.  I'm pretty sure there was a point
in time when this assert was valid, but it's not valid now.
Also teach this code to correctly introduce function-to-pointer
decay.

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

13 years agoFormatting.
John McCall [Wed, 10 Aug 2011 04:11:11 +0000 (04:11 +0000)]
Formatting.

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

13 years agoRevert bad change. (It may look equivalent, but it isn't.)
Eli Friedman [Tue, 9 Aug 2011 18:16:09 +0000 (18:16 +0000)]
Revert bad change.  (It may look equivalent, but it isn't.)

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

13 years agoThread Safety: Added basic argument parsing for all new attributes.
Caitlin Sadowski [Tue, 9 Aug 2011 17:59:31 +0000 (17:59 +0000)]
Thread Safety: Added basic argument parsing for all new attributes.

This patch special cases the parser for thread safety attributes so that all
attribute arguments are put in the argument list (instead of a special
parameter) since arguments may not otherwise resolve correctly without two-token
lookahead.

This patch also adds checks to make sure that attribute arguments are
lockable objects.

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

13 years agoCleanup; no functionality change.
Eli Friedman [Tue, 9 Aug 2011 17:38:12 +0000 (17:38 +0000)]
Cleanup; no functionality change.

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

13 years agoMove the creation of the record type for the state of Objective-C fast
Douglas Gregor [Tue, 9 Aug 2011 17:23:49 +0000 (17:23 +0000)]
Move the creation of the record type for the state of Objective-C fast
enumerations from the ASTContext into CodeGen, so that we don't need
to serialize it to AST files. This appears to be the last of the
low-hanging fruit for SpecialTypes.

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

13 years agoDon't serialize the block descriptor or block extended descriptor
Douglas Gregor [Tue, 9 Aug 2011 16:24:26 +0000 (16:24 +0000)]
Don't serialize the block descriptor or block extended descriptor
types to AST files; they're only used by debug info generation anyway,
and shouldn't ever exist in the AST anyway.

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

13 years agoMove the construction of the RecordDecl representing the runtime
Douglas Gregor [Tue, 9 Aug 2011 15:54:21 +0000 (15:54 +0000)]
Move the construction of the RecordDecl representing the runtime
layout of a constant NSString from the ASTContext over to CodeGen,
since this is solely CodeGen's responsibility. Eliminates one of the
unnecessary "special" types that we serialize.

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

13 years agoMigrate the serialization of ASTContext's AutoDeduceTy and
Douglas Gregor [Tue, 9 Aug 2011 15:13:55 +0000 (15:13 +0000)]
Migrate the serialization of ASTContext's AutoDeduceTy and
AutoRRefDeductTy from the "special types" block to predefined
types. The latter behaves better when loading multiple AST files.

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

13 years agoPlace back previous order of add_subdirectory()'s to reflect build depedencies.
Ted Kremenek [Tue, 9 Aug 2011 14:55:12 +0000 (14:55 +0000)]
Place back previous order of add_subdirectory()'s to reflect build depedencies.

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

13 years agoAdd libsupport to list of libraries to link into diagtool
Ted Kremenek [Tue, 9 Aug 2011 03:41:03 +0000 (03:41 +0000)]
Add libsupport to list of libraries to link into diagtool

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

13 years agoAdd 'diagtool' to the 'tools/' directory. diagtool is a new tool (WIP) for analyzing...
Ted Kremenek [Tue, 9 Aug 2011 03:39:19 +0000 (03:39 +0000)]
Add 'diagtool' to the 'tools/' directory.  diagtool is a new tool (WIP) for analyzing and working with clang diagnostics.

Some interesting stats from 'diagtool list-warnings' on the current version of clang:

  Percentage of warnings with flags: 48.79%
  Number of unique flags: 148
  Average number of diagnostics per flag: 2.041

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

13 years agoProvide diag_iterator for iterating over the built-in diagnostic IDs/names in the...
Ted Kremenek [Tue, 9 Aug 2011 03:39:14 +0000 (03:39 +0000)]
Provide diag_iterator for iterating over the built-in diagnostic IDs/names in the internal table of DiagnosticIDs.

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

13 years agoSort CMakeLists.txt.
Ted Kremenek [Tue, 9 Aug 2011 03:39:10 +0000 (03:39 +0000)]
Sort CMakeLists.txt.

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

13 years agoMake sure to canonicalize the argument type of a non-type template
Douglas Gregor [Tue, 9 Aug 2011 01:55:14 +0000 (01:55 +0000)]
Make sure to canonicalize the argument type of a non-type template
argument of enumeration type when checking template arguments. Fixes PR10579.

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

13 years agoHand materialization of temporary expressions when emitting a scalar
Douglas Gregor [Tue, 9 Aug 2011 00:37:14 +0000 (00:37 +0000)]
Hand materialization of temporary expressions when emitting a scalar
expression. Fxies PR10592.

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

13 years agoDon't emit memcpy for copying fields of arrays of volatile elements.
Fariborz Jahanian [Tue, 9 Aug 2011 00:26:11 +0000 (00:26 +0000)]
Don't emit memcpy for copying fields of arrays of volatile elements.
Use the the path that generates a loop. This fixes
bogus error that clang puts out. // rdar://9894548

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

13 years agoIf no -miphoneos-version-min specified, see if we can set the default based on
Chad Rosier [Mon, 8 Aug 2011 23:39:34 +0000 (23:39 +0000)]
If no -miphoneos-version-min specified, see if we can set the default based on
-isysroot.
rdar://9837120

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

13 years agoFix another -Wuninitialized assertion failure (this one involving bit casts) resultin...
Ted Kremenek [Mon, 8 Aug 2011 21:43:08 +0000 (21:43 +0000)]
Fix another -Wuninitialized assertion failure (this one involving bit casts) resulting from the recent -Wuninitialized changes.

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

13 years agoAdd -W flag for ARC warning "performSelector may cause a leak because its selector...
Ted Kremenek [Mon, 8 Aug 2011 21:28:18 +0000 (21:28 +0000)]
Add -W flag for ARC warning "performSelector may cause a leak because its selector is unknown".

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

13 years agoobjective-c: diagnose protocol inconsistencies in following
Fariborz Jahanian [Mon, 8 Aug 2011 18:03:17 +0000 (18:03 +0000)]
objective-c: diagnose protocol inconsistencies in following
situation. When a class explicitly or implicitly (through inheritance)
"conformsTo" two protocols which conflict (have methods which conflict).
This patch fixes the previous patch where warnings were coming out in
non-deterministic order.  This is 2nd part of // rdar://6191214.

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

13 years agoMake sure FunctionDecls aren't considered during overload resolution if there
Kaelyn Uhrain [Mon, 8 Aug 2011 17:35:31 +0000 (17:35 +0000)]
Make sure FunctionDecls aren't considered during overload resolution if there
are explicit template args.

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

13 years agoSilence the category-replacing-class-method warning for +load: category
David Chisnall [Mon, 8 Aug 2011 17:32:19 +0000 (17:32 +0000)]
Silence the category-replacing-class-method warning for +load: category
implementations of +load do not replace the class definition in a meaningful
sense, they are run when the category loads, the +load method for class is run
when the class is loaded.

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

13 years agoFix typo so we don't use the wrong function for ending ObjC++ catch blocks (GNU runtimes)
David Chisnall [Mon, 8 Aug 2011 17:26:06 +0000 (17:26 +0000)]
Fix typo so we don't use the wrong function for ending ObjC++ catch blocks (GNU runtimes)

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