]> granicus.if.org Git - clang/log
clang
13 years agoFix Makefile build of examples/clang-interpreter.
Nico Weber [Sat, 30 Apr 2011 02:52:27 +0000 (02:52 +0000)]
Fix Makefile build of examples/clang-interpreter.

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

13 years agoAdd a couple of assertions to make sure the bitfields can fit the value assigned...
Argyrios Kyrtzidis [Sat, 30 Apr 2011 02:28:27 +0000 (02:28 +0000)]
Add a couple of assertions to make sure the bitfields can fit the value assigned to them. No functionality change.

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

13 years agoDocumentation for -Oz; Updated synopsis and item.
Chad Rosier [Sat, 30 Apr 2011 02:04:10 +0000 (02:04 +0000)]
Documentation for -Oz; Updated synopsis and item.

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

13 years agoAdd documentation for -Oz flag.
Chad Rosier [Sat, 30 Apr 2011 01:40:58 +0000 (01:40 +0000)]
Add documentation for -Oz flag.

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

13 years agoRemoved redundant case statements
Chad Rosier [Sat, 30 Apr 2011 00:03:48 +0000 (00:03 +0000)]
Removed redundant case statements

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

13 years agoTie constructor defintion with its declaration using AT_specification.
Devang Patel [Fri, 29 Apr 2011 23:42:32 +0000 (23:42 +0000)]
Tie constructor defintion with its declaration using AT_specification.

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

13 years agoAdjust test/Analysis/retain-release.m to also test the retain/release checker in...
Ted Kremenek [Fri, 29 Apr 2011 23:15:53 +0000 (23:15 +0000)]
Adjust test/Analysis/retain-release.m to also test the retain/release checker in Objective-C++ mode.

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

13 years agoAdd -Oz option and use it to set the inline threshold to 25.
Bob Wilson [Fri, 29 Apr 2011 22:49:50 +0000 (22:49 +0000)]
Add -Oz option and use it to set the inline threshold to 25.
Radar 9333566.  Patch by Chad Rosier!

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

13 years agoremoves a meaningless comment.
Fariborz Jahanian [Fri, 29 Apr 2011 22:11:28 +0000 (22:11 +0000)]
removes a meaningless comment.

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

13 years agoblock variables on lhs need be ir-gen'ed after the
Fariborz Jahanian [Fri, 29 Apr 2011 21:53:21 +0000 (21:53 +0000)]
block variables on lhs need be ir-gen'ed after the
rhs when its 'forwarding' pointer may be modified
in rhs evaluation as result of call to Block_copy.
// rdar://9309454

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

13 years agoGuard in USRGenerator::GenLoc() against null Decl* from invalid code.
Ted Kremenek [Fri, 29 Apr 2011 21:35:23 +0000 (21:35 +0000)]
Guard in USRGenerator::GenLoc() against null Decl* from invalid code.

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

13 years agoDisable -Wnon-pod-memset for now while I try to reduce the false
Chandler Carruth [Fri, 29 Apr 2011 20:58:14 +0000 (20:58 +0000)]
Disable -Wnon-pod-memset for now while I try to reduce the false
positives still further.

The plan is to:

1) Create a more targeted warning for memset of memory pointing at
   a type with virtual methods or bases where a vptr would be
   overwritten.
2) Consider turning the above warning back on by default.
3) Evaluate whether any false positives in the existing warning can be
   detected and white listed in the warning implementation.
4) If #3 lowers the noise floor enough, enable the full warning in -Wall
   or -Wextra.

Comments or suggestions welcome. Even more welcome are specific test
cases which trigger the warning and shouldn't.

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

13 years agoChange -Wparentheses to not imply -Widiomatic-parentheses. Users rarely want to...
Ted Kremenek [Fri, 29 Apr 2011 20:30:39 +0000 (20:30 +0000)]
Change -Wparentheses to not imply -Widiomatic-parentheses.  Users rarely want to see these warnings, and often explicitly pass -Wparentheses.

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

