Commit Graph

133450 Commits

Author SHA1 Message Date
Greg Clayton 93bfb29ada Make file + line breakpoints even more efficient by using our SearchFilter objects correctly now that we sometimes don't check for inlined breakpoints.
llvm-svn: 163435
2012-09-07 23:48:57 +00:00
Fariborz Jahanian 566fff0dac objective-C: introduce __attribute((objc_requires_super)) on method
in classes. Use it to flag those method implementations which don't
contain call to 'super' if they have 'super' class and it has the method
with this attribute set. This is wip. // rdar://6386358

llvm-svn: 163434
2012-09-07 23:46:23 +00:00
Jim Ingham 625fca7c5a Save and restore the current inlined depth over function calls.
llvm-svn: 163433
2012-09-07 23:36:43 +00:00
Jim Ingham 6cd41da75d Add SetCurrentInlinedDepth API.
In GetFramesUpTo, don't adjust the number of frames for the inlined depth if the number of frames in UINT32_MAX.

llvm-svn: 163432
2012-09-07 23:35:54 +00:00
John McCall cfa4e9bdf3 In ARC, if we're emitting assembly markers for calls to
objc_retainAutoreleasedReturnValue, we need to also be killing
them during return peepholing.  Make sure we recognize an
intervening bitcast, but more importantly, assert if we can't
find the asm marker at all.  rdar://problem/12133032

llvm-svn: 163431
2012-09-07 23:30:50 +00:00
Ted Kremenek a11a741e2f Further tweaks to hopefully make the PathDiagnostic emission more deterministic.
llvm-svn: 163430
2012-09-07 23:13:11 +00:00
Alexander Kornienko 767cd03bbe Fixed http://llvm.org/bugs/show_bug.cgi?id=13777
llvm-svn: 163429
2012-09-07 22:44:34 +00:00
Ted Kremenek 244e1d7d0f Remove ProgramState::getSymVal(). It was being misused by Checkers,
with at least one subtle bug in MacOSXKeyChainAPIChecker where the
calling the method was a substitute for assuming a symbolic value
was null (which is not the case).

We still keep ConstraintManager::getSymVal(), but we use that as
an optimization in SValBuilder and ProgramState::getSVal() to
constant-fold SVals.  This is only if the ConstraintManager can
provide us with that information, which is no longer a requirement.
As part of this, introduce a default implementation of
ConstraintManager::getSymVal() which returns null.

For Checkers, introduce ConstraintManager::isNull(), which queries
the state to see if the symbolic value is constrained to be a null
value.  It does this without assuming it has been implicitly constant
folded.

llvm-svn: 163428
2012-09-07 22:31:01 +00:00
Ted Kremenek 334ad6ac13 Attempt to make the PathDiagnostic emission order more deterministic by
looking at PathPieces.

llvm-svn: 163427
2012-09-07 22:24:24 +00:00
Ted Kremenek bfd22b4155 Add default implementation of ConstraintManager::getSymVal() and a doxygen comment.
llvm-svn: 163426
2012-09-07 22:24:21 +00:00
Ted Kremenek 58ec11612c Remove ConstraintManager:isEqual(). It is no longer used.
llvm-svn: 163425
2012-09-07 22:24:18 +00:00
Anshuman Dasgupta f16a443da3 Refactored DFA generator. Merged transition class into state class.
Patch by Ivan Llopard!

llvm-svn: 163424
2012-09-07 21:35:43 +00:00
Alex Rosenberg 58d8ce8d0b Add IRC handle entry to CREDITS.TXT as a test commit.
llvm-svn: 163423
2012-09-07 21:34:50 +00:00
Sandeep Patel 0ef151eab6 Correct an unfortunately necessary typo.
llvm-svn: 163422
2012-09-07 21:20:20 +00:00
Greg Clayton ba1fad8420 Added a quick example to show how disasembly output can be customized.
llvm-svn: 163421
2012-09-07 21:18:45 +00:00
Benjamin Kramer 68b9f0583f Fix alignment of .comm and .lcomm on mingw32.
For some reason .lcomm uses byte alignment and .comm log2 alignment so we can't
use the same setting for both. Fix this by reintroducing the LCOMM enum.
I verified this against mingw's gcc.

llvm-svn: 163420
2012-09-07 21:08:01 +00:00
Jack Carter 2c39b77f89 Initial relocations test for the Mips standalone assembler.
This is not an exhaustive set, but something we can build on.

