]> granicus.if.org Git - clang/log
clang
14 years agoSet unnamed_addr in VTTs.
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

14 years agoImplement partial ordering of class template partial specializations
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

14 years agoSet unnamed_addr for type infos that we are confortable marking as hidden. I
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

14 years agoAdd unnamed_addr to vtables.
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

14 years agoAdd back 122079 so we can ignore the argument some more.
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

14 years ago[analyzer] Introduce ObjCSelfInitChecker, which checks initialization methods to...
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

14 years ago[analyzer] Support post-visiting ObjCIvarRefExprs for checkers.
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

14 years ago[analyzer] Add 'bool ignorePrefix' parameter to cocoa::deriveNamingConvention to...
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

14 years ago[analyzer] Add 'isLoad' parameter in Checker::visitLocation() to conveniently disting...
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

14 years agoAdd another test for [temp.func.order]p5/[temp.deduct.partial]p11,
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

14 years agoImplement C++ [temp.func.order]p5 more directly, by passing down the
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

14 years agoRemove special handling for opaque Neon vector types.
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

14 years agoRemove ProgramPoint parameter from GenericNodeBuilder::generateNode().
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

14 years agoAdd example from C++0x [temp.deduct.type]p21, which already works
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

14 years agoAdded warning about invalid register specification for local variables.
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

14 years agoIn Microsoft mode, force 64 bit hex integer constants to signed type if the LL or...
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

14 years agoMicrosoft integer suffix changes:
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

14 years agoRename GenericNodeBuilder to GenericNodeBuilderRefCount to avoid namespace clash...
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

14 years agoRework ExprEngine::processCFGBlockEntrance()
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

14 years agoRemove several silly methods from ento::CoreEngine
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

14 years agoEnsure that the result type of an Objective-C class message send is
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

14 years agoWhen mapping from a function parameter pack to the set of function
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

14 years agoRename misc. methods in ento::Worklist to start
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

14 years agoRename misc. methods in GRSubEngine to start
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

14 years agoImplement the last bullet of [temp.deduct.type]p5 and part of the last
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

14 years agoReplace all uses of PathV1::isDirectory with PathV2::fs::is_directory.
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

14 years agoMake sure that we parse a '>>' that closes two template argument lists
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

14 years agoWhen we're inside a functional cast, '>' is an operator. Fixes PR8912.
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

14 years agoFix debug info for __block variable referenced outside of block.
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

14 years agoAdd testing for unexpanded parameter packs in all of the C++
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

14 years agoAdd unnamed_addr to constructors and destructors.
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

14 years agoMove DefaultABIInfo::classifyReturnType where it belongs. No functional change.
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

14 years agoOnly traverse template argument locations if we actually have explicit
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

14 years agoAdd unnamed_addr when creating artificial string globals. For example, in
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

14 years agoImplement more of C++0x [temp.arg.explicit]p9, allowing extension of
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

14 years agoFix a comment typo.
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

14 years agoNEON vector support for ARM is in pretty good shape now. Update the docs.
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

14 years agoRepent for my copy-and-paste sins, factoring out the code that forms
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

14 years agoFactor out the code to set up template argument deduction for a set of
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

14 years agoRemove dead code.
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

14 years agoFix CMakeLists.txt.
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

14 years agoRevert r123160. There are linking dependency problems.
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

14 years agoWork-in-progress implementation of C++0x [temp.arg.explicit]p9, which
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

14 years agoUnbreak the CMake build.
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

14 years agoExprEngine.cpp and AnalysisConsumer.cpp should not be in the Checkers directory.
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

14 years agoAdd some expression kinds to CheckerVisitor.def.
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

14 years agoIn C++, assignment and compound assignment operators return an lvalue.
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

14 years agoThe isPrefix() checking is redundant. Lvalue incremental/decremental expressions
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

14 years agoReplace all uses of PathV1::exists with PathV2::fs::exists.
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

14 years agoFix comment.
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

14 years agoDon't crash if SpecString is an empty string.
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

14 years agoMake a helper function static.
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

14 years agoRename CXXCtorInitializer::BaseOrMember to Initializee, since it will also be
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

14 years agoRenamed CXXBaseOrMemberInitializer to CXXCtorInitializer. This is both shorter,
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

14 years agoCheck for delegating constructors and (currently) return an error about them.
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

14 years agoRemove a kludge from analysis based warnings that used to detect
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

14 years agoAdd semantic checking that the "thousands grouping"
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

14 years agoAdd printf format string parsing support for '
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

14 years agoFix typo.
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

14 years agoVariadic templates example: a nearly-complete implementation of a TR1
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

14 years agoFix crash in CFGBuilder on invalid code. We still need
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

