Commit Graph

146602 Commits

Author SHA1 Message Date
Akira Hatanaka be8612f6f4 [mips] Fix definitions of multiply, multiply-add/sub and divide instructions.
The new instructions have explicit register output operands and use table-gen
patterns instead of C++ code to do instruction selection.

Mips16's instructions are unaffected by this change.

llvm-svn: 178403
2013-03-30 01:36:35 +00:00
Jordan Rose b8cb8359ce [analyzer] Restructure ExprEngine::VisitCXXNewExpr to do a bit less work.
No functionality change.

llvm-svn: 178402
2013-03-30 01:31:48 +00:00
Jordan Rose 8f6b4b043a [analyzer] Handle caching out while evaluating a C++ new expression.
Evaluating a C++ new expression now includes generating an intermediate
ExplodedNode, and this node could very well represent a previously-
reachable state in the ExplodedGraph. If so, we can short-circuit the
rest of the evaluation.

Caught by the assertion a few lines later.

<rdar://problem/13510065>

llvm-svn: 178401
2013-03-30 01:31:42 +00:00
Jordan Rose 6fdef11c17 [analyzer] Add debug helper LocationContext::dumpStack().
Sample output:
  #0 void construct(pointer __p, llvm::ImutAVLTree<llvm::ImutContainerInfo<clang::ento::BugType *> > *const &__val)
  #1 void push_back(const value_type &__x)
  #2 void destroy()
  #3 void release()
  #4 void ~ImmutableSet()

llvm-svn: 178400
2013-03-30 01:31:35 +00:00
Sean Callanan 42f26b488b Disable warnings from Clang correctly, by directly
manipulating the diagnostics engine.

<rdar://problem/13508470>

llvm-svn: 178399
2013-03-30 01:26:06 +00:00
Anton Yartsev 5bfcb2f0ef [analyzer] Garbage removed
llvm-svn: 178398
2013-03-30 01:24:21 +00:00
Anton Yartsev ae3630b011 [analyzer] Test added
llvm-svn: 178397
2013-03-30 01:22:45 +00:00
Akira Hatanaka f0ea500c14 [mips] Remove function getFPBranchCodeFromCond. Rename invertFPCondCodeAdd.
llvm-svn: 178396
2013-03-30 01:16:38 +00:00
Akira Hatanaka d5a0e096bc Fix indentation.
llvm-svn: 178395
2013-03-30 01:15:17 +00:00
Akira Hatanaka 28721bd7dd [mips] Add mips-specific nodes which will be used to select multiply and divide
instructions.

llvm-svn: 178394
2013-03-30 01:14:04 +00:00
Akira Hatanaka 3a34d14745 [mips] Implement getRepRegClassFor in MipsSETargetLowering. This function is
called in several places in ScheduleDAGRRList.cpp.

llvm-svn: 178393
2013-03-30 01:12:05 +00:00
Akira Hatanaka cd77e15cfb [mips] Fix MipsSEInstrInfo::copyPhysReg, loadRegFromStack and storeRegToStack
to handle accumulator registers.

llvm-svn: 178392
2013-03-30 01:08:05 +00:00
Akira Hatanaka 3b70145184 [mips] Expand pseudo load, store and copy instructions right before
callee-saved scan.

The code makes use of register's scavenger's capability to spill multiple
registers.

llvm-svn: 178391
2013-03-30 01:04:11 +00:00
Akira Hatanaka c8d85025a0 [mips] Define pseudo instructions for spilling and copying accumulator
registers.

llvm-svn: 178390
2013-03-30 00:54:52 +00:00
Enrico Granata 3a193f4b11 Fixing Python commands test cases to work even after removing Printf
(and using the new syntax for printing :-)

llvm-svn: 178389
2013-03-30 00:53:13 +00:00
Anton Yartsev 3dfc33e3ac [analyzer] Enabled unix.Malloc checker.
+ Refactoring.

llvm-svn: 178388
2013-03-30 00:50:37 +00:00
Anton Yartsev fa637577f9 [analyzer] Tests for intersections with other checkers from MallocChecker.cpp factored out to NewDelete-intersections.mm
llvm-svn: 178387
2013-03-30 00:43:02 +00:00
Eric Christopher 4887c8f4ff Use SmallVectorImpl instead of SmallVector at the uses.
llvm-svn: 178386
2013-03-29 23:34:06 +00:00
Bob Wilson f36f15fc06 Run the ObjCARCContract pass for LTO. <rdar://problem/13538084>
llvm-svn: 178385
2013-03-29 23:28:55 +00:00
Greg Clayton a7d8c21b8f <rdar://problem/13131838>
Platform select documents a -S option but doesn't accept it, now it does.

