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

36316 Коммитов

Автор SHA1 Сообщение Дата
Rafael Espindola a77e072634 Add another missing testcase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155304 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-22 02:41:22 +00:00
Richard Smith 6e21b16ab2 PR12585: When processing a friend template inside a class template, don't
pretend there was no previous declaration -- that can lead us to injecting
a class template (with no access specifier) into a class scope. Instead,
just avoid the problematic checks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155303 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-22 02:13:50 +00:00
Rafael Espindola bc356d0aa9 Add a testcase we were already getting right, but were not testing for.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155302 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-22 01:22:25 +00:00
Rafael Espindola 60115a0453 Fix handling of template parameters. Found by inspection. GCC 4.7 agrees
with this testcase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155301 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-22 00:43:48 +00:00
Rafael Espindola 1266b613e4 All the members of LVFlags always have the same value, replace the class with
a boolean.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155299 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-21 23:28:21 +00:00
Richard Smith a4156b8574 Fix regression in r154844. If necessary, defer computing adjusted destructor
exception specifications in C++11 until after we've parsed the exception
specifications for nested classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155293 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-21 18:42:51 +00:00
Fariborz Jahanian 94d55d7ecd Remove unneeded code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155290 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-21 17:51:44 +00:00
Richard Smith 7bb698aa05 Fix serialization of uninstantiated exception specifications. Patch by Li Kan,
test by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155289 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-21 17:47:47 +00:00
Nuno Lopes 79e244f49a move some stuff to .rodata
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155282 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-21 14:45:25 +00:00
NAKAMURA Takumi c86d1fdb7b SemaDeclCXX.cpp: Fix utf8 in comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155279 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-21 09:40:04 +00:00
NAKAMURA Takumi 126d3d0905 clang/test/Rewriter/rewrite-modern-extern-c-func-decl.mm: Mark as XFAIL:mingw for now, due to predefined __declspec.
It could be tweaked to add -triple i686-win32, though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155278 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-21 09:39:58 +00:00
Matt Beaumont-Gay 73664a4e5a Also highlight the member name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155274 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-21 02:13:04 +00:00
Richard Smith 227e9f6f08 Fix test failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155271 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-21 01:51:32 +00:00
Richard Smith 71c598fc05 When declaring a template, check that the context doesn't already contain a
declaration of the same name. r155187 caused us to miss this if the prior
declaration did not declare a type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155269 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-21 01:27:54 +00:00
Matt Beaumont-Gay 7d90fe5a94 Fix a QoI bug reported by a user.
Set the source location for the "member reference base type ... is not a
structure or union" diag to point at the operator rather than the member name.
If we're giving this diagnostic because of a typo'd '.' in place of a ';' at
the end of a line, the caret previously pointed at the identifier on the
following line, which isn't as helpful as it could be. Pointing the caret at
the '.' makes it more obvious what the problem is.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155267 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-21 01:12:48 +00:00
Bob Wilson 0b1c715684 Link with Foundation whenever -fobjc-link-runtime is used. <rdar://10976177>
The check for excluding libarclite on i386 MacOSX should not apply to
Foundation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155263 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-21 00:21:42 +00:00
Argyrios Kyrtzidis f676608f60 [libclang] Don't set dylib load address to 0xe000000.
Per Greg Clayton:
libclang.dylib is trying to be smart and load itself at a valid address
to be able to load faster which would work for 32 bit systems,
bit won't make any difference on 64 bit systems.
It should either pick a better 64 bit address, or just let itself be loaded at zero.

rdar://11159142

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155246 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 22:07:11 +00:00
Fariborz Jahanian 0e78afbb15 objective-c arc: With currnt documentation,
objc_returns_inner_pointer attribute can be applied to
methods only. Diagnsose otherwise, instead of
crashing. // rdar://11253688


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155245 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 22:00:46 +00:00
Anna Zaks 0b3ade86a1 [analyzer] Run remove dead bindings right before leaving a function.
This is needed to ensure that we always report issues in the correct
function. For example, leaks are identified when we call remove dead
bindings. In order to make sure we report a callee's leak in the callee,
we have to run the operation in the callee's context.

This change required quite a bit of infrastructure work since:
 - We used to only run remove dead bindings before a given statement;
here we need to run it after the last statement in the function. For
this, we added additional Program Point and special mode in the
SymbolReaper to remove all symbols in context lower than the current
one.
 - The call exit operation turned into a sequence of nodes, which are
now guarded by CallExitBegin and CallExitEnd nodes for clarity and
convenience.

