]> granicus.if.org Git - clang/log
clang
14 years agoAdd PCH support for the remaining C++ exprs.
Argyrios Kyrtzidis [Sat, 10 Jul 2010 11:46:15 +0000 (11:46 +0000)]
Add PCH support for the remaining C++ exprs.

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

14 years agoFix CMake build
Peter Collingbourne [Fri, 9 Jul 2010 23:06:34 +0000 (23:06 +0000)]
Fix CMake build

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

14 years agoHack for dealing with commas until we support multiple alternative constraints, per...
John Thompson [Fri, 9 Jul 2010 22:49:34 +0000 (22:49 +0000)]
Hack for dealing with commas until we support multiple alternative constraints, per pr7338.

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

14 years agoBlockDeclRefExpr of a dependent type must
Fariborz Jahanian [Fri, 9 Jul 2010 22:21:32 +0000 (22:21 +0000)]
BlockDeclRefExpr of a dependent type must
be a dependent expression when its is built.

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

14 years agoInstantiation of byref variable in
Fariborz Jahanian [Fri, 9 Jul 2010 21:27:28 +0000 (21:27 +0000)]
Instantiation of byref variable in
block literal expression.

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

14 years agoSlightly improve the diagnostic when using a qualified function typedef to declare...
Sebastian Redl [Fri, 9 Jul 2010 21:26:08 +0000 (21:26 +0000)]
Slightly improve the diagnostic when using a qualified function typedef to declare nonmember or static member functions.

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

14 years agoReorganize how ClassTemplate[Partial]SpecializationDecls are read/written to avoid the
Argyrios Kyrtzidis [Fri, 9 Jul 2010 21:11:43 +0000 (21:11 +0000)]
Reorganize how ClassTemplate[Partial]SpecializationDecls are read/written to avoid the
possibility of adding an unitialized one into the folding set.

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

14 years agoisMemberSpecialization -> setMemberSpecialization.
Argyrios Kyrtzidis [Fri, 9 Jul 2010 21:11:35 +0000 (21:11 +0000)]
isMemberSpecialization -> setMemberSpecialization.

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

14 years agoWhen given the -chained-pch option and a previous PCH file, have the PCHWriter emit...
Sebastian Redl [Fri, 9 Jul 2010 21:00:24 +0000 (21:00 +0000)]
When given the -chained-pch option and a previous PCH file, have the PCHWriter emit a CHAINED_METADATA record instead of METADATA, and write a link to the previous file there.

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

14 years agoFix a crashing but trying to print a TemplateTemplateParmDecl
Craig Silverstein [Fri, 9 Jul 2010 20:25:10 +0000 (20:25 +0000)]
Fix a crashing but trying to print a TemplateTemplateParmDecl
for code like this:
   template<template<typename T> class U> class V {};

The problem is that the DeclPrinter assumed all TemplateDecls
have a getTemplatedClass(), but template template params don't
(so we got a NULL dereference).  The solution is to detect if
we're a template template param, and construct the template
class name ('class U') specially in this case.

OKed by dgregor and chandlerc

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

14 years agoIgnore -Wno-main, per PR7269.
Eli Friedman [Fri, 9 Jul 2010 20:03:13 +0000 (20:03 +0000)]
Ignore -Wno-main, per PR7269.

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

14 years agoRip out the floating point return type handling from the atomic builtin. It's
Chandler Carruth [Fri, 9 Jul 2010 19:19:40 +0000 (19:19 +0000)]
Rip out the floating point return type handling from the atomic builtin. It's
wrong, and we don't handle floating point value type arguments yet anyways.
Will add correct logic for both when I finish the patch.

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

14 years agoFix PR7600, and correctly convert the result of an atomic builtin to the
Chandler Carruth [Fri, 9 Jul 2010 18:59:35 +0000 (18:59 +0000)]
Fix PR7600, and correctly convert the result of an atomic builtin to the
expected value type. This is necessary as the builtin is internally represented
as only operating on integral types.

Also, add a FIXME to add support for floating point value types.

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