13 years agoSerialize/deserialize the HasStandardLayout bit when writing/reading PCHs.
Anders Carlsson [Fri, 29 Apr 2011 18:37:25 +0000 (18:37 +0000)]
Serialize/deserialize the HasStandardLayout bit when writing/reading PCHs.

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

13 years agoDriver/cc1as: Forward -mllvm arguments when compiling assembly files.
Daniel Dunbar [Fri, 29 Apr 2011 17:53:18 +0000 (17:53 +0000)]
Driver/cc1as: Forward -mllvm arguments when compiling assembly files.

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

13 years agoRemove comments about __int8 and friends from the mangler. Turns out we don't
Charles Davis [Fri, 29 Apr 2011 15:50:52 +0000 (15:50 +0000)]
Remove comments about __int8 and friends from the mangler. Turns out we don't
actually have to implement them, since in modern versions of MSVC they're
aliases to the standard C types.

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

13 years agoWhite-list yet more type trait names, since they're used as
Douglas Gregor [Fri, 29 Apr 2011 15:31:39 +0000 (15:31 +0000)]
White-list yet more type trait names, since they're used as
identifiers in libc++.

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

13 years agoDon't crash if the AST doesn't have a sensible ObjC id type.
David Chisnall [Fri, 29 Apr 2011 14:10:35 +0000 (14:10 +0000)]
Don't crash if the AST doesn't have a sensible ObjC id type.

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

13 years agoRelax the non-POD memset warning to use the less restrictive C++11
Chandler Carruth [Fri, 29 Apr 2011 09:46:08 +0000 (09:46 +0000)]
Relax the non-POD memset warning to use the less restrictive C++11
definition of POD. Specifically, this allows certain non-aggregate
types due to their data members being private.

The representation of C++11 POD testing is pretty gross. Any suggestions
for improvements there are welcome. Especially the name
'isCXX11PODType()' seems truly unfortunate.

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

13 years agor130381 follow up: accept __uuidof expression for template argument reference.
Francois Pichet [Fri, 29 Apr 2011 09:08:14 +0000 (09:08 +0000)]
r130381 follow up: accept __uuidof expression for template argument reference.

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

13 years agoAdd a decl update when a static data member of a class template is instantiated in...
Sebastian Redl [Fri, 29 Apr 2011 08:19:30 +0000 (08:19 +0000)]
Add a decl update when a static data member of a class template is instantiated in a different PCH than its containing class. Otherwise we get double definition errors. Fixes a Boost.MPL problem that affects Boost.Accumulators and probably a lot more of Boost.

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

13 years agoUse std::vector for ASTReader's ASTBuffers, instead of std::deque.
Sebastian Redl [Fri, 29 Apr 2011 08:19:19 +0000 (08:19 +0000)]
Use std::vector for ASTReader's ASTBuffers, instead of std::deque.

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

13 years agoUse -emit-llvm-only as suggested by Argyrios.
Sebastian Redl [Fri, 29 Apr 2011 08:19:03 +0000 (08:19 +0000)]
Use -emit-llvm-only as suggested by Argyrios.

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

13 years agoDon't assume that the AST methods will only be invoked on C++ types.
Chandler Carruth [Fri, 29 Apr 2011 07:47:42 +0000 (07:47 +0000)]
Don't assume that the AST methods will only be invoked on C++ types.
Teaches isLiteralType and isTrivialType to behave plausibly and most
importantly not crash on normal RecordDecls.

Sadly I have no real way to test this. I stumbled onto it by
mis-implementing a warning.

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

13 years agoOops
Douglas Gregor [Fri, 29 Apr 2011 01:50:40 +0000 (01:50 +0000)]
Oops

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

13 years agolibstdc++ 4.2 also uses __is_same as a struct name, which conflicts with our new...
Douglas Gregor [Fri, 29 Apr 2011 01:38:03 +0000 (01:38 +0000)]
libstdc++ 4.2 also uses __is_same as a struct name, which conflicts with our new type trait __is_same

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

13 years agoUse DirectoryLookup::getName() rather than getDir()->getName() in a context where...
Douglas Gregor [Fri, 29 Apr 2011 00:45:09 +0000 (00:45 +0000)]
Use DirectoryLookup::getName() rather than getDir()->getName() in a context where we don't know whether we have a normal directory

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