Contributer: Vladimir Medic
llvm-svn: 163419
2012-09-07 20:38:18 +00:00
Ted Kremenek 9df430c46d Add plist output for retain-release.m in addition to -verify checking.
llvm-svn: 163418
2012-09-07 20:31:32 +00:00
Greg Clayton 0662d966dc Train LLDB to deal with bad linker N_SO entries that point to our source files for debug map + DWARF in .o file debugging.
llvm-svn: 163417
2012-09-07 20:29:13 +00:00
Chad Rosier 1f57bcb1a0 Fix indent.
llvm-svn: 163416
2012-09-07 20:23:29 +00:00
Daniel Dunbar 6eae4ce2b8 build/clang_darwin: Add the ASAN dynamic library.
llvm-svn: 163415
2012-09-07 19:57:35 +00:00
Daniel Dunbar 9d098bc09a [asan] Use a relative include path instead of requiring build system involvement.
llvm-svn: 163414
2012-09-07 19:57:32 +00:00
Daniel Dunbar 44b3474b0e build: Teach Makefile build system about asan/dynamic subdir.
llvm-svn: 163413
2012-09-07 19:57:28 +00:00
Daniel Dunbar c053c2bcda build: Add support for building dylibs.
llvm-svn: 163412
2012-09-07 19:57:23 +00:00
Daniel Dunbar 04ab17b0cd [asan] Suppress some bogus -Winvalid-noreturn diagnostics.
llvm-svn: 163411
2012-09-07 19:57:20 +00:00
Chad Rosier 37a8563f36 Ampersand goes with identifier.
llvm-svn: 163410
2012-09-07 19:49:55 +00:00
Jordan Rose 8dc77398a1 [analyzer] Use cast<> instead of getAs<> for a CFGElement known to be a CFGStmt.
When adding the next statement to the CoreEngine's work list, we take care
of all the special cases first. We certainly shouldn't be building
PostStmts with null statements (the diagnostics machinery assumes such
StmtPoints do not exist), and we should find out sooner if we're missing
a special case.

A refinement of r163402 that should help prevent further issues like PR13760.

llvm-svn: 163409
2012-09-07 19:48:09 +00:00
Abramo Bagnara 9c93a4a3e0 Moved back getCharAndSizeNoWarn to public area.
llvm-svn: 163408
2012-09-07 19:43:13 +00:00
Anna Zaks 694be01519 [analyzer] Fix a false positive in sizeof malloc checker.
Don't warn when the sizeof argument is an array with the same element
type as the pointee of the return type.

llvm-svn: 163407
2012-09-07 19:20:13 +00:00
Ted Kremenek a8d0ca070f Add test case for <rdar://problem/12075238>, which recently got fixed by changes to RegionStore.
llvm-svn: 163406
2012-09-07 19:09:51 +00:00
Benjamin Kramer ad100ec90e Contrary to what the documentation says, .lcomm alignment on COFF is in bytes, not power of 2.
llvm-svn: 163405
2012-09-07 18:56:10 +00:00
Chad Rosier ea3157f1e4 Whitespace.
llvm-svn: 163404
2012-09-07 18:46:57 +00:00
Chad Rosier 78af00f675 Bring buildbots back. Fix scoping issue and coding style from r163397.
llvm-svn: 163403
2012-09-07 18:44:15 +00:00
Jordan Rose 3c2713accf [analyzer] Don't use the address of a temporary CFGElement.
GCC destroys temporary objects more aggressively than clang, so this
results in incorrect behavior when compiling GCC Release builds.

We could avoid this issue under C++11 by preventing getAs from being
called when 'this' is an rvalue:

  template<class ElemTy> const ElemTy *getAs() const & { ... }
  template<class ElemTy> const ElemTy *getAs() const && = delete;

Unfortunately, we do not have compatibility macros for this behavior yet.

This will hopefully fix PR13760 and PR13762.

llvm-svn: 163402
2012-09-07 18:36:17 +00:00
Chad Rosier b759ede963 Update function names to conform to guidelines. No functional change intended.
llvm-svn: 163401
2012-09-07 18:16:38 +00:00
Dmitry Vyukov 7ea4c2ccfb tsan: ignore destruction of global mutexes (causes a lot of non-interesting reports)
llvm-svn: 163400
2012-09-07 18:08:02 +00:00
Greg Clayton e2186ed6d9 Patch from Andrew Kaylor for linux:
The attached patch fixes a problem with performing an attach from the SBTarget API on Linux (and other systems that use ProcessPOSIX).
 
When Process::Attach was called from SBTarget, it resulted in a call to a form of the DoAttachWithID function that wasn't implemented in ProcessPOSIX, and so it fell back to the default implementation (which just returns an error).  It didn't seem necessary to use the attach_info parameter for this case, so I just implemented it as a call to the simpler version of the function.
 