14 years agoInstantiation of block literal expressions. wip.
Fariborz Jahanian [Fri, 9 Jul 2010 18:44:02 +0000 (18:44 +0000)]
Instantiation of block literal expressions. wip.

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

14 years agoDocument my otherwise-inexplicable change
Douglas Gregor [Fri, 9 Jul 2010 18:39:07 +0000 (18:39 +0000)]
Document my otherwise-inexplicable change

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

14 years agoRefer to implicit "conversions" rather than implicit "casts", which
Douglas Gregor [Fri, 9 Jul 2010 18:18:35 +0000 (18:18 +0000)]
Refer to implicit "conversions" rather than implicit "casts", which
don't technically exist in the language. <rdar://problem/8085982>

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

14 years agoCorrectly initialize Reader to null.
Sebastian Redl [Fri, 9 Jul 2010 17:53:32 +0000 (17:53 +0000)]
Correctly initialize Reader to null.

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

14 years agoReally respect -chained-pch.
Sebastian Redl [Fri, 9 Jul 2010 17:40:12 +0000 (17:40 +0000)]
Really respect -chained-pch.

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

14 years agoIntroduce -f{no-}spell-checking options to enable/disable
Douglas Gregor [Fri, 9 Jul 2010 17:35:33 +0000 (17:35 +0000)]
Introduce -f{no-}spell-checking options to enable/disable
spell-checking. By default, spell-checking is enabled for Clang
(obviously) but disabled in CIndex for performance reasons.

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

14 years agoDocument -f{no-}color-diagnostics
Douglas Gregor [Fri, 9 Jul 2010 16:31:58 +0000 (16:31 +0000)]
Document -f{no-}color-diagnostics

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

14 years agoMove traverseunqualifiedtypeloc over to the 'main' typeloc tree.
Craig Silverstein [Fri, 9 Jul 2010 15:19:34 +0000 (15:19 +0000)]
Move traverseunqualifiedtypeloc over to the 'main' typeloc tree.
Note that this is a move -- we pretend that we were really looking
at the unqualified typeloc all along -- rather than a recursion, so
we don't follow the normal CRTP plan of going through
getDerived().TraverseTypeLoc.  If we did, we'd be traversing twice
for the same type (once as a QualifiedTypeLoc version of the type,
once as an UnqualifiedTypeLoc version of the type), which in effect
means we'd call VisitTypeLoc twice with the 'same' type.  This
solves that problem, at the cost of never seeing the qualified
version of the type (unless the client subclasses
TraverseQualifiedTypeLoc themselves).  It's not a perfect solution.
A perfect solution probably requires making QualifiedTypeLoc a
wrapper around TypeLoc -- like QualType is a wrapper around Type*
-- rather than being its own class in the type hierarchy.

Reviewed by wan.

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

14 years agoRevert 107953, remove comma ignoring from PPC constraints.
John Thompson [Fri, 9 Jul 2010 04:53:08 +0000 (04:53 +0000)]
Revert 107953, remove comma ignoring from PPC constraints.

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

14 years agoUpdating PPC target to ignore commas in asm contrains, as apparently that is what...
John Thompson [Fri, 9 Jul 2010 02:01:40 +0000 (02:01 +0000)]
Updating PPC target to ignore commas in asm contrains, as apparently that is what gcc does.

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

14 years agoAdd a frontend option -chained-pch and don't pass an active PCH reader to the PCH...
Sebastian Redl [Fri, 9 Jul 2010 00:00:58 +0000 (00:00 +0000)]
Add a frontend option -chained-pch and don't pass an active PCH reader to the PCH writer if it is not set, preventing creation of chained PCH files. Since the reader is so far unused, effectively no functionality change.

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

14 years agoCleanup in CStringChecker. Now properly bifurcates the state for zero/nonzero sizes.
Jordy Rose [Thu, 8 Jul 2010 23:57:29 +0000 (23:57 +0000)]
Cleanup in CStringChecker. Now properly bifurcates the state for zero/nonzero sizes.

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