13 years agoEnhance clang_getCXTUResourceUsage() to report the sizes of the memory buffers used...
Ted Kremenek [Thu, 28 Apr 2011 23:46:20 +0000 (23:46 +0000)]
Enhance clang_getCXTUResourceUsage() to report the sizes of the memory buffers used by PCH.

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

13 years agoFixes debug info generation problem for ms_struct structs.
Fariborz Jahanian [Thu, 28 Apr 2011 23:43:23 +0000 (23:43 +0000)]
Fixes debug info generation problem for ms_struct structs.
// rdar://8823265

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

13 years agoCut down unnecessary zero'ing when value-initializing arrays of C++ objects.
Argyrios Kyrtzidis [Thu, 28 Apr 2011 22:57:55 +0000 (22:57 +0000)]
Cut down unnecessary zero'ing when value-initializing arrays of C++ objects.

-C++ objects with user-declared constructor don't need zero'ing.
-We can zero-initialize arrays of C++ objects in "bulk" now, in which case don't zero-initialize each object again.

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

13 years agoms_struct patch for initialization and field access irgen.
Fariborz Jahanian [Thu, 28 Apr 2011 22:49:46 +0000 (22:49 +0000)]
ms_struct patch for initialization and field access irgen.
// rdar://8823265 - wip.

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

13 years agoRaise ARM byval minimum size from 32 to 64, addressing a performance
Stuart Hastings [Thu, 28 Apr 2011 21:35:59 +0000 (21:35 +0000)]
Raise ARM byval minimum size from 32 to 64, addressing a performance
regression in mason.  rdar://problem/7662569

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

13 years agoDriver/Darwin/ld: Set the deployment target following the version information in
Daniel Dunbar [Thu, 28 Apr 2011 21:23:41 +0000 (21:23 +0000)]
Driver/Darwin/ld: Set the deployment target following the version information in
the tool chain, instead of based on the translated arguments.

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

13 years agotests: Tweak test to not write to the same temporary twice, in the hopes of avoiding...
Daniel Dunbar [Thu, 28 Apr 2011 21:23:38 +0000 (21:23 +0000)]
tests: Tweak test to not write to the same temporary twice, in the hopes of avoiding sporadic win32 failures about renaming a temporary.

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

13 years agoEnhance clang_getCXTUResourceUsage() to report how much memory is used by SourceManag...
Ted Kremenek [Thu, 28 Apr 2011 20:36:42 +0000 (20:36 +0000)]
Enhance clang_getCXTUResourceUsage() to report how much memory is used by SourceManager's memory buffers.

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

13 years agoGet the base element type even in multidimensional arrays.
Argyrios Kyrtzidis [Thu, 28 Apr 2011 20:07:15 +0000 (20:07 +0000)]
Get the base element type even in multidimensional arrays.

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

13 years agoUse StringRef::substr() and unbounded StringRef::compare() instead of bounded version...
Lenny Maiorani [Thu, 28 Apr 2011 19:31:12 +0000 (19:31 +0000)]
Use StringRef::substr() and unbounded StringRef::compare() instead of bounded version of StringRef::compare() because bounded version of StringRef::compare() is going to be removed.

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

13 years agoMake the top-level driver ignore -fobjc-default-synthesize-properties while this...
Ted Kremenek [Thu, 28 Apr 2011 19:26:03 +0000 (19:26 +0000)]
Make the top-level driver ignore -fobjc-default-synthesize-properties while this feature undergoes more review and development.  This is still available as a -cc1 option for testing.

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

13 years agoReplace unitary array with scalar. rdar://problem/7662569
Stuart Hastings [Thu, 28 Apr 2011 19:24:47 +0000 (19:24 +0000)]
Replace unitary array with scalar.  rdar://problem/7662569

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

