Commit Graph

122495 Commits

Author SHA1 Message Date
Howard Hinnant 2a9a072485 Give the emulated nullptr_t a default constructor.
llvm-svn: 150893
2012-02-18 22:01:22 +00:00
Ted Kremenek e8a5ba89ec Teach analyzer about NSAutoreleasePool -allocWithZone:. Fixes <rdar://problem/10640253>.
llvm-svn: 150892
2012-02-18 21:37:48 +00:00
Ted Kremenek 3d64453f9d Add analyzer test for using of C++ references with ObjC object pointers, reported in <rdar://problem/10569024>.
llvm-svn: 150891
2012-02-18 21:27:25 +00:00
Talin f2291c908b Hashing.h - utilities for hashing various data types.
llvm-svn: 150890
2012-02-18 21:00:49 +00:00
Richard Smith 0b6b8e490c Fix wrong-code bug: __imag on a scalar lvalue should produce a zero rvalue,
rather than an lvalue referring to the scalar.

llvm-svn: 150889
2012-02-18 20:53:32 +00:00
Ted Kremenek e98d63a823 Adopt ExprEngine and checkers to ObjC property refactoring. Everything was working, but now diagnostics are aware of message expressions implied by uses of properties. Fixes <rdar://problem/9241180>.
llvm-svn: 150888
2012-02-18 20:53:30 +00:00
Howard Hinnant c7cf23e4bf Exercise rvalue arguements to make_shared for C++11 mode.
llvm-svn: 150887
2012-02-18 20:12:03 +00:00
Rafael Espindola 082d482981 White space fixes.
llvm-svn: 150886
2012-02-18 19:46:02 +00:00
Rafael Espindola 991356e89b Temporarily disable this assert. Looks like it found a similar issue when
building bullet.

llvm-svn: 150885
2012-02-18 17:51:43 +00:00
Rafael Espindola 82d957593e Don't skip debug instructions when looking for the insertion point of
the cast. If we do, we can end up with

   inst1
   ---------------  < Insertion point
   dbg inst
   new inst

instead of the desired

   inst1
   new inst
   ---------------  < Insertion point
   dbg inst

Another option would be for InsertNoopCastOfTo (or its callers) to move the
insertion point and we would end up with

   inst1
   dbg inst
   new inst
   ---------------  < Insertion point