14 years agoSupport code completion for parameter names in Objective-C method
Douglas Gregor [Thu, 8 Jul 2010 23:37:41 +0000 (23:37 +0000)]
Support code completion for parameter names in Objective-C method
declarations.

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

14 years agoIntroduce a new code-completion point prior to an identifier in the
Douglas Gregor [Thu, 8 Jul 2010 23:20:03 +0000 (23:20 +0000)]
Introduce a new code-completion point prior to an identifier in the
selector of an Objective-C method declaration, e.g., given

  - (int)first:(int)x second:(int)y;

this code completion point triggers at the location of "second". It
will provide completions that fill out the method declaration for any
known method, anywhere in the translation unit.

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

14 years agoWhen looking for an entity's Scope, don't consider scopes that can't contain declarat...
Sebastian Redl [Thu, 8 Jul 2010 23:07:34 +0000 (23:07 +0000)]
When looking for an entity's Scope, don't consider scopes that can't contain declarations. Fixes PR7594.

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

14 years agoSome preparatory work for chained PCH. No functionality change.
Sebastian Redl [Thu, 8 Jul 2010 22:01:51 +0000 (22:01 +0000)]
Some preparatory work for chained PCH. No functionality change.

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

14 years agoMakes RecursiveASTVisitor traverse the type of a temporary object
Zhanyong Wan [Thu, 8 Jul 2010 21:01:29 +0000 (21:01 +0000)]
Makes RecursiveASTVisitor traverse the type of a temporary object
created via T() where T is a class type.  Reviewed by chandlerc and
csilvers.

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

14 years agoDuring code completion, give the "nil" and "NULL" macros the same
Douglas Gregor [Thu, 8 Jul 2010 20:55:51 +0000 (20:55 +0000)]
During code completion, give the "nil" and "NULL" macros the same
priority as other constants. And, if we're in a place where we prefer
a pointer type, consider "nil" and "NULL" to be close matches.

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

14 years agoAllow C-style casts and reinterpret_casts between block pointers and
Douglas Gregor [Thu, 8 Jul 2010 20:27:32 +0000 (20:27 +0000)]
Allow C-style casts and reinterpret_casts between block pointers and
either integer values or other pointers. Fixes <rdar://problem/8134521>.

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