13 years agoEliminates an assert in the strncpy/strncat checker caused by not validating a cast...
Lenny Maiorani [Thu, 28 Apr 2011 18:59:43 +0000 (18:59 +0000)]
Eliminates an assert in the strncpy/strncat checker caused by not validating a cast was successful. If the value of an argument was unknown, the cast would result in a NULL pointer which was later being dereferenced.

This fixes Bugzilla #9806.

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

13 years agoWhen value-initializing the elements of an array not not included in the initializer...
Argyrios Kyrtzidis [Thu, 28 Apr 2011 18:53:58 +0000 (18:53 +0000)]
When value-initializing the elements of an array not not included in the initializer make sure
that a non-trivial C++ constructor gets called.

Fixes rdar://9347552 & http://llvm.org/PR9801

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

13 years agoDon't waste memory if the initializer expression is empty.
Argyrios Kyrtzidis [Thu, 28 Apr 2011 18:53:55 +0000 (18:53 +0000)]
Don't waste memory if the initializer expression is empty.

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

13 years agoReplace SmallVector with an array, as suggested by Frits van Bommel. rdar://problem...
Stuart Hastings [Thu, 28 Apr 2011 18:16:06 +0000 (18:16 +0000)]
Replace SmallVector with an array, as suggested by Frits van Bommel.  rdar://problem/7662569

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

13 years agoWhen determining whether two types are reference-compatible, check
Douglas Gregor [Thu, 28 Apr 2011 17:56:11 +0000 (17:56 +0000)]
When determining whether two types are reference-compatible, check
non-CVR qualifiers as well as CVR qualifiers. For example, don't allow
a reference to an integer in address space 1 to bind to an integer in
address space 2.

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

13 years agoFixes ArrayTypeTraitExpr (-Wnon-virtual-dtor).
Manuel Klimek [Thu, 28 Apr 2011 17:03:03 +0000 (17:03 +0000)]
Fixes ArrayTypeTraitExpr (-Wnon-virtual-dtor).

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

13 years agoOnly call the MacroExpands callback when we're actually going to
Douglas Gregor [Thu, 28 Apr 2011 16:36:13 +0000 (16:36 +0000)]
Only call the MacroExpands callback when we're actually going to
expand the macro, based on a patch by Ori Avtalion. Fixes PR9799.

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

13 years agolibstdc++ 4.4 uses __is_signed as an identifier, while Clang treats it
Douglas Gregor [Thu, 28 Apr 2011 15:48:45 +0000 (15:48 +0000)]
libstdc++ 4.4 uses __is_signed as an identifier, while Clang treats it
as a keyword for the __is_signed type trait. Cope with this conflict
via some hackish recovery: if we see a declaration of the form

 static const bool __is_signed

then we stop treating __is_signed as a keyword and instead treat it as
an identifier. It's ugly, but it's better than making the __is_signed
type trait conditional on some language flag. Fixes PR9804.

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

13 years agoImplements strcasecmp() checker in Static Analyzer.
Lenny Maiorani [Thu, 28 Apr 2011 15:09:11 +0000 (15:09 +0000)]
Implements strcasecmp() checker in Static Analyzer.

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

13 years agoSilence more -Wnon-pod-memset given its current implementation. I may be
Chandler Carruth [Thu, 28 Apr 2011 08:19:45 +0000 (08:19 +0000)]
Silence more -Wnon-pod-memset given its current implementation. I may be
able to revert these based on a patch I'm working on, but no reason for
people to be spammed with warnings in the interim.

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

13 years agoAdd comment to CFGBlock suggested by Jiri Slaby.
Ted Kremenek [Thu, 28 Apr 2011 06:19:35 +0000 (06:19 +0000)]
Add comment to CFGBlock suggested by Jiri Slaby.

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

13 years agoUpdate r130381 to check for UO_AddrOf.
Francois Pichet [Thu, 28 Apr 2011 05:12:34 +0000 (05:12 +0000)]
Update r130381 to check for UO_AddrOf.

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

13 years agoEnhance clang_getCXTUResourceUsage() to report the amount of memory used by ASTContex...
Ted Kremenek [Thu, 28 Apr 2011 04:53:38 +0000 (04:53 +0000)]
Enhance clang_getCXTUResourceUsage() to report the amount of memory used by ASTContext's side tables.

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

