Fariborz Jahanian
9b43c3f0c5
modern objc translation: Add translation of @autoreleasepool
...
statement. // rdar://11474836.
llvm-svn: 157359
2012-05-23 23:47:20 +00:00
NAKAMURA Takumi
9b2d17c613
Tooling: Canonicalize Key in IndexByFile[]. llvm::sys::path::native() may be used here.
...
It fixes test/Tooling on Win32 hosts.
llvm-svn: 157350
2012-05-23 22:24:20 +00:00
Argyrios Kyrtzidis
0b21d82437
[arcmt] Remove an unused -autorelease, without failing with error, for this
...
idiom that is used commonly in setters:
[backingValue autorelease];
backingValue = [newValue retain]; // in general a +1 assign
rdar://9914061
llvm-svn: 157347
2012-05-23 21:50:04 +00:00
Chad Rosier
37a12af0af
[driver] Have the crash diagnostics print the clang version information.
...
rdar://11518308
llvm-svn: 157346
2012-05-23 21:38:47 +00:00
Manuel Klimek
3f00134c05
Adds the Refactoring library, which is a layer on top of the Tooling library
...
that allows easy refactoring across translation units.
llvm-svn: 157331
2012-05-23 16:29:20 +00:00
Richard Smith
47ad017191
Correct the starting location for instantiations of field declarations which
...
start with a cv-qualifier. DeclaratorDecl::getTypeSpecStartLoc() does not
produce the location of the first type-specifier (the cv-qualifier) in this
case, because we don't track source locations for cv-qualifiers.
No test here: I've not found a way to test this with a lit-style test, and
introducing a gtest test for this seems unwarranted. Suggestions welcome!
Patch by Daniel Jasper!
llvm-svn: 157311
2012-05-23 04:22:22 +00:00
Richard Smith
01ade177e9
If the first argument of __builtin_object_size can be folded to a constant
...
pointer, but such folding encounters side-effects, ignore the side-effects
rather than performing them at runtime: CodeGen generates wrong code for
__builtin_object_size in that case.
llvm-svn: 157310
2012-05-23 04:13:20 +00:00
Eric Christopher
a91af14b8d
Emit C++11 enum class information if it exists.
...
Part of rdar://11496790
llvm-svn: 157304
2012-05-23 00:09:47 +00:00
John McCall
8d32c05ed4
Recognize the MS inheritance attributes and turn them into attributes
...
on the RecordDecl. Persist the MS portability type attributes and
ignore them in Sema rather than the parser.
Patch by João Matos!
llvm-svn: 157288
2012-05-22 21:28:12 +00:00
Nuno Lopes
a425589fea
wire -fbounds-checking to the new LLVM bounds checking pass
...
llvm-svn: 157262
2012-05-22 17:19:45 +00:00
Manuel Klimek
78d084d942
Adds a method overwriteChangedFiles to the Rewriter. This is implemented by
...
first writing the changed files to a temporary location and then overwriting
the original files atomically.
Also adds a RewriterTestContext to aid unit testing rewrting logic in general.
llvm-svn: 157260
2012-05-22 17:01:35 +00:00
Nuno Lopes
2b1ff46ed1
revert the usage of the objectsize intrinsic with 3 parameters (to match LLVM r157255)
...
llvm-svn: 157256
2012-05-22 15:26:48 +00:00
Argyrios Kyrtzidis
94442980c0
[objcmt] Don't add redundant parentheses when migrating subscripting of an ivar.
...
rdar://11501256
llvm-svn: 157227
2012-05-22 00:47:53 +00:00
Fariborz Jahanian
945b2f46b1
objective-c: provide a useful 'fixit' suggestion when
...
errornously using commas to separate ObjC message arguments.
// rdar://11376372
llvm-svn: 157216
2012-05-21 22:43:44 +00:00
Eric Christopher
246bb99397
Revert r115805. An array type is required to have a range type,
...
however, the range can be unknown for the upper bound.
Testcase to follow.
Part of rdar://11457152
llvm-svn: 157212
2012-05-21 22:13:23 +00:00
Anna Zaks
fc1d4bdc4f
[analyzer] Bind UnknownVal to InitListExpr for unsupported types
...
(ex: float).
llvm-svn: 157211
2012-05-21 22:07:00 +00:00
Rafael Espindola
96dcb8d4bb
Function template version of the previous patch.
...
llvm-svn: 157207
2012-05-21 20:31:27 +00:00
Rafael Espindola
93c289c28a
Produce a hidden symbol for zed in
...
struct HIDDEN foo {
};
template <class P>
struct bar {
};
template <>
struct HIDDEN bar<foo> {
DEFAULT static void zed();
};
void bar<foo>::zed() {
}
Before we would produce a hidden symbol in
struct HIDDEN foo {
};
template <class P>
struct bar {
};
template <>
struct bar<foo> {
DEFAULT static void zed();
};
void bar<foo>::zed() {
}
But adding HIDDEN to the specialization would cause us to produce a default
symbol.
llvm-svn: 157206
2012-05-21 20:15:56 +00:00
Argyrios Kyrtzidis
3169e80603
[driver] When creating the compiler invocation out of command-line
...
arguments, force use of clang frontend for the driver.
Fixes rdar://11356765.
llvm-svn: 157205
2012-05-21 20:11:54 +00:00
Benjamin Kramer
9bbf481f02
Analyzer: Fix PR12905, a crash when encountering a call to a function named "C".
...
While there clean up indentation.
llvm-svn: 157204
2012-05-21 19:40:38 +00:00
Argyrios Kyrtzidis
937bcb2de6
[arcmt] Revert r156999 "Remove the "it is not safe to remove an unused 'autorelease' message" ARC
...
migration error".
Per feedback from John this is useful to have in general.
llvm-svn: 157198
2012-05-21 17:48:31 +00:00
Fariborz Jahanian
19e09cb224
Remove unused argument in my last patch.
...
llvm-svn: 157194
2012-05-21 17:10:28 +00:00
Fariborz Jahanian
b52d8d2e5f
objective-c: When default synthesizing readonly IBOutlet properties
...
provide a 'fixit' to change 'readonly' to 'readwrite'. // rdar://11448209
llvm-svn: 157193
2012-05-21 17:02:43 +00:00
Peter Collingbourne
c947aaeeae
Teach Clang about the NVPTX backend.
...
llvm-svn: 157173
2012-05-20 23:28:41 +00:00
Peter Collingbourne
041ac6c2b1
Tell the driver that CUDA is a C++-like language, so that we get C++
...
header searches with CUDA.
llvm-svn: 157172
2012-05-20 23:28:36 +00:00
Peter Collingbourne
f44bdf9c5f
CUDA: add CodeGen support for global variable address spaces.
...
Because in CUDA types do not have associated address spaces,
globals are declared in their "native" address space, and accessed
by bitcasting the pointer to address space 0. This relies on address
space 0 being a unified address space.
llvm-svn: 157167
2012-05-20 21:08:35 +00:00
Benjamin Kramer
c25c0b9da5
Bitpack CodeCompletionResults.
...
llvm-svn: 157158
2012-05-20 14:19:46 +00:00
Nico Weber
1b7f39de3d
Error when using typeid() with -fno-rtti. PR 12888.
...
llvm-svn: 157139
2012-05-20 01:27:21 +00:00
Eli Friedman
022900079b
Zap a bogus assert for delegating constructors. PR12890, part 2.
...
I'm pretty sure we are in fact doing the right thing here, but someone who knows the standard better should double-check that we are in fact supposed to zero out the member in the given testcase.
llvm-svn: 157138
2012-05-20 00:46:05 +00:00
Eli Friedman
a9e9ebcfb5
Make delegating initializers use a similar codepath to base initializers in dependent contexts. PR12890.
...
llvm-svn: 157136
2012-05-19 23:35:23 +00:00
Fariborz Jahanian
199a9b57a6
objective-c: Warn if default synthesizing readonly IBOutlet properties
...
and provide a 'fixit' to change 'readonly' to 'readwrite'. 'fixit'
part needs little more work. // rdar://11448209
llvm-svn: 157121
2012-05-19 18:17:17 +00:00
Dmitri Gribenko
898cff0bbd
Use RecordDecl::field_iterator because D1, D2 are RecordDecls. No functional change.
...
llvm-svn: 157119
2012-05-19 17:17:26 +00:00
Benjamin Kramer
365082dbfa
Apparently empty names are allowed here.
...
llvm-svn: 157117
2012-05-19 16:34:46 +00:00
Benjamin Kramer
1458c1c009
Simplify some users of DeclarationName::getNameKind. Fold getFETokenInfoAsVoid into its only caller.
...
llvm-svn: 157116
2012-05-19 16:03:58 +00:00
Benjamin Kramer
9012a09b1c
Inline a trivial clear() method.
...
llvm-svn: 157114
2012-05-19 14:28:31 +00:00
Eric Christopher
fe0913b026
Update API usage for llvm DIBuilder changes for rvalue reference
...
types and ensure we are actually creating the type.
rdar://11479676
llvm-svn: 157095
2012-05-19 01:36:50 +00:00
Anna Zaks
94a7b849a2
[analyzer] For locations, use isGLValue() instead of isLValue().
...
llvm-svn: 157088
2012-05-19 00:22:07 +00:00
Kaelyn Uhrain
864d0b002c
Suggest adding 'typename' when it would make the compiler
...
accept the template argument expression as a type.
llvm-svn: 157085
2012-05-18 23:42:49 +00:00
Anna Zaks
457ace7611
[analyzer] Fix a c++11 crash: xvalues can be locations (VisitMemberExpr)
...
llvm-svn: 157082
2012-05-18 22:47:43 +00:00
Anna Zaks
b343660914
[analyzer] Malloc checker: remove unnecessary comparisons.
...
llvm-svn: 157081
2012-05-18 22:47:40 +00:00
Benjamin Kramer
e5fbc6c85d
Lexer::ReadToEndOfLine: Only build the string if it's actually used and do so in a less malloc-intensive way.
...
llvm-svn: 157064
2012-05-18 19:32:16 +00:00
Rafael Espindola
3619104239
Centralize the handling of the "attribute declaration must precede definition"
...
warning. This also makes us warn on tags, which, ironically, is the only case
gcc warns on.
llvm-svn: 157039
2012-05-18 01:47:00 +00:00
Anna Zaks
46d01605ee
[analyzer]Malloc: refactor and report use after free by memory
...
allocating functions.
llvm-svn: 157037
2012-05-18 01:16:10 +00:00
Douglas Gregor
0bf70f4be8
A selector match between two Objective-C methods does *not* guarantee
...
that the methods have the same number of parameters, although we
certainly assumed this in many places. Objective-C can be insane
sometimes. Fixes <rdar://problem/11460990>.
llvm-svn: 157025
2012-05-17 23:13:29 +00:00
Douglas Gregor
c5928afb69
In the override search for Objective-C methods, protect against ASTs that have NULL interfaces behind a category, which can happen in invalid code. Fixes <rdar://problem/11478173>, a recent regression
...
llvm-svn: 157021
2012-05-17 22:39:14 +00:00
Argyrios Kyrtzidis
3d6439517c
[arcmt] Remove the "it is not safe to remove an unused 'autorelease' message" ARC
...
migration error.
This is more trouble that it is worth; autoreleasing a value without holding on it
is a valid use-case, we should not "punish" correct code for the minority of
broken/fragile programs that depend on the behavior of -autorelease.
rdar://9914061
llvm-svn: 156999
2012-05-17 18:16:05 +00:00
Abramo Bagnara
e1decdf68a
Added two missing const qualifiers.
...
llvm-svn: 156988
2012-05-17 12:44:05 +00:00
Benjamin Kramer
1d373c6517
CXXThisScopeRAII objects aren't free, don't compute one if it's unused.
...
llvm-svn: 156987
2012-05-17 12:01:52 +00:00
Matt Beaumont-Gay
32d825a4db
Use the argument location instead of the format string location when warning
...
about argument type mismatch.
This gives a nicer diagnostic in cases like
printf(fmt,
i);
where previously the snippet just pointed at 'fmt' (with a note at the
definition of fmt).
It's a wash for cases like
printf("%f",
i);
where previously we snippeted the offending portion of the format string,
but didn't indicate which argument was at fault.
llvm-svn: 156968
2012-05-17 00:03:16 +00:00
Argyrios Kyrtzidis
fbb2bb5a3d
[libclang/AST] When declaring a local class, don't neglect to set the end location
...
of the DeclStmt node, otherwise libclang will not work for anything inside that
class.
rdar://10837710
llvm-svn: 156966
2012-05-16 23:49:15 +00:00