14 years agoPR7588: Fix the _mm_shufflehi_epi16 macro. (The issue was an oversight
Eli Friedman [Thu, 8 Jul 2010 20:09:45 +0000 (20:09 +0000)]
PR7588: Fix the _mm_shufflehi_epi16 macro.  (The issue was an oversight
involving operator precedence.)

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

14 years agoHandle forward declarations properly in debug info.
Devang Patel [Thu, 8 Jul 2010 19:56:29 +0000 (19:56 +0000)]
Handle forward declarations properly in debug info.
Patch by Alexander Kabaev.
PR 7595.

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

14 years agoAdd missing whitespace.
Ted Kremenek [Thu, 8 Jul 2010 19:43:08 +0000 (19:43 +0000)]
Add missing whitespace.

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

14 years agoWhen performing substitution of template arguments within the body of
Douglas Gregor [Thu, 8 Jul 2010 18:37:38 +0000 (18:37 +0000)]
When performing substitution of template arguments within the body of
a template, be sure to include the template arguments from the
injected-class-name. Fixes PR7587.

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

14 years agoUpdate checker build.
Ted Kremenek [Thu, 8 Jul 2010 18:08:18 +0000 (18:08 +0000)]
Update checker build.

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

14 years agoIntroduce PCHReader::GetTranslationUnitDecl() and use it instead of ReadDeclRecord...
Argyrios Kyrtzidis [Thu, 8 Jul 2010 17:13:02 +0000 (17:13 +0000)]
Introduce PCHReader::GetTranslationUnitDecl() and use it instead of ReadDeclRecord when initializing.

ReadDeclRecord would hit assertion if the translation unit declaration was already loaded during
IdentifierInfo initialization.

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

14 years agoSupport TemplateTemplateParmDecl for PCH.
Argyrios Kyrtzidis [Thu, 8 Jul 2010 17:12:57 +0000 (17:12 +0000)]
Support TemplateTemplateParmDecl for PCH.

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

14 years agoBowing to popular demand, reduce the "comma at end of enumerator list"
Douglas Gregor [Thu, 8 Jul 2010 14:54:42 +0000 (14:54 +0000)]
Bowing to popular demand, reduce the "comma at end of enumerator list"
ExtWarn to an Extension. Let the broken code propagate!

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

14 years agoApparently the {{$}} hack doesn't work on Windows; I am saddened but not
John McCall [Thu, 8 Jul 2010 13:17:29 +0000 (13:17 +0000)]
Apparently the {{$}} hack doesn't work on Windows;  I am saddened but not
surprised.

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

14 years agoFor TagType and TemplateSpecializationType, isDependent calculation may be invalid...
Argyrios Kyrtzidis [Thu, 8 Jul 2010 13:09:53 +0000 (13:09 +0000)]
For TagType and TemplateSpecializationType, isDependent calculation may be invalid because some decls that the
calculation is using may still be initializing.
Thus, store the isDependent flag to PCH and restore directly to Type.

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

14 years agoRead/write the C++ parts of DeclRefExpr and MemberExpr for PCH.
Argyrios Kyrtzidis [Thu, 8 Jul 2010 13:09:47 +0000 (13:09 +0000)]
Read/write the C++ parts of DeclRefExpr and MemberExpr for PCH.

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

14 years agoFix reading of UsingDecl from PCH.
Argyrios Kyrtzidis [Thu, 8 Jul 2010 13:09:41 +0000 (13:09 +0000)]
Fix reading of UsingDecl from PCH.

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

14 years agoRemove unused protected constructor of DeclRefExpr.
Argyrios Kyrtzidis [Thu, 8 Jul 2010 13:09:35 +0000 (13:09 +0000)]
Remove unused protected constructor of DeclRefExpr.

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

14 years agoWrap the new ext-warn on extraneous comma on the last entry of an enumerator
Chandler Carruth [Thu, 8 Jul 2010 10:52:01 +0000 (10:52 +0000)]
Wrap the new ext-warn on extraneous comma on the last entry of an enumerator
list in a diagnostic group so it can be turned on and off. A terrifying amount
of code, including large chunks of open source code, still do this so it's
important to be able to suppress it when necessary.

Doug, is this a reasonable compromise? I'd lean toward making it a normal
extension, but I don't feel strongly as long as we can turn the warnings off.

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

14 years agoAdd support for differentiating between attributes ignored when handled and
Chandler Carruth [Thu, 8 Jul 2010 09:42:26 +0000 (09:42 +0000)]
Add support for differentiating between attributes ignored when handled and
unknown attributes that we discard. Add a diagnostic group for unknown
attribute warnings to allow turning these off when we don't care. Also
consolidates the tests for this case.

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

14 years agoTweak documentation to mention Debug+Asserts.
Duncan Sands [Thu, 8 Jul 2010 08:31:28 +0000 (08:31 +0000)]
Tweak documentation to mention Debug+Asserts.

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

14 years agoMark calls to 'throw()' functions as nounwind, and mark the functions nounwind
John McCall [Thu, 8 Jul 2010 06:48:12 +0000 (06:48 +0000)]
Mark calls to 'throw()' functions as nounwind, and mark the functions nounwind
as well.

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

14 years agoReinstate the fix for PR7556. A silly use of isTrivial() was
Douglas Gregor [Thu, 8 Jul 2010 06:14:04 +0000 (06:14 +0000)]
Reinstate the fix for PR7556. A silly use of isTrivial() was
suppressing copies of objects with trivial copy constructors.

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

14 years agoallow this to pass on 32-bit hosts.
Chris Lattner [Thu, 8 Jul 2010 00:23:21 +0000 (00:23 +0000)]
allow this to pass on 32-bit hosts.

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

14 years agofix the clang side of PR7437: EmitAggregateCopy
Chris Lattner [Thu, 8 Jul 2010 00:07:45 +0000 (00:07 +0000)]
fix the clang side of PR7437: EmitAggregateCopy
was not producing a memcpy with the right address
spaces because of two places in it doing casts of
the arguments to i8, one of which that didn't
preserve the address space.

There is also an optimizer bug here.

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

14 years agofilecheckize this test.
Chris Lattner [Thu, 8 Jul 2010 00:05:45 +0000 (00:05 +0000)]
filecheckize this test.

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

14 years agoFix a few errors in the internals doc.
Sebastian Redl [Wed, 7 Jul 2010 23:42:27 +0000 (23:42 +0000)]
Fix a few errors in the internals doc.

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

14 years agoRevert r107828 and r107827, the fix for PR7556, which seems to be
Douglas Gregor [Wed, 7 Jul 2010 23:37:33 +0000 (23:37 +0000)]
Revert r107828 and r107827, the fix for PR7556, which seems to be
breaking bootstrap on Linux.

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

14 years agofix PR4499, patch by Kyle Dean!
Chris Lattner [Wed, 7 Jul 2010 23:24:27 +0000 (23:24 +0000)]
fix PR4499, patch by Kyle Dean!

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

14 years agoRip out the C++0x-specific handling of destructor names. The specification is still...
Sebastian Redl [Wed, 7 Jul 2010 23:17:38 +0000 (23:17 +0000)]
Rip out the C++0x-specific handling of destructor names. The specification is still in flux and unclear, and our interim workaround was broken. Fixes PR7467.

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

14 years agoA using declaration can redeclare a typedef to the same type. These
Douglas Gregor [Wed, 7 Jul 2010 23:08:52 +0000 (23:08 +0000)]
A using declaration can redeclare a typedef to the same type. These
typedefs won't have the same canonical declaration (since they are
distinct), so we need to check for this case specifically. Fixes
<rdar://problem/8018262>.

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