14 years agoVariadic templates example: a nearly-complete implementation of a TR1
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

14 years agoWhen instantiating the arguments to an initializer, use the
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

14 years agoFix a valgrind error when transforming function prototypes with
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

14 years agoUse -check-prefix to make it clear the test is SVR4/DARWINPPC specific.
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

14 years agoDrop the _darwin/_svr4 suffixes.
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

14 years agoUpdate AST reader/writer to handle new AppleKext.
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

14 years agoImplement substitution of a function parameter pack for its set of
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

14 years agoPrefix all attribute enumerators with attr_ for consistency.
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

14 years agoDo not use cdecl, fastcall, stdcall etc.. as identifier name. They are reserved keywo...
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

14 years agoRework a few things about how we emit ObjC's for enumeration statement.
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

14 years agoAdd all options needed to support -fapple-kext. wip.
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

14 years agoFactor out the template transformation of a sequence of function
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

14 years agoAdd target triple.
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

14 years agoImplement template argument deduction from a call to a function
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

14 years agotest case for r122971.
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

14 years agoPut warning about makeing a string writable into
Fariborz Jahanian [Thu, 6 Jan 2011 18:45:19 +0000 (18:45 +0000)]
Put warning about makeing a string writable into
its own deprecated diagnostics group so it can be
turned off selectively. // rdar://8827606

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

14 years agoAdd cortex-m3 CPU to getCPUDefineSuffix mapping.
Bob Wilson [Thu, 6 Jan 2011 16:57:20 +0000 (16:57 +0000)]
Add cortex-m3 CPU to getCPUDefineSuffix mapping.
Patch by Sylvère Teissier.

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

14 years agoAdded testcase for commit r122963.
Abramo Bagnara [Thu, 6 Jan 2011 16:56:00 +0000 (16:56 +0000)]
Added testcase for commit r122963.

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

14 years agoPowerPC fixes.
Roman Divacky [Thu, 6 Jan 2011 08:27:10 +0000 (08:27 +0000)]
PowerPC fixes.

Fix the width and align of bool type on Darwin to be 32bits
while keeping it 8 everywhere else.

Change the definition of va_list to default to SV4 ABI one
and let darwin subtarget override this.

Both changes submitted by Nathan Whitehorn and reviewed
by Rafael Espindola.

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

14 years agoTweak the wording of this warning further based on a suggestion from Chris.
Chandler Carruth [Thu, 6 Jan 2011 06:29:28 +0000 (06:29 +0000)]
Tweak the wording of this warning further based on a suggestion from Chris.

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

14 years agofix rdar://8823139, a crash on a comment in a preprocessed .s file
Chris Lattner [Thu, 6 Jan 2011 05:01:51 +0000 (05:01 +0000)]
fix rdar://8823139, a crash on a comment in a preprocessed .s file
that contains the ## operator.

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

14 years agoIntroduce an AttributedType, but don't actually use it anywhere yet.
John McCall [Thu, 6 Jan 2011 01:58:22 +0000 (01:58 +0000)]
Introduce an AttributedType, but don't actually use it anywhere yet.
The initial TreeTransform is a cop-out, but it's more-or-less equivalent
to what we were doing before, or rather what we're doing now and might
eventually stop doing in favor of using this type.
I am simultaneously intrigued by the possibilities of rebuilding a
dependent Attri

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

14 years agoClang should not warn on code in clang that is only there to remove warnings.
Jakob Stoklund Olesen [Thu, 6 Jan 2011 01:37:28 +0000 (01:37 +0000)]
Clang should not warn on code in clang that is only there to remove warnings.

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

14 years agoWhen default-initializing a TemplateArgumentLocInfo, make sure that we
Douglas Gregor [Thu, 6 Jan 2011 00:33:28 +0000 (00:33 +0000)]
When default-initializing a TemplateArgumentLocInfo, make sure that we
initialize *all* of the bits to zero. Also, when the pattern of a
template argument pack expansion, make sure to set the ellipsis
location along all paths.

This should clear up the valgrind failure that popped up in Clang.

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

14 years agoFast-path an arity check when performing template argument deduction that compares...
Douglas Gregor [Wed, 5 Jan 2011 23:23:17 +0000 (23:23 +0000)]
Fast-path an arity check when performing template argument deduction that compares two parameter-type-lists. No functionality change.

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

14 years agoEliminate an unnecessary dance where we tried to cope with the lack of
Douglas Gregor [Wed, 5 Jan 2011 23:16:57 +0000 (23:16 +0000)]
Eliminate an unnecessary dance where we tried to cope with the lack of
TypeSourceInfo when transforming a function parameter. The callees of
this routine already assume that TypeSourceInfo will be present, and
we want to always be sure that it exists.

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