13 years agoSupport &__uuidof(type) as a non type template argument.
Francois Pichet [Thu, 28 Apr 2011 04:39:50 +0000 (04:39 +0000)]
Support &__uuidof(type) as a non type template argument.
This idiom is used everywhere in MFC/COM code and as such this patch removes hundreds of errors when parsing MFC code with clang.

Example:
template <class T, const GUID* g = &__uuidof(T)>
class ComTemplate  { };

typedef ComTemplate<struct_with_uuid, &__uuidof(struct_with_uuid)> COM_TYPE;

Of course this is just parsing support. Trying to use this in CodeGen will generate:
error: cannot yet mangle expression type CXXUuidofExpr

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

13 years agoEnhance clang_getCXTUResourceUsage() to report the amount of memory used by SourceMan...
Ted Kremenek [Thu, 28 Apr 2011 04:10:31 +0000 (04:10 +0000)]
Enhance clang_getCXTUResourceUsage() to report the amount of memory used by SourceManager's content cache allocator.

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

13 years agoSEH was crashing under -fms-extensions.
Francois Pichet [Thu, 28 Apr 2011 03:14:31 +0000 (03:14 +0000)]
SEH was crashing under -fms-extensions.

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

13 years agoImplement the mangling for non-ADL call expressions that we just
John McCall [Thu, 28 Apr 2011 02:52:03 +0000 (02:52 +0000)]
Implement the mangling for non-ADL call expressions that we just
worked out.

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

13 years agoWhen block-capturing a variable with a non-trivial destructor,
John McCall [Thu, 28 Apr 2011 02:15:35 +0000 (02:15 +0000)]
When block-capturing a variable with a non-trivial destructor,
make sure to mark the destructor.  This normally isn't required,
because the destructor should have been marked as part of the
declaration of the local, but it's necessary when the variable
is a parameter because it's the call sites that are responsible
for those destructors.

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

13 years agoA few corrections to type traits that missed the last checkin
John Wiegley [Thu, 28 Apr 2011 02:06:46 +0000 (02:06 +0000)]
A few corrections to type traits that missed the last checkin

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

13 years agoBecause of r130359 this test no longer fail on Windows.
Francois Pichet [Thu, 28 Apr 2011 02:01:57 +0000 (02:01 +0000)]
Because of r130359 this test no longer fail on Windows.

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

13 years agoUpgrade Microsoft's __int8, __int16, __int32 and __int64 types from builtin defines...
Francois Pichet [Thu, 28 Apr 2011 01:59:37 +0000 (01:59 +0000)]
Upgrade Microsoft's __int8, __int16, __int32 and __int64 types from builtin defines to real types.

Otherwise statements like:
  __int64 var = __int64(0);

would be expanded to:
  long long var = long long(0);

and fail to compile.

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