14 years agoRename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect its
Douglas Gregor [Wed, 7 Jul 2010 22:43:56 +0000 (22:43 +0000)]
Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect its
newly-narrowed scope. No functionality change.

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

14 years agoDo not use CXXZeroValueInitExpr for class types. Instead, use
Douglas Gregor [Wed, 7 Jul 2010 22:35:13 +0000 (22:35 +0000)]
Do not use CXXZeroValueInitExpr for class types. Instead, use
CXXConstructExpr/CXXTemporaryObjectExpr/CXXNewExpr as
appropriate. Fixes PR7556, and provides a slide codegen improvement
when copy-initializing a POD class type from a value-initialized
temporary. Previously, we weren't eliding the copy.

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

14 years agoFix an issue with opencl init list checking.
Nate Begeman [Wed, 7 Jul 2010 22:26:56 +0000 (22:26 +0000)]
Fix an issue with opencl init list checking.

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

14 years agoChanges how the TypeLoc traverser invokes the Type traverser: before,
Zhanyong Wan [Wed, 7 Jul 2010 21:36:58 +0000 (21:36 +0000)]
Changes how the TypeLoc traverser invokes the Type traverser: before,
VisitFooTypeLoc() calls VisitFooType(); now, TraverseFooTypeLoc()
calls WalkUpFromFooType(). This allows clients that override
WalkUpFromFooType() to continue to work.  It also preserves the
property that Visit*() in the base visitor class is a no-op (s.t. a
subclass doesn't have to call Base::Visit*() when overriding
Visit*()).

Also fixes some typos in comments.

Also added a missing getDerived() inside
TraverseQualifiedTypeLoc(). The call is needed in case a subclass
overrides TraverseTypeLoc().

Reviewed by nlewycky and csilvers.

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

14 years agoWhen printing statistics for the ASTContext, also print them for its BumpPtrAllocator
Douglas Gregor [Wed, 7 Jul 2010 16:40:34 +0000 (16:40 +0000)]
When printing statistics for the ASTContext, also print them for its BumpPtrAllocator

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