but that complicates the callers. This fixes PR12018 (and firefox's build).

llvm-svn: 150884
2012-02-18 17:22:58 +00:00
David Chisnall c616e95162 Default to not using __cxa_atexit on Solaris.
llvm-svn: 150883
2012-02-18 17:00:56 +00:00
David Chisnall cb5e468106 Remove a debugging line accidentally left in the last commit.
llvm-svn: 150882
2012-02-18 16:20:35 +00:00
David Chisnall 0867d9cfbc Implement #pragma redefine_extname.
This fixes PR5172 and allows clang to compile C++ programs on Solaris using the system headers.

llvm-svn: 150881
2012-02-18 16:12:34 +00:00
Dmitri Gribenko e72fa2c113 Add -Wstrncat-size and -Wempty-body to release notes.
llvm-svn: 150879
2012-02-18 14:13:26 +00:00
Jia Liu b22310fda6 Emacs-tag and some comment fix for all ARM, CellSPU, Hexagon, MBlaze, MSP430, PPC, PTX, Sparc, X86, XCore.
llvm-svn: 150878
2012-02-18 12:03:15 +00:00
Benjamin Kramer 26538e8cc5 Remove unused but set variable.
llvm-svn: 150877
2012-02-18 11:35:28 +00:00
David Meyer 4d9547332c On Cygwin/MingW, add SharedLibDir and LLVMToolDir to the library search path, since shared libraries are placed in 'bin'. (static libraries are still in 'lib').
llvm-svn: 150876
2012-02-18 10:03:19 +00:00
Douglas Gregor fdf598eaf3 Rewrite variable capture within lambda expressions and blocks,
eliminating a bunch of redundant code and properly modeling how the
captures of outside blocks/lambdas affect the types seen by inner
captures.

This new scheme makes two passes over the capturing scope stack. The
first pass goes up the stack (from innermost to outermost), assessing
whether the capture looks feasible and stopping when it either hits
the scope where the variable is declared or when it finds an existing
capture. The second pass then walks down the stack (from outermost to
innermost), capturing the variable at each step and updating the
captured type and the type that an expression referring to that
captured variable would see. It also checks type-specific
restrictions, such as the inability to capture an array within a
block. Note that only the first odr-use of each
variable needs to do the full walk; subsequent uses will find the
capture immediately, so multiple walks need not occur.

The same routine that builds the captures can also compute the type of
the captures without signaling errors and without actually performing
the capture. This functionality is used to determine the type of
declaration references as well as implementing the weird decltype((x))
rule within lambda expressions.

The capture code now explicitly takes sides in the debate over C++
core issue 1249, which concerns the type of captures within nested
lambdas. We opt to use the more permissive, more useful definition
implemented by GCC rather than the one implemented by EDG.

llvm-svn: 150875
2012-02-18 09:37:24 +00:00
Craig Topper 57d3aaed78 Add X86InstrSVM.td that I forgot to add in r150873.
llvm-svn: 150874
2012-02-18 08:34:12 +00:00
Craig Topper ed7aa46366 Add X86 assembler and disassembler support for AMD SVM instructions. Original patch by Kay Tiong Khoo. Few tweaks by me for code density and to reduce replication.
llvm-svn: 150873
2012-02-18 08:19:49 +00:00
Douglas Gregor 812d8f6387 Unify our computation of the type of a captured reference to a
variable; it was previously duplicated, and one of the copies failed
to account for outer non-mutable lambda captures.

llvm-svn: 150872
2012-02-18 05:51:20 +00:00
Greg Clayton d9e416c0ea The second part in thread hardening the internals of LLDB where we make
the lldb_private::StackFrame objects hold onto a weak pointer to the thread
object. The lldb_private::StackFrame objects the the most volatile objects
we have as when we are doing single stepping, frames can often get lost or
thrown away, only to be re-created as another object that still refers to the
same frame. We have another bug tracking that. But we need to be able to 
have frames no longer be able to get the thread when they are not part of
a thread anymore, and this is the first step (this fix makes that possible
but doesn't implement it yet).

Also changed lldb_private::ExecutionContextScope to return shared pointers to
all objects in the execution context to further thread harden the internals.

llvm-svn: 150871
2012-02-18 05:35:26 +00:00
Richard Smith 0dea49e324 Fix a problem in the GCC testsuite, exposed by r150557. Compound literals
are represented as prvalues in C++; don't be fooled into thinking they're
global lvalues.

llvm-svn: 150870
2012-02-18 04:58:18 +00:00
Eli Friedman ff4b407009 Add a bunch of missing calls to DiagnoseSentinelCalls. <rdar://problem/10885993>.
This should probably be refactored... but it isn't completely obvious what refactoring is best.

llvm-svn: 150869
2012-02-18 04:48:30 +00:00
Ted Kremenek 084e1b48a1 Change wording of warning about using __bridge casts in non-ARC.
llvm-svn: 150868
2012-02-18 04:42:38 +00:00
Chandler Carruth b54950bef4 Trivial cleanup to group the generic 'armvN' cases with the 'arm' case,
etc. No functionality changed.

llvm-svn: 150867
2012-02-18 04:34:17 +00:00
Richard Smith eec915d686 Diagnose uses of deleted destructors and inaccessible defaulted destructors.
We had two separate issues here: firstly, varions functions were assuming that
they did not need to perform semantic checks on trivial destructors (this is
not true in C++11, where a trivial destructor can nonetheless be private or
deleted), and a bunch of DiagnoseUseOfDecl calls were missing for uses of
destructors.

llvm-svn: 150866
2012-02-18 04:13:32 +00:00
Eli Friedman 952d1f9f40 Fix a rather nasty regression from r150690: LHS != RHS does not imply LHS->stripPointerCasts() != RHS->stripPointerCasts().
llvm-svn: 150863
2012-02-18 03:29:25 +00:00
Richard Smith d951a1d9c8 Initial refactoring of 'ShouldDeleteSpecialMember', in preparation for providing
decent diagnostics. Finish the work of combining all the 'ShouldDelete'
functions into one. In unifying the code, fix a minor bug where an anonymous
union with a deleted default constructor as a member of a union wasn't being
considered as making the outer union's default constructor deleted.

llvm-svn: 150862
2012-02-18 02:02:13 +00:00
Sean Callanan 5056ab04ad Ignore the constness of the object pointer when
fetching it.

llvm-svn: 150861
2012-02-18 02:01:03 +00:00
Chad Rosier 991aa50e44 Fix documentation.
llvm-svn: 150860
2012-02-18 01:38:41 +00:00
Chad Rosier 1d9cdb6c42 Fix comment.
llvm-svn: 150859
2012-02-18 01:20:35 +00:00
Eric Christopher 1c3785aae9 Add in a caching mechanism so that forward declarations are replaced
with full types if they exist.

rdar://10809898 and rdar://10209967 and rdar://10400981

llvm-svn: 150858
2012-02-18 00:50:17 +00:00
Eric Christopher 1a0c882a22 Formatting.
llvm-svn: 150857
2012-02-18 00:50:14 +00:00
Eric Christopher 71006f2378 Remove UpdateCompletedType from the debug info emission. We now
emit less than complete types on purpose on occasion and so
our caches aren't useful for this kind of lazy emitting.

llvm-svn: 150856
2012-02-18 00:50:08 +00:00
Chad Rosier f0cccf5bdb Remove redundant check.
llvm-svn: 150855
2012-02-18 00:37:07 +00:00
Enrico Granata d3e45fc363 making it so that the std::map test case does a better job at checking for interference between expression parser and synthetic children; plus being more verbose in the comments
llvm-svn: 150854
2012-02-18 00:29:33 +00:00
Eric Christopher c767c51b5d Testcase for the previous commit.
llvm-svn: 150852
2012-02-18 00:05:45 +00:00
Lang Hames 59761985dd Bring HMEditor into line with LLVM coding standards.
llvm-svn: 150851
2012-02-17 23:43:40 +00:00
Ted Kremenek d519cae8aa Have conjured symbols depend on LocationContext, to add context sensitivity for functions called more than once.
llvm-svn: 150849
2012-02-17 23:13:45 +00:00
Eric Christopher 81e2bf2b77 Ignore the lifetime intrinsics in fast-isel.
llvm-svn: 150848
2012-02-17 23:03:39 +00:00
Anna Zaks 1fdedc99f2 [analyzer] Malloc Checker more tests.
llvm-svn: 150847
2012-02-17 22:35:34 +00:00
Anna Zaks e56167e8f8 [analyzer] Fix another false positive in the Malloc Checker, by making
it aware of CString APIs that return the input parameter.

Malloc Checker needs to know how the 'strcpy' function is
evaluated. Introduce the dependency on CStringChecker for that.
CStringChecker knows all about these APIs.

Addresses radar://10864450

llvm-svn: 150846
2012-02-17 22:35:31 +00:00
Anna Zaks 6348a810fe [analyzer] Generalize function name checking in CString checker.
(Ex: It was not treating __inline_strcpy as strcpy. Will add tests that
rely on this later on.)

llvm-svn: 150845
2012-02-17 22:35:26 +00:00
Fariborz Jahanian d268b0caba modern objc translator: postpone writing of class definitions
until the end when all their ivars are known then.

llvm-svn: 150844
2012-02-17 22:20:12 +00:00
Jim Ingham ec1da844f8 Remove unneeded includes.
llvm-svn: 150843
2012-02-17 21:59:03 +00:00
Jakob Stoklund Olesen a2755ea8f2 Don't print out pointer values in SUnit::dump().
llvm-svn: 150842
2012-02-17 21:44:51 +00:00
Matt Beaumont-Gay 714b99dc84 Sink variable into assert
llvm-svn: 150841
2012-02-17 21:40:48 +00:00
Lang Hames a9afc6ac4a Add support for regmask slots to HMEditor. Also fixes a comment error.
llvm-svn: 150840
2012-02-17 21:29:41 +00:00
Fariborz Jahanian 320c88afce modern objc writer: more work for category metadata rewrite
and some cleanup.

llvm-svn: 150839
2012-02-17 20:33:00 +00:00