Commit Graph

27639 Commits

Author SHA1 Message Date
Michael J. Spencer e503f89b4b Replace all uses of PathV1::isDirectory with PathV2::fs::is_directory.
llvm-svn: 123208
2011-01-11 01:21:20 +00:00
Douglas Gregor 180dda9b6e Make sure that we parse a '>>' that closes two template argument lists
appropritely when there are no other template arguments.

llvm-svn: 123204
2011-01-11 00:45:18 +00:00
Douglas Gregor 94a32477fd When we're inside a functional cast, '>' is an operator. Fixes PR8912.
llvm-svn: 123201
2011-01-11 00:33:19 +00:00
Devang Patel bc47498973 Fix debug info for __block variable referenced outside of block.
llvm-svn: 123199
2011-01-11 00:30:27 +00:00
Douglas Gregor 8008ba75a5 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.

llvm-svn: 123198
2011-01-11 00:27:36 +00:00
Rafael Espindola 0ee986c1f1 Add unnamed_addr to constructors and destructors.
llvm-svn: 123197
2011-01-11 00:26:26 +00:00
Bob Wilson bd4520b535 Move DefaultABIInfo::classifyReturnType where it belongs. No functional change.
llvm-svn: 123195
2011-01-10 23:54:17 +00:00
Matt Beaumont-Gay 2083ba400f Only traverse template argument locations if we actually have explicit
template arguments.

llvm-svn: 123194
2011-01-10 23:53:06 +00:00
Rafael Espindola b7f60e3474 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.

llvm-svn: 123192
2011-01-10 22:34:03 +00:00
Douglas Gregor 48d2411597 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.

llvm-svn: 123188
2011-01-10 20:53:55 +00:00
Bob Wilson b39017ad19 Fix a comment typo.
llvm-svn: 123184
2011-01-10 18:23:55 +00:00
Bob Wilson ce3ee6539e NEON vector support for ARM is in pretty good shape now. Update the docs.
llvm-svn: 123183
2011-01-10 17:55:14 +00:00
Douglas Gregor b94a6177fc 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.

llvm-svn: 123182
2011-01-10 17:53:52 +00:00
Douglas Gregor a8bd0d94f8 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.

llvm-svn: 123180
2011-01-10 17:35:05 +00:00
Zhongxing Xu b84ec97699 Remove dead code.
llvm-svn: 123168
2011-01-10 11:28:29 +00:00
Zhongxing Xu fb060c9014 Fix CMakeLists.txt.
llvm-svn: 123167
2011-01-10 09:33:41 +00:00
Zhongxing Xu 40c9d8a4c5 Revert r123160. There are linking dependency problems.
llvm-svn: 123166
2011-01-10 09:23:01 +00:00
Douglas Gregor a8bac7f514 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. 

llvm-svn: 123163
2011-01-10 07:32:04 +00:00
Douglas Gregor eff85ad41b Unbreak the CMake build.
llvm-svn: 123162
2011-01-10 07:26:53 +00:00
Zhongxing Xu 7d4ab7d915 ExprEngine.cpp and AnalysisConsumer.cpp should not be in the Checkers directory.
llvm-svn: 123160
2011-01-10 05:52:42 +00:00
Zhongxing Xu 03f169ef71 Add some expression kinds to CheckerVisitor.def.
llvm-svn: 123159
2011-01-10 05:39:35 +00:00
Zhongxing Xu 5609e21337 In C++, assignment and compound assignment operators return an lvalue.
llvm-svn: 123158
2011-01-10 03:54:19 +00:00
Zhongxing Xu 0710f5c5e1 The isPrefix() checking is redundant. Lvalue incremental/decremental expressions
are all prefixes.