(Sorry for the long diff.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155244 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 21:59:08 +00:00
Anna Zaks 39b7341131 [analyzer] Remove unused method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155243 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 21:59:00 +00:00
Anna Zaks 5a878b2cab [analyzer] Constify
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155242 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 21:58:56 +00:00
Richard Smith 05b3385f78 Update doxygen comment to match changes in r155218.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155232 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 20:34:25 +00:00
Chad Rosier 61ada0a7a8 In r135308, -save-temps was modified to prevent a temporary file from
overwriting the input file.  For example,

clang -c foo.s -o foo.o -save-temps

Unfortunately, the original patch didn't compare the paths of the input and
output files.  Thus, something like the following would fail to create foo.s.

cd /tmp/obj
clang -c ../src/foo.s -o foo.o -save-temps

rdar://11252615


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155224 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 20:05:08 +00:00
Richard Smith 704c8f76bb Fix bug where a class's (deleted) copy constructor would be implicitly given a
non-const reference parameter type if the class had any subobjects with deleted
copy constructors. This causes a rejects-valid if the class's copy constructor
is explicitly defaulted (as happens for some implementations of std::pair etc).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155218 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 18:46:14 +00:00
Benjamin Kramer 3a0b7b6ac7 c++11 status: Replace references to "SVN" with "3.1" to avoid confusion when they diverge.
Color is still yellow, as 3.1 isn't released yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155217 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 18:43:50 +00:00
Chad Rosier d2fb883009 When generating the clang crash diagnostic script, strip out the -o flag.
Add a FIXME comment.
rdar://11283560


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155207 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 17:21:42 +00:00
Chad Rosier 80ec127fc9 Add a little hack to emulate a clang crash, so the diagnostics generator can be
tested.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155205 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 17:08:59 +00:00
Fariborz Jahanian 89592d5046 minor improvement to couple of tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155204 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 17:07:07 +00:00
Manuel Klimek dab28942c4 No need to put the SourceManager in with the ASTContext, as the ASTContext
already contains the SourceManager.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155198 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 14:07:01 +00:00
Evgeniy Stepanov 700c508fd4 Pass -mfloat-abi= to linuxtools assembler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155191 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 09:03:40 +00:00
Timur Iskhodzhanov 8560791791 Fix bug 12574 - Avoid infinite recursion in constructors and destructors when using Microsoft C++ ABI
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155189 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 08:05:00 +00:00
Richard Smith c93e014cd4 Replace r155185 with a better fix, which also addresses PR12557. When looking
up an elaborated type specifier in a friend declaration, only look for type
declarations, per [basic.lookup.elab]p2. If we know that the redeclaration
lookup for a friend class template in a dependent context finds a non-template,
don't delay the diagnostic to instantiation time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155187 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 07:12:26 +00:00
Richard Smith b2f245e77d Fix a bug which creduce found reducing PR12585.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155185 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 05:42:36 +00:00
Chad Rosier cc66b08945 When generating the clang crash diagnostic script, strip out the -D, -F, and -I
flags.  We have preprocessed source, so we don't need these.

No test case as it's fairly difficult to make the compiler crash on demand.  I'll
patiently wait for Ben to tell me how to do this in 2 lines of code.  :)
rdar://11283560


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155180 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-20 00:30:04 +00:00
Fariborz Jahanian 9879556f25 objective-arc: Retune my previous patch so warning
is issued on weak property as receiver and not on
any other use of a weak property. // rdar://10225276


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155169 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 23:49:39 +00:00
Kaelyn Uhrain 1e77b65b48 Re-add the closing '}' for the namespace I accidentally deleted when
removing a (new) duplicate test whose only difference was the tag type
being an enum instead of a struct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155165 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 23:26:12 +00:00
Kaelyn Uhrain 434ed260eb In Parser::isCXXDeclarationSpecifier, consider a non-type identifier
followed by an identifier as declaration specificer (except for ObjC).
This allows e.g. an out-of-line C++ member function definitions to be
recognized as functions and not as variable declarations if the type
name for the first parameter is not recognized as a type--say, when there
is a function name shadowing an enum type name and the parameter is
missing the "enum" keyword needed to distinguish the two.

Note that returning TPResult::Error() instead of TPResult::True()
appears to have the same end result, while TPResult::Ambiguous()
results in a crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155163 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 23:17:45 +00:00
Richard Smith 0c5d0a8052 In an attempt to reduce confusion, mark 'Strong compare exchange' as done, since
we generate correct code for both strong and weak atomic compare-exchanges, even
though we don't propagate to the IR enough information to generate optimal weak
compare-exchanges on architectures which support them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155161 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 22:09:22 +00:00
Fariborz Jahanian 289677da2d objective-c arc: Issue warning under -Wreceiver-is-weak
if receiver is a 'weak' property, by type or by attribute.
// rdar://10225276


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155159 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 21:44:57 +00:00
Patrick Beard 16c111ba80 Added equivalent method calls in examples.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155155 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 20:48:09 +00:00
Richard Smith c495e60747 Formatting fix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155141 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 17:46:52 +00:00
David Blaikie 789acdd196 Add SmallVectorImpl Visual Studio visualizer. Patch by Nikola Smiljanic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155140 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 17:26:49 +00:00
David Blaikie a9639620e0 Fix a broken link. Patch by Nikola Smiljanic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155139 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 17:21:46 +00:00
DeLesley Hutchins 54c350a67b Refactor the thread safety analysis so that it is easier to do
path-sensitive analysis like handling of trylock expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155137 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 16:48:43 +00:00
Fariborz Jahanian b5863da6ef objective-c modern translator: Further improving the last
patch fixing writing a spurious 'static' into
the wrong place. // rdar://11275241


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155130 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 16:30:28 +00:00
DeLesley Hutchins ae519c42a1 Thread safety analysis: split warnings into two groups: attribute warnings
which are checked in the parser, and analysis warnings that require the
full analysis.  This allows attribute syntax to be checked independently
of the full thread safety analysis.  Also introduces a new warning for the
case where a string is used as a lock expression; this allows the analysis
to gracefully handle expressions that would otherwise cause a parse error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155129 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 16:10:44 +00:00
Patrick Beard dd9fe59a9a Clarified encoding of boxed C strings, balanced all <p> with </p>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155126 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 14:33:55 +00:00
Manuel Klimek fad7f85553 Adds a unit test for the RecursiveASTVisitor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155108 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 08:48:53 +00:00
Francois Pichet b4143472c7 Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155107 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 07:48:57 +00:00
Richard Smith 03544fccd1 Add missing -Wc++98-compat warnings for initializer list initializations which
initialize references, create std::initializer_list objects, or call constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155105 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-19 06:58:00 +00:00