13 years agoConvert assertion in memset checking to a runtime check (because real code may provid...
Ted Kremenek [Thu, 28 Apr 2011 01:38:02 +0000 (01:38 +0000)]
Convert assertion in memset checking to a runtime check (because real code may provide a deviant definition of memset).

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

13 years agoRemoved test that depended on ast-test
John Wiegley [Thu, 28 Apr 2011 01:09:13 +0000 (01:09 +0000)]
Removed test that depended on ast-test

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

13 years agoParsing/AST support for Structured Exception Handling
John Wiegley [Thu, 28 Apr 2011 01:08:34 +0000 (01:08 +0000)]
Parsing/AST support for Structured Exception Handling

Patch authored by Sohail Somani.

Provide parsing and AST support for Windows structured exception handling.

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

13 years agoMore cleanup of template argument deduction and its handling of
Douglas Gregor [Thu, 28 Apr 2011 00:56:09 +0000 (00:56 +0000)]
More cleanup of template argument deduction and its handling of
non-CVR qualifiers. We can now properly match address-space--qualified
references during template argument deduction.

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

13 years agoFix modified-header-crash.c for read-only source trees
Matt Beaumont-Gay [Thu, 28 Apr 2011 00:23:49 +0000 (00:23 +0000)]
Fix modified-header-crash.c for read-only source trees

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

13 years agoImplementation of Embarcadero array type traits
John Wiegley [Thu, 28 Apr 2011 00:16:57 +0000 (00:16 +0000)]
Implementation of Embarcadero array type traits

Patch authored by John Wiegley.

These are array type traits used for parsing code that employs certain
features of the Embarcadero C++ compiler: __array_rank(T) and
__array_extent(T, Dim).

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

13 years agoUpdate regex in scan-build for parsing statistics.
Ted Kremenek [Wed, 27 Apr 2011 23:43:27 +0000 (23:43 +0000)]
Update regex in scan-build for parsing statistics.

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

13 years agoClean up the handling of non-CVR qualifiers in template argument
Douglas Gregor [Wed, 27 Apr 2011 23:34:22 +0000 (23:34 +0000)]
Clean up the handling of non-CVR qualifiers in template argument
deduction. The good news is that address spaces are a lot less broken
in this regard than I'd expected.

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

13 years agot/clang/type-traits
John Wiegley [Wed, 27 Apr 2011 23:09:49 +0000 (23:09 +0000)]
t/clang/type-traits

Patch authored by John Wiegley.

These type traits are used for parsing code that employs certain features of
the Embarcadero C++ compiler.  Several of these constructs are also desired by
libc++, according to its project pages (such as __is_standard_layout).

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

13 years agoRemove unused method CFGBlock::hasBinaryBranchTerminator().
Ted Kremenek [Wed, 27 Apr 2011 22:16:58 +0000 (22:16 +0000)]
Remove unused method CFGBlock::hasBinaryBranchTerminator().

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

13 years agoDon't print fixits for format specifiers in cases where the fixit does not actually...
Eli Friedman [Wed, 27 Apr 2011 22:06:20 +0000 (22:06 +0000)]
Don't print fixits for format specifiers in cases where the fixit does not actually fix the warning. PR8781.

I'm not sure what the preferred way to write a test for whether a fixit is emitted.

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

13 years agoUpdate scan-build to '-analyzer-checker debug.Stats' instead of the old '-analyzer...
Ted Kremenek [Wed, 27 Apr 2011 18:53:08 +0000 (18:53 +0000)]
Update scan-build to '-analyzer-checker debug.Stats' instead of the old '-analyzer-stats' -cc1 argument.

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

13 years agoHeh, funny thing, 'void' isn't a POD type. Nice of us to suggest it to
Chandler Carruth [Wed, 27 Apr 2011 18:48:59 +0000 (18:48 +0000)]
Heh, funny thing, 'void' isn't a POD type. Nice of us to suggest it to
silence this warning. ;]

Fixed that obvious bug and added a bit more testing as well.

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

13 years agoRe-enable byval for ARM in clang. rdar://problem/7662569
Stuart Hastings [Wed, 27 Apr 2011 17:24:02 +0000 (17:24 +0000)]
Re-enable byval for ARM in clang.  rdar://problem/7662569

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

13 years agoSome refactoring of my ms_struct patch.
Fariborz Jahanian [Wed, 27 Apr 2011 17:14:21 +0000 (17:14 +0000)]
Some refactoring of my ms_struct patch.
// rdar://8823265 related.

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

13 years agoWhen printing a base-specifier, print the ellipsis ("...") if it is a
Douglas Gregor [Wed, 27 Apr 2011 17:07:55 +0000 (17:07 +0000)]
When printing a base-specifier, print the ellipsis ("...") if it is a
pack expansion. Fixes PR9452.

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

13 years agoASTImporter support for NestedNameSpecifier, from Olaf Krzikalla
Douglas Gregor [Wed, 27 Apr 2011 16:48:40 +0000 (16:48 +0000)]
ASTImporter support for NestedNameSpecifier, from Olaf Krzikalla

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