14 years agoadd driver support for minix, patch by Kees van Reeuwijk
Chris Lattner [Wed, 7 Jul 2010 16:01:42 +0000 (16:01 +0000)]
add driver support for minix, patch by Kees van Reeuwijk
from PR7583

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

14 years agoFix broken reading of NestedNameSpecifiers from PCH.
Argyrios Kyrtzidis [Wed, 7 Jul 2010 15:46:30 +0000 (15:46 +0000)]
Fix broken reading of NestedNameSpecifiers from PCH.

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

14 years agoDelay passing InterestingDecls to the Consumer until when we know we are not in recur...
Argyrios Kyrtzidis [Wed, 7 Jul 2010 15:46:26 +0000 (15:46 +0000)]
Delay passing InterestingDecls to the Consumer until when we know we are not in recursive loading and the
declarations are fully initialized.

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

14 years agogetBody() -> hasBody()
Argyrios Kyrtzidis [Wed, 7 Jul 2010 12:24:18 +0000 (12:24 +0000)]
getBody() -> hasBody()

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

14 years agoSimplify code and remove comment that is no longer relevant.
Argyrios Kyrtzidis [Wed, 7 Jul 2010 12:24:14 +0000 (12:24 +0000)]
Simplify code and remove comment that is no longer relevant.

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

14 years agoRemove Decl::getCompoundBody().
Argyrios Kyrtzidis [Wed, 7 Jul 2010 11:31:34 +0000 (11:31 +0000)]
Remove Decl::getCompoundBody().

This has 2 (slight) advantages:
-Make explicit at getBody()'s callsite that we expect/handle only CompoundStmt and not CXXTryStmt.
-Better tracking of Decl::getBody()'s callsites.

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

14 years agoSimplify code. CompoundStmt's RBraceLoc can be found using its SourceRange too.
Argyrios Kyrtzidis [Wed, 7 Jul 2010 11:31:27 +0000 (11:31 +0000)]
Simplify code. CompoundStmt's RBraceLoc can be found using its SourceRange too.

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

14 years agoSimplify code. FunctionDecl and ObjCMethodDecl have some common interfaces.
Argyrios Kyrtzidis [Wed, 7 Jul 2010 11:31:23 +0000 (11:31 +0000)]
Simplify code. FunctionDecl and ObjCMethodDecl have some common interfaces.

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

14 years agoIntroduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead of getBody...
Argyrios Kyrtzidis [Wed, 7 Jul 2010 11:31:19 +0000 (11:31 +0000)]
Introduce Decl::hasBody() and FunctionDecl::hasBody() and use them instead of getBody() when we are just checking the existence of a body, to avoid de-serialization of the body from PCH.

Makes de-serialization of the function body even more "lazier".

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

14 years agoAdd memcmp() and bcmp() to CStringChecker. These check for valid access to the buffer...
Jordy Rose [Wed, 7 Jul 2010 08:15:01 +0000 (08:15 +0000)]
Add memcmp() and bcmp() to CStringChecker. These check for valid access to the buffer arguments and have a special-case for when the buffer arguments are known to be the same address, or when the size is zero.

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

14 years agoA Release-Asserts build is now called a Release build.
Duncan Sands [Wed, 7 Jul 2010 07:49:17 +0000 (07:49 +0000)]
A Release-Asserts build is now called a Release build.

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

14 years agoCleanup on CStringChecker and its associated tests. Also check for null arguments...
Jordy Rose [Wed, 7 Jul 2010 07:48:06 +0000 (07:48 +0000)]
Cleanup on CStringChecker and its associated tests. Also check for null arguments...which are allowed if the access length is 0!

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

14 years agoTeach function-try-blocks on constructors and destructors to implicitly
John McCall [Wed, 7 Jul 2010 06:56:46 +0000 (06:56 +0000)]
Teach function-try-blocks on constructors and destructors to implicitly
rethrow.  Fixes rdar://problem/7696603

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