In debugging this problem, I also found that SBTarget wasn't checking the return value from the Attach call, causing it to hang when the attach fails.

llvm-svn: 163399
2012-09-07 17:51:47 +00:00
Greg Clayton 542e407581 Patch from Andrew Kaylor for linux:
The attached patch adds support for debugging 32-bit processes when running a 64-bit lldb on an x86_64 Linux system.
 
Making this work required two basic changes:
 
1)      Getting lldb to report that it could debug 32-bit processes
2)      Changing an assumption about how ptrace works when debugging cross-platform
 
For the first change, I took a conservative approach and only enabled this for x86_64 Linux platforms.  It may be that the change I made in Host.cpp could be extended to other 64-bit Linux platforms, but I'm not familiar enough with the other platforms to know for sure.
 
For the second change, the Linux ProcessMonitor class was assuming that ptrace(PTRACE_[PEEK|POKE]DATA...) would read/write a "word" based on the child process word size.  However, the ptrace documentation says that the "word" size read or written is "determined by the OS variant."  I verified experimentally that when ptracing a 32-bit child from a 64-bit parent a 64-bit word is read or written.

llvm-svn: 163398
2012-09-07 17:49:29 +00:00
DeLesley Hutchins a5a00e830a Thread-safety analysis: Add support for selectively turning off warnings
within part of a particular method.

llvm-svn: 163397
2012-09-07 17:34:53 +00:00
Jakob Stoklund Olesen e45e22b20f Custom DAGCombine for and/or/xor are for all ARMs.
The 'select' transformations apply to all ARM architectures and don't
require hasV6T2Ops.

llvm-svn: 163396
2012-09-07 17:34:15 +00:00
Benjamin Kramer 47f9ec92cb MC: Overhaul handling of .lcomm
- Darwin lied about not supporting .lcomm and turned it into zerofill in the
  asm parser. Push the zerofill-conversion down into macho-specific code.
- This makes the tri-state LCOMMType enum superfluous, there are no targets
  without .lcomm.
- Do proper error reporting when trying to use .lcomm with alignment on a target
  that doesn't support it.
- .comm and .lcomm alignment was parsed in bytes on COFF, should be power of 2.
- Fixes PR13755 (.lcomm crashes on ELF).

llvm-svn: 163395
2012-09-07 17:25:13 +00:00
Anna Zaks 67e0062b7c [analyzer] Explain why we need condition 8.
llvm-svn: 163394
2012-09-07 16:22:09 +00:00
Alexander Potapenko 38c3f9ef2f Remove the infinite recursion check for now, as we don't have __thread on Mac, and TSD is an overkill.
llvm-svn: 163393
2012-09-07 15:50:19 +00:00
Alexander Potapenko c5adb8a700 Two minor changes:
-- exit from infinite recursion in CHECK()
 -- print a verbose message if mapping of the shadow memory has failed.

llvm-svn: 163391
2012-09-07 15:34:40 +00:00
Benjamin Kramer e3d658bb6c PR13754: llvm-mc/x86 crashes on .cfi directives without the % prefix for registers.
gas accepts this and it seems to be common enough to be worth supporting. This
doesn't affect the parsing of reg operands outside of .cfi directives.

llvm-svn: 163390
2012-09-07 14:51:35 +00:00
Roman Divacky c337b8244d Attempt to pacify Windows buildbots.
llvm-svn: 163389
2012-09-07 13:52:05 +00:00
Roman Divacky a3c5024277 Link to crtend.S when PIE in the FreeBSD driver. Patch by Brooks Davis!
llvm-svn: 163388
2012-09-07 13:36:21 +00:00
Manuel Klimek cc0637c2b6 Adds a first iteration of the basic AST matcher documentation landing page.
llvm-svn: 163387
2012-09-07 13:13:53 +00:00
Manuel Klimek 8bad94765a Introduces anchors into LibASTMatchersReference.html.
This allows linking to LibASTMatchersRefernce.html#<matcher><N>Anchor to
link to the N'the declaration of a matcher and automatically expand
its documentation.

llvm-svn: 163386
2012-09-07 13:10:32 +00:00
Daniel Jasper f49d1e0070 Change the behavior of the isDerivedFrom-matcher to not match on the
class itself. This caused some confusion (intuitively, a class is not
derived from itself) and makes it hard to write certain matchers, e.g.
"match and bind any pair of base and subclass".

The original behavior can be achieved with a new isA-matcher.  Similar
to all other matchers, this matcher has the same behavior and name as
the corresponding AST-entity - in this case the isa<>() function.

llvm-svn: 163385
2012-09-07 12:48:17 +00:00