13 years agoThis is the next step in building the standalone tools infrastructure:
Manuel Klimek [Wed, 27 Apr 2011 16:39:14 +0000 (16:39 +0000)]
This is the next step in building the standalone tools infrastructure:
This patch simplifies writing of standalone Clang tools. As an
example, we add clang-check, a tool that runs a syntax only frontend
action over a .cc file. When you integrate this into your favorite
editor, you get much faster feedback on your compilation errors, thus
reducing your feedback cycle especially when writing new code.

The tool depends on integration of an outstanding patch to CMake to
work which allows you to always have a current compile command
database in your cmake output directory when you set
CMAKE_EXPORT_COMPILE_COMMANDS.

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

13 years agoMore accurately model realloc() when the size argument is 0. realloc() with a size...
Lenny Maiorani [Wed, 27 Apr 2011 14:49:29 +0000 (14:49 +0000)]
More accurately model realloc() when the size argument is 0. realloc() with a size of 0 is equivalent to free(). The memory region should be marked as free and not used again.

Unit tests f2_realloc_0(), f6_realloc(), and f7_realloc() contributed by Marshall Clow <mclow.lists@gmail.com>. Thanks!

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

13 years agoAdd a warning (-Wnon-pod-memset) for calls to memset() with
Chandler Carruth [Wed, 27 Apr 2011 07:05:31 +0000 (07:05 +0000)]
Add a warning (-Wnon-pod-memset) for calls to memset() with
a destination pointer that points to a non-POD type. This can flag such
horrible bugs as overwriting vptrs when a previously POD structure is
suddenly given a virtual method, or creating objects that crash on
practically any use by zero-ing out a member when its changed from
a const char* to a std::string, etc.

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

13 years agoDiagnose attempts to implicitly instantiate a template before it is
John McCall [Wed, 27 Apr 2011 06:46:31 +0000 (06:46 +0000)]
Diagnose attempts to implicitly instantiate a template before it is
fully defined.  Somehow this escaped notice for a very long time.

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

13 years agoIntroduce a new parser annotation token for primary expressions. When
Douglas Gregor [Wed, 27 Apr 2011 06:18:01 +0000 (06:18 +0000)]
Introduce a new parser annotation token for primary expressions. When
ClassifyName() builds a primary expression, generate one of these
annotation tokens rather than jumping into the parser.

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

13 years agoRemove this assert, I don't think it's being helpful and people have
Eric Christopher [Wed, 27 Apr 2011 05:48:06 +0000 (05:48 +0000)]
Remove this assert, I don't think it's being helpful and people have
been running into it.

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

13 years agoClean out some cruft I introduced when adding Sema::ClassifyName()
Douglas Gregor [Wed, 27 Apr 2011 05:44:51 +0000 (05:44 +0000)]
Clean out some cruft I introduced when adding Sema::ClassifyName()

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

13 years agoSimplify the parser's handling of Sema::ClassifyName() for types, by
Douglas Gregor [Wed, 27 Apr 2011 05:41:15 +0000 (05:41 +0000)]
Simplify the parser's handling of Sema::ClassifyName() for types, by
creating a type-annotation token rather than jumping into the
declaration parsing.

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

13 years agoAllow 'Environment::getSVal()' to allow an optional way for checkers to do a direct...
Ted Kremenek [Wed, 27 Apr 2011 05:34:09 +0000 (05:34 +0000)]
Allow 'Environment::getSVal()' to allow an optional way for checkers to do a direct lookup to values bound to expressions, without
resulting to lazy logic.  This is critical for the OSAtomicChecker that does a simulated load on any arbitrary expression.

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

13 years agoAdd the test that I intended to submit with r130055, but forgot to add.
Chandler Carruth [Wed, 27 Apr 2011 05:25:42 +0000 (05:25 +0000)]
Add the test that I intended to submit with r130055, but forgot to add.
Apologies.

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

13 years agoAdd support for Microsoft __interface keyword. An __interface class is basically...
Francois Pichet [Wed, 27 Apr 2011 05:07:51 +0000 (05:07 +0000)]
Add support for Microsoft __interface keyword. An __interface class is basically a normal class containing just pure virtual functions. No urgency to enforce that restriction in clang for now, so make __interface an "class" alias.

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

