Commit Graph

99324 Commits

Author SHA1 Message Date
Ted Kremenek e92b6e436d Update CMake build.
llvm-svn: 123491
2011-01-14 22:58:11 +00:00
Bob Wilson 03912aba9a Fix some tablegen issues to allow using zero_reg for InstAlias definitions.
This is needed to allow an InstAlias for an instruction with an "OptionalDef"
result register (like ARM's cc_out) where you want to set the optional register
to reg0.

llvm-svn: 123490
2011-01-14 22:58:09 +00:00
Douglas Gregor 715e461463 Handle substitutions into function parameter packs whose patterns
contain multiple parameter packs at different levels.

llvm-svn: 123488
2011-01-14 22:40:04 +00:00
Ted Kremenek 6677f65de1 Fix memory leak found by clang static analyzer.
llvm-svn: 123487
2011-01-14 22:34:17 +00:00
Ted Kremenek b5241b2b59 'HiReg' is written but never read. Nuke its
declaration and its assignments.

Found by clang static analyzer.

llvm-svn: 123486
2011-01-14 22:34:13 +00:00
Ted Kremenek 8cb349de80 Cleanup confused code that redundantly called "getDeclContext()" twice.
Found by clang static analyzer.

llvm-svn: 123485
2011-01-14 22:31:41 +00:00
Ted Kremenek bea8b40a86 The variable 'ReusedDecl' is written but never read.
Remove this variable (found by clang static analyzer).

llvm-svn: 123484
2011-01-14 22:31:38 +00:00
Ted Kremenek 7f1f3f6e32 The variable 'isTemplateSpecialization' is no longer
used; nuke all assignments and its declaration.

llvm-svn: 123483
2011-01-14 22:31:36 +00:00
Ted Kremenek c2a6412b97 Remove unused store to variable 'Name'. Found by clang static analyzer.
llvm-svn: 123482
2011-01-14 22:31:34 +00:00
Ted Kremenek f6ab5ff7d7 Driver: tweak handling of '--analyze' to invoke
analyzer -cc1 options that are tailored to the
input type.  If the input type is "C++", we should
only run the dead stores checker (for now).  Similarly,
checks specific to Objective-C should only run
on Objective-C Code.

llvm-svn: 123481
2011-01-14 22:31:31 +00:00
Owen Anderson 3e2f6cf7ae Fix a false-positive warning.
llvm-svn: 123480
2011-01-14 22:31:13 +00:00
Dan Gohman abac063b7a Delete an assignment to ThisBB which isn't needed, and tidy up some
comments.

llvm-svn: 123479
2011-01-14 22:26:16 +00:00
Owen Anderson 6216a44d35 Fixed by r123477.
llvm-svn: 123478
2011-01-14 22:19:38 +00:00
Owen Anderson 9eb7cb48e4 Enhance GlobalOpt to be able evaluate initializers that involve stores through
bitcasts, at least in simple cases.  This fixes clang's CodeGenCXX/virtual-base-dtor.cpp

llvm-svn: 123477
2011-01-14 22:19:20 +00:00
Anton Korobeynikov 9be547cfd3 Add a possibility to switch between CFI directives- and table-based frame description emission. Currently all the backends use table-based stuff.
llvm-svn: 123476
2011-01-14 21:58:08 +00:00
Anton Korobeynikov 4d9de6be4b Cleanup
llvm-svn: 123475
2011-01-14 21:57:58 +00:00
Anton Korobeynikov b46ef57de5 Add CFI directives-based frame information emission. Not hooked yet.
llvm-svn: 123474
2011-01-14 21:57:53 +00:00
Anton Korobeynikov 61d167e92b Split stuff as a preparation for CFI directives-based frame information emission
llvm-svn: 123473
2011-01-14 21:57:45 +00:00
Anton Korobeynikov e2bea1c82e Use common style for .cfi directives
llvm-svn: 123472
2011-01-14 21:57:39 +00:00
Johnny Chen ded0a2c05a Converted to use Makefile.rules.
llvm-svn: 123471
2011-01-14 21:55:29 +00:00
Douglas Gregor b884000ba9 Teach PackExpansionExpr to keep track of the number of pack expansions
it will expand to, if known. Propagate this information throughout Sema.

llvm-svn: 123470
2011-01-14 21:20:45 +00:00
Johnny Chen fa38041dac Add makefile debugging rule for printing out the value of a variable.
From http://blog.melski.net/tag/debugging-makefiles/.

Example:

[13:14:59] johnny:/Volumes/data/lldb/svn/trunk/test/class_static $ make print-CC
CC=gcc
  origin = file
  flavor = recursive
   value = gcc
[13:15:09] johnny:/Volumes/data/lldb/svn/trunk/test/class_static $ make print-LD
LD=  g++
  origin = file
  flavor = recursive
   value = $(call cxx_linker,$(CC))
[13:15:21] johnny:/Volumes/data/lldb/svn/trunk/test/class_static $ make print-CXX
CXX=  g++
  origin = file
  flavor = recursive
   value = $(call cxx_compiler,$(CC))
[13:15:29] johnny:/Volumes/data/lldb/svn/trunk/test/class_static $

llvm-svn: 123469
2011-01-14 21:18:12 +00:00
Andrew Trick 9ccce77893 Support for precise scheduling of the instruction selection DAG,
disabled in this checkin. Sorry for the large diffs due to
refactoring. New functionality is all guarded by EnableSchedCycles.

Scheduling the isel DAG is inherently imprecise, but we give it a best
effort:
- Added MayReduceRegPressure to allow stalled nodes in the queue only
  if there is a regpressure need.
- Added BUHasStall to allow checking for either dependence stalls due to
  latency or resource stalls due to pipeline hazards.
- Added BUCompareLatency to encapsulate and standardize the heuristics
  for minimizing stall cycles (vs. reducing register pressure).
- Modified the bottom-up heuristic (now in BUCompareLatency) to
  prioritize nodes by their depth rather than height. As long as it
  doesn't stall, height is irrelevant. Depth represents the critical
  path to the DAG root.
- Added hybrid_ls_rr_sort::isReady to filter stalled nodes before
  adding them to the available queue.

Related Cleanup: most of the register reduction routines do not need
to be templates.

llvm-svn: 123468
2011-01-14 21:11:41 +00:00
Caroline Tice 8f5b2eb1e2 Recent modifications to the Python script interpreter caused some problems
when handling one-liner commands that contain escaped characters.  In
order to deal with the new namespace/dictionary stuff, the command was
being embedded within a second string, which messed up the escaping.

This fixes the problem by handling one-liners in a different manner, so they
no longer need to be embedded within another string, and can still be
processed in the proper namespace/dictionary context.

llvm-svn: 123467
2011-01-14 21:09:29 +00:00
Stephen Wilson c6c7ca58e4 Extend the ObjectFile interface to support dynamic loading on ELF platforms.
Debuggers on ELF platforms hook into the runtime linker by monitoring a special
"rendezvous" embedded in the address space of the inferior process.  The exact
location of this structure is filled in by the runtime linker and can be
resolved by locating the DT_DEBUG entry in the processes .dynamic section.  The
new GetImageInfoAddress() method (morally equivalent to
Process::GetImageInfoAddress) provides the mechanism to locate this information.

GetEntryPoint() simply returns the address of the start symbol in the executable
if present.  It is useful to the dynamic loader plugin for ELF systems as this
is the earliest point where LLDB can break and probe the inferiors .dynamic
section and rendezvous structure.  Also, this address can be used in the
computation of the virtual base address for position independent executables.

llvm-svn: 123466
2011-01-14 21:08:59 +00:00
Stephen Wilson 0b8dab726b Do not prematurely invalidate thread handle.
Setting m_private_state_thread to an invalid value when the child thread exits
results in a race condition between calls to ThreadCancel and ThreadJoin.

llvm-svn: 123465
2011-01-14 21:07:56 +00:00
Stephen Wilson 5394e0da9d Do not prefix log messages with ProcessMacOSX from the context of Process.
llvm-svn: 123464
2011-01-14 21:07:07 +00:00
Johnny Chen 6055b44b04 Added comments.
llvm-svn: 123463
2011-01-14 20:55:13 +00:00
Argyrios Kyrtzidis 243aedb6ec Properly propagate #pragma diagnostic mappings from PCH but not command-line warning flags.
Addresses rdar://8435969&8852495

llvm-svn: 123462
2011-01-14 20:54:07 +00:00
Johnny Chen d43e208bb4 Make CC defaults to gcc. The cxx_compiler and cxx_linker functions rely on substituting "g++"
for "gcc".

llvm-svn: 123461
2011-01-14 20:46:49 +00:00
Ted Kremenek 44e2c5cdd9 Rename 'RemoveDeadBindings()' to 'removeDeadBindings()'
llvm-svn: 123460
2011-01-14 20:34:15 +00:00
Ted Kremenek 7c211625e0 Rename 'EnterStackFrame()' to 'enterStackFrame()'.
llvm-svn: 123459
2011-01-14 20:34:10 +00:00
Ted Kremenek 95d874fa5d Teach RegionStore::EnterStackFrame() to handle
the case where the called function has fewer
formal arguments than actual arguments.  This
fixes a crash in the analyzer when doing
function call inlining.

Patch by Zhenbo Xu!

llvm-svn: 123458
2011-01-14 20:29:43 +00:00
Chris Lattner b498f9aff3 switch SRoA to use LoadAndStorePromoter instead of its own copy of the code.
llvm-svn: 123457
2011-01-14 19:50:47 +00:00
Chris Lattner 95294b8796 Add a new LoadAndStorePromoter class, which implements the general
"promote a bunch of load and stores" logic, allowing the code to
be shared and reused.

llvm-svn: 123456
2011-01-14 19:36:13 +00:00
Greg Clayton 1629c43dd3 Removed printf statements in code.
llvm-svn: 123455
2011-01-14 19:21:25 +00:00
Johnny Chen 15a42aefa4 Add an expression command:
expression (int)[nil_mutable_array count]

within NSArray_expr() function and expect a return of 0.

llvm-svn: 123454
2011-01-14 19:19:30 +00:00
Jay Foad cbe1505617 OperandTraits<>::Layout isn't used for anything. Remove it.
llvm-svn: 123452
2011-01-14 18:41:56 +00:00
Johnny Chen bdb4efcf17 The cxx_compiler function should not blindly return clang++ as the C++ compiler if $(CC) contains "clang".
Instead, it should perform a textual replacement of $(CC) from "clang" to "clang++".  The same is true
for "llvm-gcc" to "llvm-g++" and for "gcc" to "g++".  This way, we keep the path component of the $(CC)
passed in from the user and do not end up with a mixed toolchains with different paths.

Ditto for a newly added function called cxx_linker.

llvm-svn: 123451
2011-01-14 18:19:53 +00:00
Douglas Gregor 9f40713ebc When we're instantiating a direct variable initializer that has a pack
expansion in it, we may end up instantiating to an empty
expression-list. In this case, the variable is uninitialized; tweak
the instantiation logic to handle this case. Fixes PR8977.

llvm-svn: 123449
2011-01-14 17:12:22 +00:00
Douglas Gregor 0dca5fdb4e Keep track of the number of expansions to be produced from a type pack
expansion, when it is known due to the substitution of an out
parameter pack. This allows us to properly handle substitution into
pack expansions that involve multiple parameter packs at different
template parameter levels, even when this substitution happens one
level at a time (as with partial specializations of member class
templates and the signatures of member function templates).

Note that the diagnostic we provide when there is an arity mismatch
between an outer parameter pack and an inner parameter pack in this
case isn't as clear as the normal diagnostic for an arity
mismatch. However, this doesn't matter because these cases are very,
very rare and (even then) only typically occur in a SFINAE context.

The other kinds of pack expansions (expression, template, etc.) still
need to support optional tracking of the number of expansions, and we
need the moral equivalent of SubstTemplateTypeParmPackType for
substituted argument packs of template template and non-type template
parameters.

llvm-svn: 123448
2011-01-14 17:04:44 +00:00
Rafael Espindola b1ebba9ec3 Update llvm-gcc's tests.
llvm-svn: 123447
2011-01-14 17:01:20 +00:00
Oscar Fuentes 959d253476 Reorder macros on config.h.cmake to easily compare it against
config.h.in.

Patch by arrowdodger!

llvm-svn: 123445
2011-01-14 16:41:03 +00:00
Devang Patel 610c41e7b0 Disable debug mode.
llvm-svn: 123443
2011-01-14 15:55:50 +00:00
Duncan Sands d6f1a9584d Turn X-(X-Y) into Y. According to my auto-simplifier this is the most common
simplification present in fully optimized code (I think instcombine fails to
transform some of these when "X-Y" has more than one use).  Fires here and
there all over the test-suite, for example it eliminates 8 subtractions in
the final IR for 445.gobmk, 2 subs in 447.dealII, 2 in paq8p etc.

llvm-svn: 123442
2011-01-14 15:26:10 +00:00
Duncan Sands 571fd9a606 Factorize common code out of the InstructionSimplify shift logic. Add in
threading of shifts over selects and phis while there.  This fires here and
there in the testsuite, to not much effect.  For example when compiling spirit
it fires 5 times, during early-cse, resulting in 6 more cse simplifications,
and 3 more terminators being folded by jump threading, but the final bitcode
doesn't change in any interesting way: other optimizations would have caught
the opportunity anyway, only later.

llvm-svn: 123441
2011-01-14 14:44:12 +00:00
Duncan Sands c3eb0f4b2e Rename this test.
llvm-svn: 123440
2011-01-14 14:16:33 +00:00
John McCall a08ffd22d5 Support the zero-initialization of VLAs when that really means a zero
bit-pattern.  Continue punting on zero-initializing VLAs with a nonzero
pattern.

llvm-svn: 123439
2011-01-14 10:37:58 +00:00
John McCall 5461a7523f When simplifying a cleanup's entry by merging it into a single predecessor,
replace all uses of the entry with the predecessor.  There are no cleanups
relying on this right now, but if we ever want a cleanup with a phi inside
it, this will be important.

llvm-svn: 123438
2011-01-14 10:35:38 +00:00
Chris Lattner 8d7716a220 switch the second scalarrepl pass to use SSAUpdater. We run two scalarrepl passes: one
early in the cleanup code and one late interlaced with the inliner.  The second one is
important because inlining and other scalar optzns can unpin allocas, allowing them to 
be split up and promoted.  While important for performance, this is also relatively
rare, and we would previously force a (non-lazy) computation of DomFrontiers, which 
happened even if nothing became unpinned.

With this patch, the first pass of scalarrepl still promotes the vast bulk of allocas
in programs, but hte second pass has changed to use SSAUpdater, which is more "sparse"
and lazy.  This speeds up opt -O3 time on kimwitu++ (a c++ app) by about 1%.  The
numbers are interesting: the first pass promotes ~17500 allocas.  The second pass
promotes about 1600.  For non-C++ codes, the compile time win should be greater, 
because the second pass of scalarrepl does less.

llvm-svn: 123437
2011-01-14 08:21:08 +00:00