14 years agoimplement PR7569, warning about assignment to null, which
Chris Lattner [Wed, 7 Jul 2010 06:14:23 +0000 (06:14 +0000)]
implement PR7569, warning about assignment to null, which
people seem to write when they want a deterministic trap.
Suggest instead that they use a volatile pointer or
__builtin_trap.

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

14 years agoDon't consider casted non-global pointers to be evaluatable.
John McCall [Wed, 7 Jul 2010 05:08:32 +0000 (05:08 +0000)]
Don't consider casted non-global pointers to be evaluatable.
Fixes rdar://problem/8154689

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

14 years agoAvoid double-traversing for QualifiedTypeLoc -- we were calling
Craig Silverstein [Wed, 7 Jul 2010 04:38:11 +0000 (04:38 +0000)]
Avoid double-traversing for QualifiedTypeLoc -- we were calling
VisitTypeLoc twice for qualified types, once for the qualified form
and once for the unqualified (though they looked the same by the time
we got to visittypeloc).  Now only visit once, which matches previous
behavior.

Reviewed by nlewycky

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

14 years agoChange explicit handling of impossible condition to call llvm_unreachable in Idempote...
Tom Care [Wed, 7 Jul 2010 01:27:17 +0000 (01:27 +0000)]
Change explicit handling of impossible condition to call llvm_unreachable in IdempotentOperationChecker::PreVisitBinaryOperator.

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

14 years agoSilence an annoying GCC warning about use of an uninitialized variable. Even
Chandler Carruth [Wed, 7 Jul 2010 00:36:56 +0000 (00:36 +0000)]
Silence an annoying GCC warning about use of an uninitialized variable. Even
making the other switch case unreachable, or sinking the 'continue' into it
doesn't silence this.

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

14 years agoUse 'llvm_unreachable' to mark impossible code paths so that GCC doesn't
Chandler Carruth [Wed, 7 Jul 2010 00:07:37 +0000 (00:07 +0000)]
Use 'llvm_unreachable' to mark impossible code paths so that GCC doesn't
consider them for warnings.

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

14 years agoProvide a hook for the benefit of clients using clang IR gen as a subroutine:
John McCall [Tue, 6 Jul 2010 23:57:41 +0000 (23:57 +0000)]
Provide a hook for the benefit of clients using clang IR gen as a subroutine:
emit metadata associating allocas and global values with a Decl*.  This feature
is controlled by an option that (intentionally) cannot be enabled on the command
line.

To use this feature, simply set
  CodeGenOptions.EmitDeclMetadata = true;
and then interpret the completely underspecified metadata. :)

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

14 years agoFix casts in RegionStore to not always assume that bindings are only to SubRegions...
Ted Kremenek [Tue, 6 Jul 2010 23:53:29 +0000 (23:53 +0000)]
Fix casts in RegionStore to not always assume that bindings are only to SubRegions.  Fixes assertion failure
reported in PR 7572.

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

14 years agoAdd a const version of a method, to be consistent with other methods
Craig Silverstein [Tue, 6 Jul 2010 23:51:34 +0000 (23:51 +0000)]
Add a const version of a method, to be consistent with other methods
of the same type.  I think this was just an oversight before.

Reviewed by chandlerc.  Submitted as an "obvious" fix.

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

14 years agoFix idempotent operations test command line arguments.
Tom Care [Tue, 6 Jul 2010 23:47:26 +0000 (23:47 +0000)]
Fix idempotent operations test command line arguments.

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

14 years agoImplement dumpToStream() for NonStaticGlobalSpaceRegion and StaticGlobalSpaceRegion.
Ted Kremenek [Tue, 6 Jul 2010 23:37:21 +0000 (23:37 +0000)]
Implement dumpToStream() for NonStaticGlobalSpaceRegion and StaticGlobalSpaceRegion.

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

14 years agoAdd comment noting VLASizeChecker's duty in defining a VLA's extent.
Jordy Rose [Tue, 6 Jul 2010 23:33:54 +0000 (23:33 +0000)]
Add comment noting VLASizeChecker's duty in defining a VLA's extent.

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