llvm-svn: 178384
2013-03-29 23:18:38 +00:00
Adrian Prantl 6aebbb325b generalize testcase
llvm-svn: 178383
2013-03-29 23:15:55 +00:00
Michael Gottesman 9412830090 Updated test0 of retain-not-declared.ll to reflect the fact that objc-arc-expand runs before objc-arc/objc-arc-contract.
Specifically, objc-arc-expand will make sure that the
objc_retainAutoreleasedReturnValue, objc_autoreleaseReturnValue, and ret
will all have %call as an argument.

llvm-svn: 178382
2013-03-29 22:44:59 +00:00
Anna Zaks 8e492c2380 [analyzer] Address Jordan’s review of r178309 - do not register an extra visitor for nil receiver
We can check if the receiver is nil in the node that corresponds to the StmtPoint of the message send.
At that point, the receiver is guaranteed to be live. We will find at least one unreclaimed node due to
my previous commit (look for StmtPoint instead of PostStmt) and the fact that the nil receiver nodes are tagged.

+ a couple of extra tests.

llvm-svn: 178381
2013-03-29 22:32:38 +00:00
Anna Zaks 8d0dcd8add [analyzer] Look for a StmtPoint node instead of PostStmt in trackNullOrUndefValue.
trackNullOrUndefValue tries to find the first node that matches the statement it is tracking.
Since we collect PostStmt nodes (in node reclamation), none of those might be on the
current path, so relax the search to look for any StmtPoint.

llvm-svn: 178380
2013-03-29 22:32:34 +00:00
Argyrios Kyrtzidis 1a0ffd523a [libclang] Add test case for r178374.
llvm-svn: 178378
2013-03-29 22:16:32 +00:00
Jean-Luc Duprat 89fe247094 SmallVector and SmallPtrSet allocations now power-of-two aligned.
This time tested on both OSX and Linux.

llvm-svn: 178377
2013-03-29 22:07:12 +00:00
Sean Silva c9fbd23621 [docs] The STL "binary search" has a non-obvious name.
std::lower_bound is the canonical "binary search" in the STL
(std::binary_search generally is not what you want). The name actually
makes a lot of sense (and also has a beautiful symmetry with the
std::upper_bound algorithm). The name is nonetheless non-obvious.

Also, remove mention of "radix search". It's not even clear how that
would work in the context of a sorted vector. AFAIK "radix search" only
makes sense when you have a trie-like data structure.

llvm-svn: 178376
2013-03-29 21:57:47 +00:00
Timur Iskhodzhanov 64a5cf5617 Exclude the X86/complex-fca.ll test at it probably wasn't supposed to work on Windows
llvm-svn: 178375
2013-03-29 21:54:00 +00:00
Argyrios Kyrtzidis bd8cd3ed85 When looking for overridden ObjC methods, don't ignore 'hidden' ones.
When using modules we should not ignore overridden methods from
categories that are hidden because the module is not visible.
This will give more consistent results (when imports change) and it's more
correct since the methods are indeed overridden even if they are not "visible"
for lookup purposes.

rdar://13350796

llvm-svn: 178374
2013-03-29 21:51:48 +00:00
Argyrios Kyrtzidis 828f4d4b9f [libclang] If libclang logging is enabled, print all compiler diagnostics to stderr instead of capturing them.
llvm-svn: 178373
2013-03-29 21:51:44 +00:00
Argyrios Kyrtzidis 41686481f4 [cmake] Add clang-headers as a dependency of libclang and if we have to copy them
for the IDE case, also create a symlink inside the libclang.dylib directory.

llvm-svn: 178372
2013-03-29 21:51:40 +00:00
Benjamin Kramer 054faa5a48 Sema: Warn on sizeof on binary ops on decayed arrays.
The array will decay into a pointer, creating an unexpected result.
sizeof(array + int) is an easy to make typo for sizeof(array) + int.

This was motivated by a NetBSD security bug, used sizeof(key - r) instead of
sizeof(key) - r, reducing entropy in a random number generator.
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/subr_cprng.c.diff?r1=1.14&r2=1.15&only_with_tag=MAIN&f=h

Differential Revision: http://llvm-reviews.chandlerc.com/D571