llvm-svn: 123156
2011-01-10 03:22:57 +00:00
Michael J. Spencer f6efe58d45 Replace all uses of PathV1::exists with PathV2::fs::exists.
llvm-svn: 123150
2011-01-10 02:34:13 +00:00
Zhongxing Xu 7042251985 Fix comment.
llvm-svn: 123147
2011-01-10 02:22:04 +00:00
Francois Pichet 96df71ad90 Don't crash if SpecString is an empty string.
llvm-svn: 123134
2011-01-09 22:32:25 +00:00
Benjamin Kramer 39f987ffd0 Make a helper function static.
llvm-svn: 123118
2011-01-09 13:21:33 +00:00
Alexis Hunt a50dd46ee8 Rename CXXCtorInitializer::BaseOrMember to Initializee, since it will also be
used to store the CXXConstructorDecl in a delegating constructor.

llvm-svn: 123095
2011-01-08 23:01:16 +00:00
Alexis Hunt 1d7926502f Renamed CXXBaseOrMemberInitializer to CXXCtorInitializer. This is both shorter,
more accurate, and makes it make sense for it to hold a delegating constructor
call.

llvm-svn: 123084
2011-01-08 20:30:50 +00:00
Alexis Hunt 4049b8d4cd Check for delegating constructors and (currently) return an error about them.
llvm-svn: 123076
2011-01-08 19:20:43 +00:00
Chandler Carruth b35635e942 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.

llvm-svn: 123056
2011-01-08 06:54:40 +00:00
Ted Kremenek bf4832cda8 Add semantic checking that the "thousands grouping"
prefix in a printf format string is matched
with the appropriate conversion specifier.

llvm-svn: 123055
2011-01-08 05:28:46 +00:00
Ted Kremenek a322cae011 Add printf format string parsing support for '
prefix to format conversions (POSIX extension).

llvm-svn: 123054
2011-01-08 05:28:38 +00:00
Eric Christopher 7d5f2ff6c9 Fix typo.
llvm-svn: 123041
2011-01-07 22:44:49 +00:00
Douglas Gregor b41e2d9298 Variadic templates example: a nearly-complete implementation of a TR1
function class template. 

llvm-svn: 123024
2011-01-07 19:56:20 +00:00
Ted Kremenek ef81e9e243 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.

llvm-svn: 123017
2011-01-07 19:37:16 +00:00
Douglas Gregor fe6e33a3c5 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.

llvm-svn: 123016
2011-01-07 19:37:08 +00:00
Douglas Gregor 2cd32a0251 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...

llvm-svn: 123014
2011-01-07 19:35:17 +00:00
Douglas Gregor 9f627df2f2 Fix a valgrind error when transforming function prototypes with
function parameter pack expansions.

llvm-svn: 123007
2011-01-07 19:27:47 +00:00
Roman Divacky 7e96295fb5 Use -check-prefix to make it clear the test is SVR4/DARWINPPC specific.
llvm-svn: 123005
2011-01-07 19:01:39 +00:00
Roman Divacky 1b805a0bc9 Drop the _darwin/_svr4 suffixes.
llvm-svn: 123004
2011-01-07 19:00:05 +00:00
Fariborz Jahanian 13f3b2f79b 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.

llvm-svn: 123003
2011-01-07 18:59:25 +00:00
Douglas Gregor f30101186f 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');
  }

llvm-svn: 123000
2011-01-07 16:43:16 +00:00
Francois Pichet 044f3d78f4 Prefix all attribute enumerators with attr_ for consistency.
llvm-svn: 122992
2011-01-07 03:17:31 +00:00
Francois Pichet a8fcc8d70b Do not use cdecl, fastcall, stdcall etc.. as identifier name. They are reserved keywords at least on MSVC.
llvm-svn: 122991
2011-01-07 02:58:13 +00:00
John McCall 1c926b78fe 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.

llvm-svn: 122988
2011-01-07 01:49:06 +00:00
Fariborz Jahanian a4cfff87b9 Add all options needed to support -fapple-kext. wip.
llvm-svn: 122987
2011-01-07 01:05:02 +00:00
Douglas Gregor dd47216cc4 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.

llvm-svn: 122986
2011-01-07 00:20:55 +00:00
Devang Patel c07c98f853 Add target triple.
llvm-svn: 122980
2011-01-06 22:30:05 +00:00
Douglas Gregor 7825bf3a12 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".

llvm-svn: 122973
2011-01-06 22:09:01 +00:00