13 years agoIf a null statement was preceded by an empty macro keep its instantiation source...
Argyrios Kyrtzidis [Wed, 27 Apr 2011 05:04:02 +0000 (05:04 +0000)]
If a null statement was preceded by an empty macro keep its instantiation source location
in NullStmt.

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

13 years agoExtend Sema::ClassifyName() to support C++, ironing out a few issues
Douglas Gregor [Wed, 27 Apr 2011 04:48:22 +0000 (04:48 +0000)]
Extend Sema::ClassifyName() to support C++, ironing out a few issues
in the classification of template names and using declarations. We now
properly typo-correct the leading identifiers in statements to types,
templates, values, etc. As an added bonus, this reduces the number of
lookups required for disambiguation.

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

13 years agoWhen compiling with -fno-threadsafe-statics, guard variables for globals with interna...
Anders Carlsson [Wed, 27 Apr 2011 04:37:08 +0000 (04:37 +0000)]
When compiling with -fno-threadsafe-statics, guard variables for globals with internal linkage don't have to be i64, i8 works just fine!

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

13 years agoFix test
Douglas Gregor [Wed, 27 Apr 2011 04:02:56 +0000 (04:02 +0000)]
Fix test

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

13 years agoImprove diagnostics for typo correction via Sema::ClassifyName(), by
Douglas Gregor [Wed, 27 Apr 2011 03:47:06 +0000 (03:47 +0000)]
Improve diagnostics for typo correction via Sema::ClassifyName(), by
looking at the context and the correction and using a custom
diagnostic. Also, enable some Fix-It tests that were somewhat lamely
disabled.

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

13 years agoAdd triple in the hope of unbreaking the bubuildbot
Douglas Gregor [Wed, 27 Apr 2011 03:24:57 +0000 (03:24 +0000)]
Add triple in the hope of unbreaking the bubuildbot

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

13 years agoFixOverloadedFunctionReference needs to rebuild member accesses of
John McCall [Wed, 27 Apr 2011 00:36:17 +0000 (00:36 +0000)]
FixOverloadedFunctionReference needs to rebuild member accesses of
instance methods to have bound-member type.

Fixing that broke __unknown_anytype, which I've in turn fixed.

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

13 years agoWhen comparing Objective-C pointers during overload resolution to
Douglas Gregor [Wed, 27 Apr 2011 00:01:52 +0000 (00:01 +0000)]
When comparing Objective-C pointers during overload resolution to
determine which is a better conversion to "void*", be sure to perform
the comparison using the safe-for-id
ASTContext::canAssignObjCInterfaces() rather than the asserts-with-id
ASTContext::canAssignObjCInterfaces().

Fixes <rdar://problem/9327203>.

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

13 years agoWith ms_struct attribut, Zero-length bitfields following
Fariborz Jahanian [Tue, 26 Apr 2011 23:52:16 +0000 (23:52 +0000)]
With ms_struct attribut, Zero-length bitfields following
non-bitfield members are ignore. // rdar://8823265 wip

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

13 years agoWhen computing Objective-C pointer conversions in C++, retain
Douglas Gregor [Tue, 26 Apr 2011 23:16:46 +0000 (23:16 +0000)]
When computing Objective-C pointer conversions in C++, retain
the qualifiers (e.g., GC qualifiers) on the type we're converting
from, rather than just blindly adopting the qualifiers of the type
we're converting to or dropping qualifiers altogether.

As an added bonus, properly diagnose GC qualifier mismatches to
eliminate a crash in the overload resolution failure diagnostics.

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

13 years agoTo be able to replay compilations we need to accurately remodel how
Manuel Klimek [Tue, 26 Apr 2011 21:50:03 +0000 (21:50 +0000)]
To be able to replay compilations we need to accurately remodel how
includes get resolved, especially when they are found relatively to
another include file. We also try to get it working for framework
includes, but that part of the code is untested, as I don't have a code
base that uses it.

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

13 years agoWe need pointer size in bits here.
Devang Patel [Tue, 26 Apr 2011 21:16:49 +0000 (21:16 +0000)]
We need pointer size in bits here.

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