14 years agoAdd a new path-sensitive checker for functions in <string.h>, for both null-terminate...
Jordy Rose [Tue, 6 Jul 2010 23:11:01 +0000 (23:11 +0000)]
Add a new path-sensitive checker for functions in <string.h>, for both null-terminated strings and memory blocks. Currently only checks memcpy(), memmove(), and bcopy(), but this is intended to be expanded soon.

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

14 years agoSort CMake file.
Ted Kremenek [Tue, 6 Jul 2010 22:03:19 +0000 (22:03 +0000)]
Sort CMake file.

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

14 years agoAdded a path-sensitive idempotent operation checker (-analyzer-idempotent-operation...
Tom Care [Tue, 6 Jul 2010 21:43:29 +0000 (21:43 +0000)]
Added a path-sensitive idempotent operation checker (-analyzer-idempotent-operation). Finds idempotent and/or tautological operations in a path sensitive context, flagging operations that have no effect or a predictable effect.

Example:
{
int a = 1;
int b = 5;
int c = b / a; // a is 1 on all paths
}

- New IdempotentOperationChecker class
- Moved recursive Stmt functions in r107675 to IdempotentOperationChecker
- Minor refactoring of SVal to allow checking for any integer
- Added command line option for check
- Added basic test cases

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

14 years agoFix multiple emission of the this-> fixit for each instantiation by fixing the
Nick Lewycky [Tue, 6 Jul 2010 19:51:49 +0000 (19:51 +0000)]
Fix multiple emission of the this-> fixit for each instantiation by fixing the
AST during the instantiation. Fixes PR7417!

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

14 years agoMake CGBuilderTy a typedef again; its functionality has been rolled back
John McCall [Tue, 6 Jul 2010 18:43:48 +0000 (18:43 +0000)]
Make CGBuilderTy a typedef again;  its functionality has been rolled back
into IRBuilder.

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

14 years agoImprove the accuracy of getSourceRange() for DeclaratorDecl and
Douglas Gregor [Tue, 6 Jul 2010 18:42:40 +0000 (18:42 +0000)]
Improve the accuracy of getSourceRange() for DeclaratorDecl and
TagDecl subclasses when out-of-line template declaration information
is available, from Peter Collingbourne!

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

14 years agoCorrectly set the location of the "template" keyword for a class
Douglas Gregor [Tue, 6 Jul 2010 18:33:12 +0000 (18:33 +0000)]
Correctly set the location of the "template" keyword for a class
template specialization, from Peter Collingbourne.

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

14 years agoRemove my egregious hack that forced deserialization of visible
Douglas Gregor [Tue, 6 Jul 2010 18:29:01 +0000 (18:29 +0000)]
Remove my egregious hack that forced deserialization of visible
declarations when implicitly declaring the default constructor, copy
constructor, destructor, and copy-assignment operators of a
class. Argiris fixed the underlying problem in r107596.

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

14 years agoPacify versions of gcc that think these variables may be used
Duncan Sands [Tue, 6 Jul 2010 18:19:40 +0000 (18:19 +0000)]
Pacify versions of gcc that think these variables may be used
uninitialized (which doesn't seem to be the case), by giving
them arbitrary initial values.

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

14 years agoWhen destroying a cleanup, kill any references to instructions in the entry
John McCall [Tue, 6 Jul 2010 17:35:03 +0000 (17:35 +0000)]
When destroying a cleanup, kill any references to instructions in the entry
block before deleting it.  Fixes PR7575.

This really just a short-term fix before implementing lazy cleanups.

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

14 years agoAdded several helper functions to Stmt to recursively check for different elements...
Tom Care [Tue, 6 Jul 2010 17:28:49 +0000 (17:28 +0000)]
Added several helper functions to Stmt to recursively check for different elements (macros, enum constants, etc).

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

14 years agoRead/write function template specializations for PCH, properly this time.
Argyrios Kyrtzidis [Tue, 6 Jul 2010 15:37:09 +0000 (15:37 +0000)]
Read/write function template specializations for PCH, properly this time.

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