Commit Graph

36824 Commits

Author SHA1 Message Date
Fariborz Jahanian fbe392eed6 modern objective-c rewriter: remove 'const' from
pointer field declarations in several meta-data.
// rdar://11079898

llvm-svn: 153192
2012-03-21 16:17:22 +00:00
John McCall b6c4a7ef21 For the annals of subtle but terrible bugs: fix a longstanding bug
in vtable layout where virtual methods inherited from virtual bases
could be assigned the same vcall adjustment slot if they shared
a name and parameter signature but differed in their
cv-qualification.  The code was already trying to handle this
case, but unfortunately used the ordinary type qualifiers
(which are always empty here) instead of the method qualifiers.
This seems like something that the API should discourage, but
I don't know how to carry that principle out in this instance.

Eliminate this function's need for an ASTContext while we're at it.

This bug affects the ABI, and fixing it brings us into accord with
the Itanium ABI (and GCC's implementation of it), but, obviously,
technically breaks full compatibility with previous releases of Clang.
Just letting you know.

llvm-svn: 153168
2012-03-21 06:57:19 +00:00
NAKAMURA Takumi a4917fade7 clang-interpreter/Makefile: [PR12313] Update USEDLIBS to add clangEdit.
llvm-svn: 153167
2012-03-21 06:25:42 +00:00
NAKAMURA Takumi 3eb0edde78 RewriteModernObjC.cpp: Don't expose temporary std::string with StringRef. (StringRef)getName() can be used here.
llvm-svn: 153156
2012-03-21 03:21:46 +00:00
John McCall f21bfcf805 Test case for rdar://problem/11055105, a bug with the instantiation
of references to function template parameters in noexcept clauses when
the instantiation is forced from a point during parsing when a block
is in scope.

llvm-svn: 153152
2012-03-21 00:45:33 +00:00
Fariborz Jahanian 69a76e98fe Close the paren.
// rdar://11076938

llvm-svn: 153151
2012-03-21 00:01:15 +00:00
Eric Christopher 6dde3e1450 Update comment.
llvm-svn: 153149
2012-03-20 23:28:32 +00:00
Patrick Beard aae4a392e5 numberWithFloat -> numberWithDouble.
llvm-svn: 153146
2012-03-20 22:24:08 +00:00
Fariborz Jahanian 952c3b9512 modern objective-c translator: insert couple of pragmas for optimization.
// rdar://11079898

llvm-svn: 153145
2012-03-20 22:24:05 +00:00
Patrick Beard 0661d0fc42 Fixed typo.
llvm-svn: 153142
2012-03-20 21:52:11 +00:00
Patrick Beard f964c7be8d Added summary section for Object Literals and Subscripting, which contains the external link.
llvm-svn: 153141
2012-03-20 21:51:03 +00:00
Fariborz Jahanian cd79a49f37 modern objective-c translator: add static function to initialize
the class pointer in the category structure.
// rdar://11076938

llvm-svn: 153138
2012-03-20 21:41:28 +00:00
Sebastian Redl d9170b09e6 More careful consideration of C++11 13.3.3.1p4. Fixes PR12257.
llvm-svn: 153130
2012-03-20 21:24:14 +00:00
Sebastian Redl 6db0b1bfed Fix the other place where C++98 work for initializer lists was necessary.
llvm-svn: 153129
2012-03-20 21:24:03 +00:00
Fariborz Jahanian 3546559863 more modern objective-c meta-data stuff.
llvm-svn: 153127
2012-03-20 21:09:58 +00:00
Patrick Beard bbb7ffc63f Fixed typos.
llvm-svn: 153126
2012-03-20 21:09:25 +00:00
Patrick Beard fbb2e46299 Link to Objective-C literals documentation.
llvm-svn: 153124
2012-03-20 20:51:09 +00:00
Patrick Beard 958c98ab4b Objective-C literals documentation.
llvm-svn: 153123
2012-03-20 20:50:45 +00:00
Ted Kremenek 4a64230ee7 Don't include FixIts with a null replacement range. Fixes <rdar://problem/11040133>.
llvm-svn: 153122
2012-03-20 20:49:45 +00:00
Benjamin Kramer e6b4a16ddd Fix a use-after-free in thunk emission. EmitThunk may call RAUW on Init, invalidating the pointer.
Fixes PR12284. The test case only triggered under asan/valgrind, but it's better than nothing.

llvm-svn: 153120
2012-03-20 20:18:13 +00:00
Fariborz Jahanian 40ca00dc4c modern objective-c translator: provide meta-data initialization
via functions for certain pointer initialization
fields. // rdar://11076938

llvm-svn: 153117
2012-03-20 19:54:33 +00:00
Benjamin Kramer 8cc491a601 Debug info: Tighten up uses of plain MDNode pointers which don't survive replaceOperandWith.
TrackingVH notices when it gets RAUW'd. Fixes PR12305 and PR12315.

llvm-svn: 153115
2012-03-20 19:49:14 +00:00
Fariborz Jahanian 6e60c1376f modern objective-c translator: couple of minor
changes to how meta-data is declared. 
// rdar://11076938

llvm-svn: 153098
2012-03-20 17:34:50 +00:00
Patrick Beard 85bdcfc97b Test commit.
llvm-svn: 153096
2012-03-20 17:25:17 +00:00
Fariborz Jahanian a854174a23 objective-c modern translator: Refactor intername ivar names to
one place and use it throughout. Also, change ivar name to avoid
name collisions. // rdar://11079366

llvm-svn: 153093
2012-03-20 17:13:39 +00:00
Chad Rosier f8df4f4e3b [avx] Define the _mm256_loadu2_xxx and _mm256_storeu2_xxx intrinsics.
From the Intel Optimization Reference Manual, Section 11.6.2.  When data cannot
be aligned or alignment is not known, 16-byte memory accesses may provide better
performance.
rdar://11076953

llvm-svn: 153091
2012-03-20 16:40:00 +00:00
David Chisnall d663934b62 Add missing bitcast that was breaking Objective-C++ exception typeinfo (GNUstep runtime).
llvm-svn: 153090
2012-03-20 16:25:52 +00:00
Ted Kremenek 230e015b90 Add test case for <rdar://problem/10553686>, which illustrates RetainCount checker working with inlined C++ template functions.
llvm-svn: 153069
2012-03-20 00:10:35 +00:00
Ted Kremenek e7d78882b4 Fix crash when querying the CFG reported when using the thread safety analysis
on code using multi-dimensional arrays.  Fix by DeLesley Hutchins, and reported in
PR 12271.

llvm-svn: 153067
2012-03-19 23:48:41 +00:00
Argyrios Kyrtzidis 77f5619b8c [libclang] Have clang_getCursorExtent() return the range of the main file when
the passed cursor is the translation unit cursor.

Patch by Clint Caywood!

llvm-svn: 153062
2012-03-19 23:17:58 +00:00
Fariborz Jahanian 62a5e65d54 removed unused code in the modern objc rewriter file.
llvm-svn: 153052
2012-03-19 20:38:08 +00:00
Benjamin Kramer 26dbe37993 LanguageExtensions: Manually word wrap a line to reduce horizontal scrolling.
llvm-svn: 153048
2012-03-19 19:12:30 +00:00
Matt Beaumont-Gay ee570a2510 line endings
llvm-svn: 153046
2012-03-19 18:47:12 +00:00
Matt Beaumont-Gay 7fd63a29f7 Use a simpler pluralization construct
llvm-svn: 153044
2012-03-19 18:36:28 +00:00
Fariborz Jahanian 3466059001 modern objective-c translator: fix type of objc_exception_throw
declaration and its siblings.

llvm-svn: 153043
2012-03-19 18:11:32 +00:00
NAKAMURA Takumi 7fc219f713 test/Driver/cpath.c: Mark this as XFAIL:mingw32,win32 for now.
On Win32 hosts, ';' is used for path separator.

llvm-svn: 153037
2012-03-19 16:07:58 +00:00
Nico Weber 8935578528 Fix a regression where ':' in CPLUS_INCLUDE_PATH and friends would no longer separate paths.
This regressed in r152583. Also add a test to make sure it doesn't regress again.

llvm-svn: 153034
2012-03-19 15:00:03 +00:00
Sebastian Redl 1678d5f7b2 Add the missing compatibility warning for braced initializers as default arguments.
llvm-svn: 153026
2012-03-18 22:25:45 +00:00
Benjamin Kramer 7377e31d21 An error can't be in a warning group.
llvm-svn: 153012
2012-03-18 13:01:31 +00:00
Jordy Rose bf38f20e79 [analyzer] Mark a failed-realloc's result as an interesting symbol between the realloc call and the null check, so we get nicer path notes. Fixes a regression introduced by the diagnostic pruning added in r152361.
This is accomplished by calling markInteresting /during/ path diagnostic generation, and as such relies on deterministic ordering of BugReporterVisitors -- namely, that BugReporterVisitors are run in /reverse/ order from how they are added. (Right now that's a consequence of storing visitors in an ImmutableList, where new items are added to the front.) It's a little hacky, but it works for now.

I think this is the best we can do without storing the relation between the old and new symbols, and that would be a hit whether or not there ends up being an error.

llvm-svn: 153010
2012-03-18 07:43:35 +00:00
Aaron Ballman 0467f55d62 Turns #import in MS Mode into an error.
llvm-svn: 153009
2012-03-18 03:10:37 +00:00
David Blaikie a90e86aa36 Use character literals for vexing initialization fixit hints.
Instead of suggesting " = 0" for "char c();", suggest " = '\0'", and similarly
for other char types (wide, 16, and 32). Add tests for all these, and since
this means testing such hints under C++0x, add tests for some untested C++0x
hint cases in the existing code, including suggesting nullptr for pointer
initialization.

This sets up the initialization helper to provide better type fidelity that
will be especially helpful for non-assignment cases (such as fixit-correcting
NULL usage in function calls (eg: foo(char) + foo(NULL) => foo('\0') instead
of the less informative foo(0)))

llvm-svn: 153008
2012-03-18 02:56:47 +00:00
Jordy Rose 61c974b492 [analyzer] Use a FoldingSet to cache simple RetainSummary instances, rather than explicitly keeping DoNothing and StopTracking summaries and nothing else.
I tried to test the effects of this change on memory usage and run time, but what I saw on retain-release.m was indistinguishable from noise (debug and release builds). Even so, some caveman profiling showed 101 cache hits that we would have generated new summaries for before (i.e. not default or stop summaries), and the more code we analyze, the more memory we should save.

Maybe we should have a standard project for benchmarking the retain count checker's memory and time?

llvm-svn: 153007
2012-03-18 01:26:10 +00:00
Douglas Gregor d17dfe1638 Replace a FIXME with a diagnostic when we can't resolve the
nested-name-specifier for a class template declaration. Fixes PR12291.

llvm-svn: 153006
2012-03-18 00:15:42 +00:00
Douglas Gregor 31feb337a6 Diagnose tag and class template declarations with qualified
declarator-ids that occur at class scope. Fixes PR8019.

llvm-svn: 153002
2012-03-17 23:06:31 +00:00
Jordy Rose 35e71c771d [analyzer] Unify retain-count summary generation for class and instance methods. No functionality change.
llvm-svn: 153001
2012-03-17 21:13:07 +00:00
Jordy Rose 9046bcd03b Kill cocoa::deriveNamingConvention and cocoa::followsFundamentalRule. They are now just simple wrappers around method families, and method decls can cache method family lookups. Also, no one is using them right now.
The one difference between ObjCMethodDecl::getMethodFamily and Selector::getMethodFamily is that the former will do some additional sanity checking, and since CoreFoundation types don't look like Objective-C objects, an otherwise interesting method will get a method family of OMF_None. Future clients that use method families should consider how they want to handle CF types.

llvm-svn: 153000
2012-03-17 20:51:32 +00:00
Jordy Rose 7063883e8c [analyzer] Remove duplicate work on deriving method behavior. No functionality change.
The cocoa::deriveNamingConventions helper is just using method families anyway now, and the way RetainSummaryTemplate works means we're allocating an extra summary for every method with a relevant family.

Also, fix RetainSummaryTemplate to do the right thing w/r/t annotating an /existing/ summary. This was probably the real cause of <rdar://problem/10824732> and the fix in r152448.

llvm-svn: 152998
2012-03-17 19:53:04 +00:00
Fariborz Jahanian e8810768a9 modern objective-c rewriter: further improvement in
writing @synchronized statement; do not call locking
expression more than once and support early exits in
@synchronized's statement block (such as return).

llvm-svn: 152993
2012-03-17 17:46:02 +00:00
NAKAMURA Takumi 3ec7c4574f StaticAnalyzer: Fix abuse of StringRef in r152962.
llvm-svn: 152982
2012-03-17 13:06:05 +00:00