Граф коммитов

17446 Коммитов

Автор SHA1 Сообщение Дата
Rafael Espindola 57244f69e2 Set unnamed_addr in every type info.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123293 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 23:55:05 +00:00
Francois Pichet 2432320a99 Add a comment for r123231.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123291 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 23:38:13 +00:00
Douglas Gregor 203e6a322a 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
2011-01-11 23:09:57 +00:00
Rafael Espindola 82a0f4e93c Set unnamed_addr in VTTs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123280 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 22:29:55 +00:00
Douglas Gregor 77d6bb9e22 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
2011-01-11 22:21:24 +00:00
Rafael Espindola b1c65ff108 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
2011-01-11 21:44:37 +00:00
Rafael Espindola 9f959db60e Add unnamed_addr to vtables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123272 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 21:10:26 +00:00
Argyrios Kyrtzidis d7a31ba6db [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
2011-01-11 19:45:25 +00:00
Argyrios Kyrtzidis 6547884b9c [analyzer] Support post-visiting ObjCIvarRefExprs for checkers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123263 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 19:45:20 +00:00
Argyrios Kyrtzidis 5078d46af3 [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
2011-01-11 19:45:16 +00:00
Argyrios Kyrtzidis f7fbbda627 [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
2011-01-11 19:45:13 +00:00
Douglas Gregor 5c7bf42ef1 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
2011-01-11 17:34:58 +00:00
Bob Wilson 29dd67bc59 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
2011-01-11 16:53:49 +00:00
Ted Kremenek b6a2b08a6b Remove ProgramPoint parameter from GenericNodeBuilder::generateNode().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123240 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 16:53:44 +00:00
Abramo Bagnara 2b57aefea7 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
2011-01-11 15:16:52 +00:00
Francois Pichet a15a5eede9 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
2011-01-11 12:23:00 +00:00
Francois Pichet d062b60454 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
2011-01-11 11:57:53 +00:00
Francois Pichet ea0978568c 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
2011-01-11 10:41:37 +00:00
Ted Kremenek 27c54e57c4 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
2011-01-11 06:37:47 +00:00
Ted Kremenek 7771406ac3 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
2011-01-11 04:49:40 +00:00
Douglas Gregor 483dd2f55e 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
2011-01-11 03:23:19 +00:00
Douglas Gregor 21371ea7cf 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
2011-01-11 03:14:20 +00:00
Ted Kremenek 55825aa2d8 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
2011-01-11 02:34:50 +00:00
Ted Kremenek e36de1fe51 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
2011-01-11 02:34:45 +00:00
Douglas Gregor 7d5c0c1273 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
2011-01-11 01:52:23 +00:00
Michael J. Spencer 4d484a753f 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
2011-01-11 01:21:20 +00:00
Douglas Gregor 4f3018ecea 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
2011-01-11 00:45:18 +00:00
Douglas Gregor bc61bd8109 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
2011-01-11 00:33:19 +00:00
Devang Patel b1fd0eb8ab 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
2011-01-11 00:30:27 +00:00
Rafael Espindola c5f657fe30 Add unnamed_addr to constructors and destructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123197 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 00:26:26 +00:00
Bob Wilson 0024f940dd 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
2011-01-10 23:54:17 +00:00
Rafael Espindola 1257bc6ee7 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
2011-01-10 22:34:03 +00:00
Douglas Gregor 3cae5c9a79 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
2011-01-10 20:53:55 +00:00
Bob Wilson 8dbfbf4c95 Fix a comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123184 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 18:23:55 +00:00
Douglas Gregor 0216f8121d 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
2011-01-10 17:53:52 +00:00
Douglas Gregor 5429385919 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
2011-01-10 17:35:05 +00:00
Zhongxing Xu e8f4b045cd Fix CMakeLists.txt.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123167 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 09:33:41 +00:00
Zhongxing Xu 0742f181e5 Revert r123160. There are linking dependency problems.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123166 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 09:23:01 +00:00
Douglas Gregor d373119819 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
2011-01-10 07:32:04 +00:00
Douglas Gregor 2770eb1294 Unbreak the CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123162 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 07:26:53 +00:00
Zhongxing Xu 2f1a4a8261 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
2011-01-10 05:52:42 +00:00
Zhongxing Xu f9d3cbbe07 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
2011-01-10 03:54:19 +00:00
Zhongxing Xu b08624414a 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
2011-01-10 03:22:57 +00:00
Michael J. Spencer 32bef4edba 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
2011-01-10 02:34:13 +00:00
Francois Pichet b5bc7d0444 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
2011-01-09 22:32:25 +00:00
Benjamin Kramer 12bbc5c922 Make a helper function static.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123118 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-09 13:21:33 +00:00
Sean Hunt f51d0b6c2f 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
2011-01-08 23:01:16 +00:00
Sean Hunt cbb6748009 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
2011-01-08 20:30:50 +00:00
Sean Hunt 97fcc4977b 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
2011-01-08 19:20:43 +00:00
Chandler Carruth eeef924c4f 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
2011-01-08 06:54:40 +00:00