llvm-svn: 178371
2013-03-29 21:43:21 +00:00
Howard Hinnant cf1dc8d39e Test case was forming the wrong limits when size_t != unsigned long.
llvm-svn: 178370
2013-03-29 21:22:22 +00:00
Michael Gottesman 3b8f877860 Add clang.arc.used to ModuleHasARC so ARC always runs if said call is present in a module.
clang.arc.used is an interesting call for ARC since ObjCARCContract
needs to run to remove said intrinsic to avoid a linker error (since the
call does not exist).

llvm-svn: 178369
2013-03-29 21:15:23 +00:00
Jyotsna Verma add82b3c75 Hexagon: Add emitFrameIndexDebugValue function to emit debug information.
llvm-svn: 178368
2013-03-29 21:09:53 +00:00
Jim Ingham bb03b8f45d 1 breakpoint is a breakpoint not a breakpoints.
rdar://problem/13536544

llvm-svn: 178367
2013-03-29 21:01:03 +00:00
Eric Christopher 9c8414f84a Use 12 as the magic number for our abbreviation data and our
die values. A lot of DIEs have 10 attributes in C++ code (example
clang), none had more than 12. Seems like a good default.

llvm-svn: 178366
2013-03-29 20:23:06 +00:00
Eric Christopher 6be35037b5 Move the construction of the skeleton compile unit after the
entire original compile unit has been constructed.

llvm-svn: 178365
2013-03-29 20:23:02 +00:00
Adrian Prantl 30cf851ef2 move testcase into appropriate X86 subdirectory.
llvm-svn: 178364
2013-03-29 20:14:08 +00:00
Sean Callanan 3abb976dc9 Fixed a crash if the Objective-C runtime module
wasn't loaded into the underlying process or
couldn't be found.

<rdar://problem/13533671>

llvm-svn: 178363
2013-03-29 19:46:09 +00:00
Hal Finkel f8ac57e289 Implement FRINT lowering on PPC using frin
Like nearbyint, rint can be implemented on PPC using the frin instruction. The
complication comes from the fact that rint needs to set the FE_INEXACT flag
when the result does not equal the input value (and frin does not do that). As
a result, we use a custom inserter which, after the rounding, compares the
rounded value with the original, and if they differ, explicitly sets the XX bit
in the FPSCR register (which corresponds to FE_INEXACT).

Once LLVM has better modeling of the floating-point environment we should be
able to (often) eliminate this extra complexity.

llvm-svn: 178362
2013-03-29 19:41:55 +00:00
Adrian Prantl 0f6df00e4d Bugfix/Followup for r177086.
* Store the .block_descriptor (instead of self) in the alloca so we
  can guarantee that all captured variables are available at -O0.
* Add the missing OpDeref for the alloca.
rdar://problem/12767564

llvm-svn: 178361
2013-03-29 19:20:35 +00:00
Adrian Prantl de17db30d8 Improvement on r177086.
* Let DIType for block-captured self to point to the completed cached
  interface type.
rdar://problem/12767564

llvm-svn: 178360
2013-03-29 19:20:29 +00:00
Akira Hatanaka 7b8b9b9abf [mips] Define a function which returns the GPR register class.
llvm-svn: 178359
2013-03-29 19:17:42 +00:00
Jyotsna Verma 3abdf1c815 Hexagon: Set Hexagon tool-chain when configured as OSless target.
llvm-svn: 178358
2013-03-29 19:09:20 +00:00
Andrew Trick d97ff1fcee Fix TableGen subtarget-emitter to handle A9/Swift.
A9 uses itinerary classes, Swift uses RW lists. This tripped some
verification when we're expanding variants. I had to refine the
verification a bit.

llvm-svn: 178357
2013-03-29 19:08:31 +00:00
Matt Arsenault 19f773be37 Build fixes for STLPort + GCC
llvm-svn: 178356
2013-03-29 18:48:45 +00:00
Matt Arsenault 2080ecd107 Fix loop style
llvm-svn: 178355
2013-03-29 18:48:42 +00:00
Howard Hinnant 9cb970074f Bruce Mitchener, Jr.: Port to emscripten. Fixes http://llvm.org/bugs/show_bug.cgi?id=15624.
llvm-svn: 178354
2013-03-29 18:27:28 +00:00
Adrian Prantl 4b7cf64f66 Split the llvm/tools/clang/test/CodeGenObjC/debug-info-blocks.m testcase into a CFE and LLVM part.
rdar://problem/12767564

llvm-svn: 178353
2013-03-29 18:08:14 +00:00