14 years agoInitial implementation of function parameter packs. This implementation allows:
Douglas Gregor [Wed, 5 Jan 2011 23:12:31 +0000 (23:12 +0000)]
Initial implementation of function parameter packs. This implementation allows:

  1) Declaration of function parameter packs
  2) Instantiation of function parameter packs within function types.
  3) Template argument deduction of function parameter packs when
  matching two function types.

We're missing all of the important template-instantiation logic for
function template definitions, along with template argument deduction
from the argument list of a function call, so don't even think of
trying to use these for real yet.

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

14 years agoFix an embarrassing think in the disambiguation logic for the ellipsis in a parameter...
Douglas Gregor [Wed, 5 Jan 2011 23:06:07 +0000 (23:06 +0000)]
Fix an embarrassing think in the disambiguation logic for the ellipsis in a parameter-type-list

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

14 years agoDon't warn on missing 'copy' attribute on a 'block'
Fariborz Jahanian [Wed, 5 Jan 2011 23:00:04 +0000 (23:00 +0000)]
Don't warn on missing 'copy' attribute on a 'block'
property when it is 'readonly'. // rdar://8820813

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

14 years agohasInit() -> hasDefaultArg()
Douglas Gregor [Wed, 5 Jan 2011 21:14:17 +0000 (21:14 +0000)]
hasInit() -> hasDefaultArg()

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

14 years agoAdd Decl::isParameterPack(), which covers both function and template
Douglas Gregor [Wed, 5 Jan 2011 21:11:38 +0000 (21:11 +0000)]
Add Decl::isParameterPack(), which covers both function and template
parameter packs, along with ParmVarDecl::isParameterPack(), which
looks for function parameter packs. Use these routines to fix some
obvious FIXMEs.

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

14 years agoPropagate the "deduced from array bound" bit when comparing deduced
Douglas Gregor [Wed, 5 Jan 2011 21:00:53 +0000 (21:00 +0000)]
Propagate the "deduced from array bound" bit when comparing deduced
template argument packs. Plus, remove a FIXME that I fixed yesterday.

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

14 years agoWhen we're converting deduced template arguments to the type of the
Douglas Gregor [Wed, 5 Jan 2011 20:52:18 +0000 (20:52 +0000)]
When we're converting deduced template arguments to the type of the
corresponding template parameter, make sure that prior converted
template arguments are available for substitution.

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

14 years agoUse the proper enum as parameter, instead of unsigned. No functionality change.
Argyrios Kyrtzidis [Wed, 5 Jan 2011 20:09:36 +0000 (20:09 +0000)]
Use the proper enum as parameter, instead of unsigned. No functionality change.

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

14 years agoEliminate two "unsupported" errors relating to variadic templates: one
Douglas Gregor [Wed, 5 Jan 2011 19:06:29 +0000 (19:06 +0000)]
Eliminate two "unsupported" errors relating to variadic templates: one
for template template argument pack expansions (which was no longer
used) and another that was a placeholder for an llvm_unreachable.

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

14 years agoReplace the representation of template template argument pack
Douglas Gregor [Wed, 5 Jan 2011 18:58:31 +0000 (18:58 +0000)]
Replace the representation of template template argument pack
expansions with something that is easier to use correctly: a new
template argment kind, rather than a bit on an existing kind. Update
all of the switch statements that deal with template arguments, fixing
a few latent bugs in the process. I"m happy with this representation,
now.

And, oh look! Template instantiation and deduction work for template
template argument pack expansions.

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

14 years agofix a -Wself-assign warning
Chris Lattner [Wed, 5 Jan 2011 18:41:53 +0000 (18:41 +0000)]
fix a -Wself-assign warning

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

14 years agoAdd semantic analysis for the creation of and an AST representation
Douglas Gregor [Wed, 5 Jan 2011 17:40:24 +0000 (17:40 +0000)]
Add semantic analysis for the creation of and an AST representation
for template template argument pack expansions. This allows fun such
as:

  template<template<class> class ...> struct apply_impl { /*...*/ };
  template<template<class> class ...Metafunctions> struct apply {
    typedef typename apply_impl<Metafunctions...>::type type;
  };

However, neither template argument deduction nor template
instantiation is implemented for template template argument packs, so
this functionality isn't useful yet.

I'll probably replace the encoding of template template
argument pack expansions in TemplateArgument so that it's harder to
accidentally forget about the expansion. However, this is a step in
the right general direction.

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

14 years agoParse template template argument pack expansions. They're still not
Douglas Gregor [Wed, 5 Jan 2011 17:33:50 +0000 (17:33 +0000)]
Parse template template argument pack expansions. They're still not
implemented, however.

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