Francois Pichet [Sun, 16 Jan 2011 21:44:17 +0000 (21:44 +0000)]
Downgrade ext_enumerator_too_large from ExtWarn to Extension in Microsoft mode. Otherwise you can warnings flooding trying to selfhost clang with fms-extensions because of "unsigned int" -> "signed int" enumerator conversion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123600
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sun, 16 Jan 2011 16:13:16 +0000 (16:13 +0000)]
Emit an extension diagnostic for C99 designated initializers that appear in C++ code
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123582
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sun, 16 Jan 2011 16:03:23 +0000 (16:03 +0000)]
Tweak the partial ordering rules for function templates to prefer a
non-variadic function template over a variadic one. This matches GCC
and the intent of the C++0x wording, in a way that I think is likely
to be acceptable to the committee.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123581
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 16 Jan 2011 08:14:11 +0000 (08:14 +0000)]
improve compatibility with GCC: when generating the ".d" filename to use
and the filename has multiple .'s in it, use the last. For example, "foo.bar.cpp"
should produce "foo.bar.d" not "foo.d". Patch by Johan Boule in PR8391
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123576
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Sat, 15 Jan 2011 21:43:57 +0000 (21:43 +0000)]
AST/InheritViz: Remove all internal uses of PathV1.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123553
91177308-0d34-0410-b5e6-
96231b3b80d8
Ken Dyck [Sat, 15 Jan 2011 18:38:59 +0000 (18:38 +0000)]
Add toCharUnitsInBits() to simplify the many calls to CharUnits::fromQuantity() of the form CharUnits::fromQuantity(bitSize, Context.getCharWidth()).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123542
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Sat, 15 Jan 2011 13:27:47 +0000 (13:27 +0000)]
Unbreak the MSVC build again: replace bzero by memset.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123538
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 15 Jan 2011 08:23:14 +0000 (08:23 +0000)]
Also set unnamed_addr on declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123531
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 15 Jan 2011 06:57:04 +0000 (06:57 +0000)]
clean up some dead code around __has_include() processing code identified by the ted-o-matic.
rdar://
8867482
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123522
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sat, 15 Jan 2011 06:45:20 +0000 (06:45 +0000)]
Introduce a new kind of TemplateName that captures a substituted
template template parameter pack that cannot be fully expanded because
its enclosing pack expansion could not be expanded. This form of
TemplateName plays the same role as SubstTemplateTypeParmPackType and
SubstNonTypeTemplateParmPackExpr do for template type parameter packs
and non-type template parameter packs, respectively.
We should now handle these multi-level pack expansion substitutions
anywhere. The largest remaining gap in our variadic-templates support
is that we cannot cope with non-type template parameter packs whose
type is a pack expansion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123521
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sat, 15 Jan 2011 02:58:47 +0000 (02:58 +0000)]
Add initial prototype for implementation of
-Wuninitialized based on CFG dataflow analysis. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123512
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sat, 15 Jan 2011 02:58:42 +0000 (02:58 +0000)]
Add const version if CFG::isBlkExpr().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123511
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Sat, 15 Jan 2011 02:56:16 +0000 (02:56 +0000)]
Store/retrieve -fshort-enums for PCH, fixes rdar://
8854933.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123510
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sat, 15 Jan 2011 01:39:24 +0000 (01:39 +0000)]
Tweak the storage mechanism for a set of overloaded template names in
the TemplateName class. Nothing actually changes, but I find this less
objectionable (and it will factor into an upcoming change).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123508
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Sat, 15 Jan 2011 01:15:58 +0000 (01:15 +0000)]
Introduce a new expression kind, SubstNonTypeTemplateParmPackExpr,
that captures the substitution of a non-type template argument pack
for a non-type template parameter pack within a pack expansion that
cannot be fully expanded. This follows the approach taken by
SubstTemplateTypeParmPackType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123506
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 14 Jan 2011 23:41:42 +0000 (23:41 +0000)]
Teach template template argument pack expansions to keep track of the
number of expansions, when we know it, and propagate that information
through Sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123493
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 14 Jan 2011 22:40:04 +0000 (22:40 +0000)]
Handle substitutions into function parameter packs whose patterns
contain multiple parameter packs at different levels.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123488
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 14 Jan 2011 22:31:41 +0000 (22:31 +0000)]
Cleanup confused code that redundantly called "getDeclContext()" twice.
Found by clang static analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123485
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 14 Jan 2011 22:31:38 +0000 (22:31 +0000)]
The variable 'ReusedDecl' is written but never read.
Remove this variable (found by clang static analyzer).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123484
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 14 Jan 2011 22:31:36 +0000 (22:31 +0000)]
The variable 'isTemplateSpecialization' is no longer
used; nuke all assignments and its declaration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123483
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 14 Jan 2011 22:31:34 +0000 (22:31 +0000)]
Remove unused store to variable 'Name'. Found by clang static analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123482
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 14 Jan 2011 22:31:31 +0000 (22:31 +0000)]
Driver: tweak handling of '--analyze' to invoke
analyzer -cc1 options that are tailored to the
input type. If the input type is "C++", we should
only run the dead stores checker (for now). Similarly,
checks specific to Objective-C should only run
on Objective-C Code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123481
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 14 Jan 2011 22:19:38 +0000 (22:19 +0000)]
Fixed by r123477.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123478
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 14 Jan 2011 21:20:45 +0000 (21:20 +0000)]
Teach PackExpansionExpr to keep track of the number of pack expansions
it will expand to, if known. Propagate this information throughout Sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123470
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Fri, 14 Jan 2011 20:54:07 +0000 (20:54 +0000)]
Properly propagate #pragma diagnostic mappings from PCH but not command-line warning flags.
Addresses rdar://
8435969&
8852495
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123462
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 14 Jan 2011 20:34:15 +0000 (20:34 +0000)]
Rename 'RemoveDeadBindings()' to 'removeDeadBindings()'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123460
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 14 Jan 2011 20:34:10 +0000 (20:34 +0000)]
Rename 'EnterStackFrame()' to 'enterStackFrame()'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123459
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 14 Jan 2011 20:29:43 +0000 (20:29 +0000)]
Teach RegionStore::EnterStackFrame() to handle
the case where the called function has fewer
formal arguments than actual arguments. This
fixes a crash in the analyzer when doing
function call inlining.
Patch by Zhenbo Xu!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123458
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 14 Jan 2011 17:12:22 +0000 (17:12 +0000)]
When we're instantiating a direct variable initializer that has a pack
expansion in it, we may end up instantiating to an empty
expression-list. In this case, the variable is uninitialized; tweak
the instantiation logic to handle this case. Fixes PR8977.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123449
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 14 Jan 2011 17:04:44 +0000 (17:04 +0000)]
Keep track of the number of expansions to be produced from a type pack
expansion, when it is known due to the substitution of an out
parameter pack. This allows us to properly handle substitution into
pack expansions that involve multiple parameter packs at different
template parameter levels, even when this substitution happens one
level at a time (as with partial specializations of member class
templates and the signatures of member function templates).
Note that the diagnostic we provide when there is an arity mismatch
between an outer parameter pack and an inner parameter pack in this
case isn't as clear as the normal diagnostic for an arity
mismatch. However, this doesn't matter because these cases are very,
very rare and (even then) only typically occur in a SFINAE context.
The other kinds of pack expansions (expression, template, etc.) still
need to support optional tracking of the number of expansions, and we
need the moral equivalent of SubstTemplateTypeParmPackType for
substituted argument packs of template template and non-type template
parameters.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123448
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Fri, 14 Jan 2011 10:37:58 +0000 (10:37 +0000)]
Support the zero-initialization of VLAs when that really means a zero
bit-pattern. Continue punting on zero-initializing VLAs with a nonzero
pattern.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123439
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Fri, 14 Jan 2011 10:35:38 +0000 (10:35 +0000)]
When simplifying a cleanup's entry by merging it into a single predecessor,
replace all uses of the entry with the predecessor. There are no cleanups
relying on this right now, but if we ever want a cleanup with a phi inside
it, this will be important.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123438
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 14 Jan 2011 05:30:12 +0000 (05:30 +0000)]
temporarily xfail, this was broken by r123418
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123430
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 14 Jan 2011 05:11:40 +0000 (05:11 +0000)]
Fix a few warnings stemming from my inability to properly fill out
switch() statements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123429
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 14 Jan 2011 02:55:32 +0000 (02:55 +0000)]
Start implementing support for substitution into pack expansions that
involve template parameter packs at multiple template levels that
occur within the signatures members of class templates (and partial
specializations thereof). This is a work-in-progress that is deficient
in several ways, notably:
- It only works for template type parameter packs, but we need to
also support non-type template parameter packs and template template
parameter packs.
- It doesn't keep track of the lengths of the substituted argument
packs in the expansion, so it can't properly diagnose length
mismatches.
However, this is a concrete step in the right direction.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123425
91177308-0d34-0410-b5e6-
96231b3b80d8
Ken Dyck [Fri, 14 Jan 2011 02:01:36 +0000 (02:01 +0000)]
Replace a literal '8' with getCharWidth().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123421
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Thu, 13 Jan 2011 23:35:06 +0000 (23:35 +0000)]
Unbreak the MSVC build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123412
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Thu, 13 Jan 2011 21:35:27 +0000 (21:35 +0000)]
Save getObjCGCAttrKind and use it in two places
for efficiancy (still part of //rdar://
8761767).
Per John's comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123401
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 13 Jan 2011 20:58:59 +0000 (20:58 +0000)]
Rename 'CheckDeadStores.cpp' to 'DeadStoresChecker.cpp'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123395
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 13 Jan 2011 20:58:56 +0000 (20:58 +0000)]
Remove warning in dead stores checker for
dead stores within nested assignments. I have
never seen an actual bug found by this specific
warning, and it can lead to many false positives.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123394
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Thu, 13 Jan 2011 20:00:54 +0000 (20:00 +0000)]
Generate write-barriers for global objc
assigns. // rdar://
8761767
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123391
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 13 Jan 2011 18:57:25 +0000 (18:57 +0000)]
Move name mangling support from CodeGen to AST. In the
process, perform a number of refactorings:
- Move MiscNameMangler member functions to MangleContext
- Remove GlobalDecl dependency from MangleContext
- Make MangleContext abstract and move Itanium/Microsoft functionality
to their own classes/files
- Implement ASTContext::createMangleContext and have CodeGen use it
No (intended) functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123386
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 13 Jan 2011 18:47:47 +0000 (18:47 +0000)]
Only apply the parameter pack matching of C++0x [temp.arg.template]p3
when we're actually matching a template template argument to a
template template parameter. Otherwise, use strict matching.
Fixes <rdar://problem/
8859985> clang++: variadics and out-of-line definitions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123385
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 13 Jan 2011 18:03:24 +0000 (18:03 +0000)]
Fix a test case
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123382
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 13 Jan 2011 17:44:36 +0000 (17:44 +0000)]
When your comments and your code are out-of-sync, the test case is wrong.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123379
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 13 Jan 2011 16:39:34 +0000 (16:39 +0000)]
Add tests for name mangling of variadic templates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123378
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Thu, 13 Jan 2011 12:46:31 +0000 (12:46 +0000)]
CXXBaseObjectRegion is like FieldRegion. Need to blast through it when
getting the base region. This makes the RemoveDeadBindings() correct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123375
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Thu, 13 Jan 2011 12:30:12 +0000 (12:30 +0000)]
Support inlining base initializers. We still haven't got it completely right,
since the bindings are purged after they are set up. Need to investigate
RemoveDeadBindings algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123374
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Thu, 13 Jan 2011 07:59:59 +0000 (07:59 +0000)]
Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123370
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 13 Jan 2011 06:58:15 +0000 (06:58 +0000)]
Fix a corner case in RegionStore where we assign
a struct value to a symbolic index into array.
RegionStore can't actually reason about this,
so we were getting bogus warnings about loading
uninitialized values from the array. The solution
is invalidate the entire array when we cannot
represent the binding explicitly.
Fixes <rdar://problem/
8848957>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123368
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 13 Jan 2011 04:36:46 +0000 (04:36 +0000)]
Rename 'HasGeneratedNode' to 'hasGeneratedNode'
and 'getBasePredecessor()' to 'getPredecessor()'.
Also remove a unneeded save-and-restore of
node builder's tag field.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123363
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 13 Jan 2011 04:36:40 +0000 (04:36 +0000)]
Remove unnecessary save-and-restore of the
node builder's 'HasGeneratedNode' field.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123362
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Thu, 13 Jan 2011 04:36:36 +0000 (04:36 +0000)]
Remove CheckerContext's dependence on setting
the node builder's "tag" ivar (which we would
like to remove).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123361
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Thu, 13 Jan 2011 02:03:06 +0000 (02:03 +0000)]
Ensure an insertion point at the end of a statement-expression.
Fixes PR8967.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123360
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 13 Jan 2011 01:35:58 +0000 (01:35 +0000)]
optimize out a temporary sys::Path
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123359
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 13 Jan 2011 01:12:55 +0000 (01:12 +0000)]
Only add unnamed_addr to definitions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123354
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 13 Jan 2011 00:19:55 +0000 (00:19 +0000)]
Allow us to transform pack expansion expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123349
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 13 Jan 2011 00:08:50 +0000 (00:08 +0000)]
Implement C++0x [temp.arg.template]p3, which allows slightly fuzzy
matching of variadic template template parameters to template
arguments. This paragraph was the subject of ISO C++ committee
document N2555: Extending Variadic Template Template Parameters.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123348
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Wed, 12 Jan 2011 23:54:48 +0000 (23:54 +0000)]
replace all uses of PathV1::IsSymlink with PathV2::is_symlink.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123344
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Wed, 12 Jan 2011 23:45:44 +0000 (23:45 +0000)]
Refactor and simplify Sema::TemplateParameterListsAreEqual. We had a
bunch of duplicated checks for parameter pack/non-pack mismatches.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123343
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Wed, 12 Jan 2011 22:41:29 +0000 (22:41 +0000)]
Add the location of the right parenthesis of a C++ named cast
(static_cast, dynamic_cast, reinterpret_cast, or const_cast) to
improve source-location information. Fixes PR8960.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123336
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Wed, 12 Jan 2011 22:11:34 +0000 (22:11 +0000)]
Add IR generation support for SizeOfPackExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123332
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Wed, 12 Jan 2011 22:04:05 +0000 (22:04 +0000)]
Add some more partial-ordering tests, including one that changes with
the proposed resolution to core isue 692. I'm not certain which way
we'll go on this one.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123331
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Wed, 12 Jan 2011 21:19:25 +0000 (21:19 +0000)]
wint_t is defined as 'unsigned int' on Linux. Fixes PR8938.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123320
91177308-0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Wed, 12 Jan 2011 19:36:11 +0000 (19:36 +0000)]
Update Xcode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123319
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Wed, 12 Jan 2011 17:07:58 +0000 (17:07 +0000)]
Teach TreeTransform how to transform a pack expansion type into
another pack expansion type. This can happen when rebuilding types in
the current instantiation.
Fixes <rdar://problem/
8848837> (Clang crashing on libc++ <functional>).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123316
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Wed, 12 Jan 2011 09:06:06 +0000 (09:06 +0000)]
PR3558: mark "logically const" accessor methods in ASTContext as const,
and mark the fields they use as mutable. This allows us to remove a few
const_casts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123314
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Wed, 12 Jan 2011 07:20:03 +0000 (07:20 +0000)]
Add some documentation for C++ static analyzer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123313
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Wed, 12 Jan 2011 06:24:01 +0000 (06:24 +0000)]
Add cast expr kinds to CheckerVisitor.def.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123312
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Wed, 12 Jan 2011 03:41:02 +0000 (03:41 +0000)]
Fix a latent bug where, after emitting an expression statement, we would
delete the block we began emitting into if it had no predecessors. We never
want to do this, because there are several valid cases during statement
emission where an existing block has no known predecessors but will acquire
some later. The case in my test case doesn't inherently fall into this
category, because we could safely emit the case-range code before the statement
body, but there are examples with labels that can't be fallen into
that would also demonstrate this bug.
rdar://problem/
8837067
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123303
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Wed, 12 Jan 2011 00:43:47 +0000 (00:43 +0000)]
Driver: Change -dumpversion to return a GCC compatible answer.
- See comment for why.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123296
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Wed, 12 Jan 2011 00:34:59 +0000 (00:34 +0000)]
Slight bugfix to the attribute-distribution logic for GC attributes.
Slight optimization of getObjCGCAttrKind.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123295
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 11 Jan 2011 23:55:05 +0000 (23:55 +0000)]
Set unnamed_addr in every type info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123293
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Tue, 11 Jan 2011 23:38:13 +0000 (23:38 +0000)]
Add a comment for r123231.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123291
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 11 Jan 2011 23:09:57 +0000 (23:09 +0000)]
Add TemplateArgument::CreatePackCopy() to create a new parameter pack
in ASTContext-allocated memory, copying the provided template
arguments. Use this new routine where we can. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123289
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 11 Jan 2011 22:29:55 +0000 (22:29 +0000)]
Set unnamed_addr in VTTs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123280
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 11 Jan 2011 22:21:24 +0000 (22:21 +0000)]
Implement partial ordering of class template partial specializations
and function templates that contain variadic templates. This involves
three small-ish changes:
(1) When transforming a pack expansion, if the transformed argument
still contains unexpanded parameter packs, build a pack
expansion. This can happen during the substitution that occurs into
class template partial specialiation template arguments during
partial ordering.
(2) When performing template argument deduction where the argument
is a pack expansion, match against the pattern of that pack
expansion.
(3) When performing template argument deduction against a non-pack
parameter, or a non-expansion template argument, deduction fails if
the argument itself is a pack expansion (C++0x
[temp.deduct.type]p22).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123279
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 11 Jan 2011 21:44:37 +0000 (21:44 +0000)]
Set unnamed_addr for type infos that we are confortable marking as hidden. I
think it is safe to mark all type infos with unnamed_addr, but I am not sure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123275
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 11 Jan 2011 21:10:26 +0000 (21:10 +0000)]
Add unnamed_addr to vtables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123272
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 11 Jan 2011 20:37:13 +0000 (20:37 +0000)]
Add back 122079 so we can ignore the argument some more.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123271
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Tue, 11 Jan 2011 19:45:25 +0000 (19:45 +0000)]
[analyzer] Introduce ObjCSelfInitChecker, which checks initialization methods to verify that they assign 'self' to the
result of an initialization call (e.g. [super init], or [self initWith..]) before using any instance variable or
returning 'self'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123264
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Tue, 11 Jan 2011 19:45:20 +0000 (19:45 +0000)]
[analyzer] Support post-visiting ObjCIvarRefExprs for checkers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123263
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Tue, 11 Jan 2011 19:45:16 +0000 (19:45 +0000)]
[analyzer] Add 'bool ignorePrefix' parameter to cocoa::deriveNamingConvention to control whether
the prefix should be ignored.
E.g. if ignorePrefix is true, "_init" and "init" selectors will both be result in InitRule, but if
ignorePrefix is false, only "init" will return InitRule.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123262
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Tue, 11 Jan 2011 19:45:13 +0000 (19:45 +0000)]
[analyzer] Add 'isLoad' parameter in Checker::visitLocation() to conveniently distinguish between loads/stores.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123261
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 11 Jan 2011 17:51:55 +0000 (17:51 +0000)]
Add another test for [temp.func.order]p5/[temp.deduct.partial]p11,
from James Widman.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123245
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 11 Jan 2011 17:34:58 +0000 (17:34 +0000)]
Implement C++ [temp.func.order]p5 more directly, by passing down the
number of explicit call arguments. This actually fixes an erroneous
test for [temp.deduct.partial]p11, where we were considering
parameters corresponding to arguments beyond those that were
explicitly provided.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123244
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Tue, 11 Jan 2011 16:53:49 +0000 (16:53 +0000)]
Remove special handling for opaque Neon vector types.
Clang does not wrap the vectors in structs anymore so this isn't needed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123241
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 11 Jan 2011 16:53:44 +0000 (16:53 +0000)]
Remove ProgramPoint parameter from GenericNodeBuilder::generateNode().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123240
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 11 Jan 2011 15:36:52 +0000 (15:36 +0000)]
Add example from C++0x [temp.deduct.type]p21, which already works
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123237
91177308-0d34-0410-b5e6-
96231b3b80d8
Abramo Bagnara [Tue, 11 Jan 2011 15:16:52 +0000 (15:16 +0000)]
Added warning about invalid register specification for local variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123236
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Tue, 11 Jan 2011 12:23:00 +0000 (12:23 +0000)]
In Microsoft mode, force 64 bit hex integer constants to signed type if the LL or i64 suffix is used. This MSVC behavior.
For example:
void f(long long){ printf("long long"); }
void f(unsigned long long) { printf("unsigned long long"); }
int main() {
f(0xffffffffffffffffLL);
}
Will print "long long" using MSVC.
This patch also fixes 16 compile errors related to overloading issues when parsing the MSVC 2008 C++ standard lib.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123231
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Tue, 11 Jan 2011 11:57:53 +0000 (11:57 +0000)]
Microsoft integer suffix changes:
i64 is like LL
i32 is like L
Also set isMicrosoftInteger to true only if the suffix is well formed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123230
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Tue, 11 Jan 2011 10:41:37 +0000 (10:41 +0000)]
Rename GenericNodeBuilder to GenericNodeBuilderRefCount to avoid namespace clash using MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123228
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 11 Jan 2011 06:37:47 +0000 (06:37 +0000)]
Rework ExprEngine::processCFGBlockEntrance()
to use a node builder. This paves the way
for Checkers to interpose (via a "visit" method)
at the entrance to blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123217
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 11 Jan 2011 04:49:40 +0000 (04:49 +0000)]
Remove several silly methods from ento::CoreEngine
that just forwarded to ento::SubEngine.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123216
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 11 Jan 2011 03:23:19 +0000 (03:23 +0000)]
Ensure that the result type of an Objective-C class message send is
complete. However, if it returns a reference type, don't require the
type it refers to to be complete. Fixes <rdar://problem/
8807070>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123214
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 11 Jan 2011 03:14:20 +0000 (03:14 +0000)]
When mapping from a function parameter pack to the set of function
parameters it expanded to, map exactly the number of function
parameters that were expanded rather than just running to the end of
the instantiated parameter list. This finishes the implementation of
the last sentence of C++0x [temp.deduct.call]p1.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123213
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 11 Jan 2011 02:34:50 +0000 (02:34 +0000)]
Rename misc. methods in ento::Worklist to start
with lowercase letter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123212
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 11 Jan 2011 02:34:45 +0000 (02:34 +0000)]
Rename misc. methods in GRSubEngine to start
with a lower-case letter. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123211
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 11 Jan 2011 01:52:23 +0000 (01:52 +0000)]
Implement the last bullet of [temp.deduct.type]p5 and part of the last
sentence of [temp.deduct.call]p1, both of which concern the
non-deducibility of parameter packs not at the end of a
parameter-type-list. The latter isn't fully implemented yet; see the
new FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123210
91177308-0d34-0410-b5e6-
96231b3b80d8