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
Michael J. Spencer [Tue, 11 Jan 2011 01:21:20 +0000 (01:21 +0000)]
Replace all uses of PathV1::isDirectory with PathV2::fs::is_directory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123208
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 11 Jan 2011 00:45:18 +0000 (00:45 +0000)]
Make sure that we parse a '>>' that closes two template argument lists
appropritely when there are no other template arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123204
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 11 Jan 2011 00:33:19 +0000 (00:33 +0000)]
When we're inside a functional cast, '>' is an operator. Fixes PR8912.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123201
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 11 Jan 2011 00:30:27 +0000 (00:30 +0000)]
Fix debug info for __block variable referenced outside of block.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123199
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 11 Jan 2011 00:27:36 +0000 (00:27 +0000)]
Add testing for unexpanded parameter packs in all of the C++
expression kinds. This is (indirectly) a test verifying that the
recursive AST visitor is visiting the children of these expression
nodes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123198
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Tue, 11 Jan 2011 00:26:26 +0000 (00:26 +0000)]
Add unnamed_addr to constructors and destructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123197
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Mon, 10 Jan 2011 23:54:17 +0000 (23:54 +0000)]
Move DefaultABIInfo::classifyReturnType where it belongs. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123195
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Beaumont-Gay [Mon, 10 Jan 2011 23:53:06 +0000 (23:53 +0000)]
Only traverse template argument locations if we actually have explicit
template arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123194
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 10 Jan 2011 22:34:03 +0000 (22:34 +0000)]
Add unnamed_addr when creating artificial string globals. For example, in
static const char foo[] = "foo";
static const char *bar = "bar";
the global created to hold "bar" will have it, but foo will not.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123192
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 10 Jan 2011 20:53:55 +0000 (20:53 +0000)]
Implement more of C++0x [temp.arg.explicit]p9, allowing extension of
pack expansions in template argument lists and function parameter
lists. The implementation of this paragraph should be complete
*except* for cases where we're substituting into one of the unexpanded
packs in a pack expansion; that's a general issue I haven't solved yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123188
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Mon, 10 Jan 2011 18:23:55 +0000 (18:23 +0000)]
Fix a comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123184
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Mon, 10 Jan 2011 17:55:14 +0000 (17:55 +0000)]
NEON vector support for ARM is in pretty good shape now. Update the docs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123183
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 10 Jan 2011 17:53:52 +0000 (17:53 +0000)]
Repent for my copy-and-paste sins, factoring out the code that forms
argument packs from a set of deduced arguments, then checks that those
argument packs match previously-deduced argument packs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123182
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 10 Jan 2011 17:35:05 +0000 (17:35 +0000)]
Factor out the code to set up template argument deduction for a set of
template argument packs. This also ensures that explicitly-specified
template arguments get properly represented in those cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123180
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Mon, 10 Jan 2011 11:28:29 +0000 (11:28 +0000)]
Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123168
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Mon, 10 Jan 2011 09:33:41 +0000 (09:33 +0000)]
Fix CMakeLists.txt.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123167
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Mon, 10 Jan 2011 09:23:01 +0000 (09:23 +0000)]
Revert r123160. There are linking dependency problems.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123166
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 10 Jan 2011 07:32:04 +0000 (07:32 +0000)]
Work-in-progress implementation of C++0x [temp.arg.explicit]p9, which
allows an argument pack determines via explicit specification of
function template arguments to be extended by further, deduced
arguments. For example:
template<class ... Types> void f(Types ... values);
void g() {
f<int*, float*>(0, 0, 0); // Types is deduced to the sequence int*, float*, int
}
There are a number of FIXMEs in here that indicate places where we
need to implement + test retained expansions, plus a number of other
places in deduction where we need to correctly cope with the
explicitly-specified arguments when deducing an argument
pack. Furthermore, it appears that the RecursiveASTVisitor needs to be
auditied; it's missing some traversals (especially w.r.t. template
arguments) that cause it not to find unexpanded parameter packs when
it should.
The good news, however, is that the tr1::tuple implementation now
works fully, and the tr1::bind example (both from N2080) is actually
working now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123163
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 10 Jan 2011 07:26:53 +0000 (07:26 +0000)]
Unbreak the CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123162
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Mon, 10 Jan 2011 05:52:42 +0000 (05:52 +0000)]
ExprEngine.cpp and AnalysisConsumer.cpp should not be in the Checkers directory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123160
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Mon, 10 Jan 2011 05:39:35 +0000 (05:39 +0000)]
Add some expression kinds to CheckerVisitor.def.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123159
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Mon, 10 Jan 2011 03:54:19 +0000 (03:54 +0000)]
In C++, assignment and compound assignment operators return an lvalue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123158
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Mon, 10 Jan 2011 03:22:57 +0000 (03:22 +0000)]
The isPrefix() checking is redundant. Lvalue incremental/decremental expressions
are all prefixes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123156
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Mon, 10 Jan 2011 02:34:13 +0000 (02:34 +0000)]
Replace all uses of PathV1::exists with PathV2::fs::exists.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123150
91177308-0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Mon, 10 Jan 2011 02:22:04 +0000 (02:22 +0000)]
Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123147
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Sun, 9 Jan 2011 22:32:25 +0000 (22:32 +0000)]
Don't crash if SpecString is an empty string.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123134
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 9 Jan 2011 13:21:33 +0000 (13:21 +0000)]
Make a helper function static.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123118
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Hunt [Sat, 8 Jan 2011 23:01:16 +0000 (23:01 +0000)]
Rename CXXCtorInitializer::BaseOrMember to Initializee, since it will also be
used to store the CXXConstructorDecl in a delegating constructor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123095
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Hunt [Sat, 8 Jan 2011 20:30:50 +0000 (20:30 +0000)]
Renamed CXXBaseOrMemberInitializer to CXXCtorInitializer. This is both shorter,
more accurate, and makes it make sense for it to hold a delegating constructor
call.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123084
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Hunt [Sat, 8 Jan 2011 19:20:43 +0000 (19:20 +0000)]
Check for delegating constructors and (currently) return an error about them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123076
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 8 Jan 2011 06:54:40 +0000 (06:54 +0000)]
Remove a kludge from analysis based warnings that used to detect
temporaries with no-return destructors. The CFG now properly supports
temporaries and implicit destructors which both makes this kludge no
longer work, and conveniently removes the need for it.
Turn on CFG handling of implicit destructors and initializers. Several
ad-hoc benchmarks don't indicate any measurable performance impact from
growing the CFG, and it fixes real correctness problems with warnings.
As a result of turning on these CFG elements, we started to tickle an
inf-loop in the unreachable code logic used for warnings. The fix is
trivial.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123056
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sat, 8 Jan 2011 05:28:46 +0000 (05:28 +0000)]
Add semantic checking that the "thousands grouping"
prefix in a printf format string is matched
with the appropriate conversion specifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123055
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sat, 8 Jan 2011 05:28:38 +0000 (05:28 +0000)]
Add printf format string parsing support for '
prefix to format conversions (POSIX extension).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123054
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 7 Jan 2011 22:44:49 +0000 (22:44 +0000)]
Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123041
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 7 Jan 2011 19:56:20 +0000 (19:56 +0000)]
Variadic templates example: a nearly-complete implementation of a TR1
function class template.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123024
91177308-0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Fri, 7 Jan 2011 19:37:16 +0000 (19:37 +0000)]
Fix crash in CFGBuilder on invalid code. We still need
to reject this code, but at least clang doesn't
crash anymore.
Crash reported in PR 8880.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123017
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 7 Jan 2011 19:37:08 +0000 (19:37 +0000)]
Variadic templates example: a nearly-complete implementation of a TR1
tuple class template. This implementation is boosted directly from the
variadic templates proposal. N2080.
Note that one section is #ifdef'd out. I'll implement that aspect of
template argument deduction next.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123016
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 7 Jan 2011 19:35:17 +0000 (19:35 +0000)]
When instantiating the arguments to an initializer, use the
TreeTransform version of TransformExprs() rather than explicit loop,
so that we expand pack expansions properly. Test cast coming soon...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123014
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 7 Jan 2011 19:27:47 +0000 (19:27 +0000)]
Fix a valgrind error when transforming function prototypes with
function parameter pack expansions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123007
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Divacky [Fri, 7 Jan 2011 19:01:39 +0000 (19:01 +0000)]
Use -check-prefix to make it clear the test is SVR4/DARWINPPC specific.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123005
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Divacky [Fri, 7 Jan 2011 19:00:05 +0000 (19:00 +0000)]
Drop the _darwin/_svr4 suffixes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123004
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 7 Jan 2011 18:59:25 +0000 (18:59 +0000)]
Update AST reader/writer to handle new AppleKext.
Fix an unexpected hickup caused by exceeding size of
generated table (and a misleading comment). Improve
on help message for -fapple-kext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123003
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 7 Jan 2011 16:43:16 +0000 (16:43 +0000)]
Implement substitution of a function parameter pack for its set of
instantiated function parameters, enabling instantiation of arbitrary
pack expansions involving function parameter packs. At this point, we
can now correctly compile a simple, variadic print() example:
#include <iostream>
#include <string>
void print() {}
template<typename Head, typename ...Tail>
void print(const Head &head, const Tail &...tail) {
std::cout << head;
print(tail...);
}
int main() {
std::string hello = "Hello";
print(hello, ", world!", " ", 2011, '\n');
}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123000
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Fri, 7 Jan 2011 03:17:31 +0000 (03:17 +0000)]
Prefix all attribute enumerators with attr_ for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122992
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Fri, 7 Jan 2011 02:58:13 +0000 (02:58 +0000)]
Do not use cdecl, fastcall, stdcall etc.. as identifier name. They are reserved keywords at least on MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122991
91177308-0d34-0410-b5e6-
96231b3b80d8
John McCall [Fri, 7 Jan 2011 01:49:06 +0000 (01:49 +0000)]
Rework a few things about how we emit ObjC's for enumeration statement.
In particular, the iteration variable (if present) should be created and
destroyed in a narrow span around the loop body, and the body should
be emitted in a cleanup scope in case it's not a compound statement.
Otherwise, rename a few variables and use phis instead of temporary
variables for the index and buffer count.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122988
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 7 Jan 2011 01:05:02 +0000 (01:05 +0000)]
Add all options needed to support -fapple-kext. wip.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122987
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Fri, 7 Jan 2011 00:20:55 +0000 (00:20 +0000)]
Factor out the template transformation of a sequence of function
parameters into parameter types, so that substitution of
explicitly-specified function template arguments uses the same
path. This enables the use of explicitly-specified function template
arguments with variadic templates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122986
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Thu, 6 Jan 2011 22:30:05 +0000 (22:30 +0000)]
Add target triple.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122980
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Thu, 6 Jan 2011 22:09:01 +0000 (22:09 +0000)]
Implement template argument deduction from a call to a function
template whose last parameter is a parameter pack. This allows us to
form a call to, e.g.,
template<typename ...Args1, typename ...Args2>
void f(std::pair<Args1, Args2> ...pairs);
given zero or more instances of "pair".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122973
91177308-0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Thu, 6 Jan 2011 21:40:22 +0000 (21:40 +0000)]
test case for r122971.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122972
91177308-0d34-0410-b5e6-
96231b3b80d8