Commit Graph

92057 Commits

Author SHA1 Message Date
Chris Lattner 187f653418 refactor the Value*/offset pair from MachineMemOperand out to a new
MachinePointerInfo struct, no functionality change.

This also adds an assert to MachineMemOperand::MachineMemOperand
that verifies that the Value* is either null or is an IR pointer type.

llvm-svn: 114389
2010-09-21 04:23:39 +00:00
Chris Lattner 191efcfc63 random cruft in my tree.
llvm-svn: 114387
2010-09-21 04:03:39 +00:00
Chris Lattner bb0a1c44bf fix rdar://8453210, a crash handling a call through a GS relative load.
For now, just disable folding the load into the call.

llvm-svn: 114386
2010-09-21 03:37:00 +00:00
Bill Wendling 7108ece077 Add a comment explaining why the MMX builtins are segregated and what we plan on
doing with them. It's a "FIXME" right now because this change hasn't been
implemented yet.

llvm-svn: 114385
2010-09-21 01:39:34 +00:00
Sean Callanan fc55f5d1b0 Removed the hacky "#define this ___clang_this" handler
for C++ classes.  Replaced it with a less hacky approach:

 - If an expression is defined in the context of a
   method of class A, then that expression is wrapped as
   ___clang_class::___clang_expr(void*) { ... }
   instead of ___clang_expr(void*) { ... }.

 - ___clang_class is resolved as the type of the target
   of the "this" pointer in the method the expression
   is defined in.

 - When reporting the type of ___clang_class, a method
   with the signature ___clang_expr(void*) is added to
   that class, so that Clang doesn't complain about a
   method being defined without a corresponding
   declaration.

 - Whenever the expression gets called, "this" gets
   looked up, type-checked, and then passed in as the
   first argument.

This required the following changes:

 - The ABIs were changed to support passing of the "this"
   pointer as part of trivial calls.

 - ThreadPlanCallFunction and ClangFunction were changed
   to support passing of an optional "this" pointer.

 - ClangUserExpression was extended to perform the
   wrapping described above.

 - ClangASTSource was changed to revert the changes
   required by the hack.

 - ClangExpressionParser, IRForTarget, and
   ClangExpressionDeclMap were changed to handle
   different manglings of ___clang_expr flexibly.  This
   meant no longer searching for a function called
   ___clang_expr, but rather looking for a function whose
   name *contains* ___clang_expr.

 - ClangExpressionParser and ClangExpressionDeclMap now
   remember whether "this" is required, and know how to
   look it up as necessary.

A few inheritance bugs remain, and I'm trying to resolve
these.  But it is now possible to use "this" as well as
refer implicitly to member variables, when in the proper
context.

llvm-svn: 114384
2010-09-21 00:44:12 +00:00
Rafael Espindola 461a692c7f Revert unrelated change that was accidentally included in the previous commit.
llvm-svn: 114383
2010-09-21 00:40:19 +00:00
Rafael Espindola f0591c1642 Implement support for .local and its "interesting" interactions with .comm.
llvm-svn: 114382
2010-09-21 00:24:38 +00:00
Johnny Chen 958da040e4 Changed the order of two assignment stmts.
llvm-svn: 114381
2010-09-21 00:16:09 +00:00
Johnny Chen 209cdbef64 Added the capability to source the configFile specified via the "-c" option in
order to customize the running of the test suite.  For the time being, the
supported customizations are:

o redirecting stdout and/or stderr
o specifying a list of compilers to build the test programs
o specifying a list of architectures to build the test programs for

Also checked into the examples/test directory some example files which
demonstrate the usage for the above customizations.

$ ./dotest.py -v -c ~/.lldbtest-config persistent_variables
$ cat ~/.lldbtest-config
sys.stderr = open("/tmp/lldbtest-stderr", "w")
sys.stdout = open("/tmp/lldbtest-stdout", "w")
compilers = ["gcc", "llvm-gcc"]
archs = ["x86_64", "i386"]
$ cat /tmp/lldbtest-stderr
----------------------------------------------------------------------
Collected 1 test


Configuration: arch=x86_64 compiler=gcc
test_persistent_variables (TestPersistentVariables.PersistentVariablesTestCase)
Test that lldb persistent variables works correctly. ... ok

----------------------------------------------------------------------
Ran 1 test in 1.397s

OK

Configuration: arch=x86_64 compiler=llvm-gcc
test_persistent_variables (TestPersistentVariables.PersistentVariablesTestCase)
Test that lldb persistent variables works correctly. ... ok

----------------------------------------------------------------------
Ran 1 test in 1.282s

OK

Configuration: arch=i386 compiler=gcc
test_persistent_variables (TestPersistentVariables.PersistentVariablesTestCase)
Test that lldb persistent variables works correctly. ... ok

----------------------------------------------------------------------
Ran 1 test in 1.297s

OK

Configuration: arch=i386 compiler=llvm-gcc
test_persistent_variables (TestPersistentVariables.PersistentVariablesTestCase)
Test that lldb persistent variables works correctly. ... ok

----------------------------------------------------------------------
Ran 1 test in 1.269s

OK
$ cat /tmp/lldbtest-stdout
$ 

llvm-svn: 114380
2010-09-21 00:09:27 +00:00
Douglas Gregor 7466127a4b When providing code completions for an argument in an Objective-C
message send, e.g.,

  [[NSString alloc] initWithCString:<CC>

look up all of the possible methods and determine the preferred type
for the argument expression based on the type of the corresponding
parameter.

llvm-svn: 114379
2010-09-21 00:03:25 +00:00
Johnny Chen dba0a0fbef Changed this breakpoint callback function to print to the stdout instead of
stderr so as not to disrupt the information emitted by the unittest framework.

llvm-svn: 114377
2010-09-20 23:51:27 +00:00
Fariborz Jahanian 8162d4ad31 Implements in IRgen gnu extensions missing LHS for
complex conditionals. Radar 8453812.

llvm-svn: 114376
2010-09-20 23:50:22 +00:00
Douglas Gregor f86e4da7ae Refactor code completion for expressions that occur as arguments in
Objective-C message sends. There is no functionality change here; this
is prep work for using the parameter types to help guide the
expression results when code-completing the argument.

llvm-svn: 114375
2010-09-20 23:34:21 +00:00
Douglas Gregor 5fb901deee Code completion has no reason to prefer values over types, especially
at the statement level or in Objective-C message receivers. Therefore,
just give types and declarations the same basic priority, and adjust
from there.

llvm-svn: 114374
2010-09-20 23:11:55 +00:00
Evan Cheng f3e9a48584 Enable machine sinking critical edge splitting. e.g.
define double @foo(double %x, double %y, i1 %c) nounwind {
  %a = fdiv double %x, 3.2
  %z = select i1 %c, double %a, double %y
  ret double %z
}

Was:
_foo:
        divsd   LCPI0_0(%rip), %xmm0
        testb   $1, %dil
        jne     LBB0_2
        movaps  %xmm1, %xmm0
LBB0_2:
        ret

Now:
_foo:
        testb   $1, %dil
        je      LBB0_2
        divsd   LCPI0_0(%rip), %xmm0
        ret
LBB0_2:
        movaps  %xmm1, %xmm0
        ret

This avoids the divsd when early exit is taken.
rdar://8454886

llvm-svn: 114372
2010-09-20 22:52:00 +00:00
Nate Begeman abb5a7370d Check in support for OpenCL conditional operator on vector types.
llvm-svn: 114371
2010-09-20 22:41:17 +00:00
Douglas Gregor 50832e0215 Slight refactoring in code-completion results generation, placing the
various priority adjustments for preferences (based on selectors,
types) in a single function to make extension easier.

llvm-svn: 114370
2010-09-20 22:39:41 +00:00
Dan Gohman 497b3cea1d Relax this check to silently swallow FE_INEXACT, following directions
from rdar://8452472. This unbreaks gcc.dg/builtins-17.c.

llvm-svn: 114368
2010-09-20 22:32:25 +00:00
Caroline Tice 75f9f34009 Make the short option print out before the long option in the
command options detailed help section (since it's sorted by short option).

llvm-svn: 114364
2010-09-20 21:52:58 +00:00
Caroline Tice 12cecd741d Make GetInstanceSettingsValue methods take an Error * rather than an Error &,
and have them return a bool to indicate success or not.

llvm-svn: 114361
2010-09-20 21:37:42 +00:00
Douglas Gregor db5c09a8cd Get rid of the lame attempt to prioritize "void" functions at
statement context; it really isn't helpful in practice (remember
printf!) and we'll be doing other adjustments for statements very soon.

llvm-svn: 114358
2010-09-20 21:25:19 +00:00
Douglas Gregor 9dcf58a546 Tweak priorities for some types and macros:
- In Objective-C, we prefer BOOL to bool for historic reasons;
  slightly penalize "bool".
  - Treat Nil macro as a NULL pointer constant.
  - Treat YES, NO, true, and false macros as constants.
  - Treat the bool macro as a type.

llvm-svn: 114356
2010-09-20 21:11:48 +00:00
Owen Anderson 5e4734245d CombinerAA is now reordering these stores.
llvm-svn: 114354
2010-09-20 20:56:29 +00:00
Caroline Tice daccaa9e83 Add UserSettings to Target class, making Target settings
the parent of Process settings;   add 'default-arch' as a
class-wide setting for Target.    Replace            lldb::GetDefaultArchitecture
with Target::GetDefaultArchitecture & Target::SetDefaultArchitecture.

Add 'use-external-editor' as user setting to Debugger class & update
code appropriately.

Add Error parameter to methods that get user settings, for easier
reporting of bad requests.

Fix various other minor related bugs.

Fix test cases to work with new changes.

llvm-svn: 114352
2010-09-20 20:44:43 +00:00
Bill Wendling c9cb0caeb7 The builtins __builtin_ia32_paddq and __builtin_ia32_psubq were missing.
llvm-svn: 114349
2010-09-20 20:40:00 +00:00
Owen Anderson 272ff94916 When TCO is turned on, it is possible to end up with aliasing FrameIndex's. Therefore,
CombinerAA cannot assume that different FrameIndex's never alias, but can instead use
MachineFrameInfo to get the actual offsets of these slots and check for actual aliasing.

This fixes CodeGen/X86/2010-02-19-TailCallRetAddrBug.ll and CodeGen/X86/tailcallstack64.ll
when CombinerAA is enabled, modulo a different register allocation sequence.

llvm-svn: 114348
2010-09-20 20:39:59 +00:00
Douglas Gregor 8af2ff89f7 Introduce a simple, substitution-based compression scheme for USRs, so
that redundant types don't result in super-long USRs. Fixes
<rdar://problem/8447875>.

llvm-svn: 114347
2010-09-20 20:37:39 +00:00
Jim Grosbach 94dfd6fc4f Simplify ARM callee-saved register handling by removing the distinction
between the high and low registers for prologue/epilogue code. This was
a Darwin-only thing that wasn't providing a realistic benefit anymore.
Combining the save areas simplifies the compiler code and results in better
ARM/Thumb2 codegen.

For example, previously we would generate code like:
        push    {r4, r5, r6, r7, lr}
        add     r7, sp, #12
        stmdb   sp!, {r8, r10, r11}
With this change, we combine the register saves and generate:
        push    {r4, r5, r6, r7, r8, r10, r11, lr}
        add     r7, sp, #12

rdar://8445635

llvm-svn: 114340
2010-09-20 19:32:20 +00:00
Rafael Espindola 32ab4558fe Produce a R_X86_64_32 when the value is >=0.
llvm-svn: 114339
2010-09-20 19:20:47 +00:00
Evan Cheng 2031b768ba Avoid splitting critical edge twice for a set of PHI uses.
llvm-svn: 114338
2010-09-20 19:12:55 +00:00
Douglas Gregor 8f78579f9d Fix CMake clangIndex library dependencies, from Logan Chien
llvm-svn: 114336
2010-09-20 18:32:29 +00:00
Daniel Dunbar c1dd0e97f3 Driver/Objective-C: Retool Objective-C ABI flags to be more usable, and actually
document behavior. Will wonders never cease.

llvm-svn: 114334
2010-09-20 18:19:55 +00:00
Johnny Chen daebb6d805 More modularizations.
llvm-svn: 114333
2010-09-20 18:07:50 +00:00
Johnny Chen a4b9aa0538 Added comments.
llvm-svn: 114332
2010-09-20 17:25:45 +00:00
Douglas Gregor db8c6fd18f Check that an overloaded function name, when used by the ! operator,
actually resolves to a particular function. Fixes PR8181, from Faisal
Vali!

llvm-svn: 114331
2010-09-20 17:13:33 +00:00
Johnny Chen 433d7741bd Fixed wrong logic in validating term-width value; should be && instead of ||.
llvm-svn: 114330
2010-09-20 17:04:41 +00:00
Douglas Gregor 7319327007 Give implicitly-defined default constructors and destructors empty
bodies, from Martin Vejnar!

llvm-svn: 114329
2010-09-20 16:48:21 +00:00
Johnny Chen ea9fc18163 Fixed lldb 'settings set term-widt 70' command not working.
rdar://problem/8449849

llvm-svn: 114328
2010-09-20 16:36:43 +00:00
Caroline Tice 201a88591d Fix indentations.
llvm-svn: 114326
2010-09-20 16:21:41 +00:00
Caroline Tice dde9cff32a Add GetDescription() and __repr__ () methods to most API classes, to allow
"print" from inside Python to print out the objects in a more useful
manner.

llvm-svn: 114321
2010-09-20 05:20:02 +00:00
Francois Pichet fd02aa84dc Fix the "unable to rename temporary" lit test failing on Windows. rename is now copy + delete on Windows. Problem to be revisited for a permanent and clean solution.
llvm-svn: 114320
2010-09-20 04:03:07 +00:00
Chris Lattner a005f9400d fix a bug I introduced back in the hayday of version #2.
llvm-svn: 114319
2010-09-20 03:58:32 +00:00
Argyrios Kyrtzidis 40cec8326c Revert r114316, -Wunused-value enabled by default was intended.
llvm-svn: 114318
2010-09-19 23:03:35 +00:00
NAKAMURA Takumi b912c27fc9 test/CodeGen/X86: Add explicit triplet -mtriple=i686-linux to 3 tests incompatible to Win32 codegen.
r114297 raises 3 failures. They might fail also on mingw.

llvm-svn: 114317
2010-09-19 21:58:55 +00:00
Argyrios Kyrtzidis 3698bf1c6d Make -Wunused-value off by default, matching GCC. Fixes rdar://7126194.
llvm-svn: 114316
2010-09-19 21:21:44 +00:00
Argyrios Kyrtzidis 72664df103 Implement -Wunused-label.
llvm-svn: 114315
2010-09-19 21:21:25 +00:00
Argyrios Kyrtzidis 9096341310 Warn when an expression result in a LabelStmt is unused.
llvm-svn: 114314
2010-09-19 21:21:10 +00:00
Owen Anderson 7b8d2ae912 Revert r114312 while I sort out some issues.
llvm-svn: 114313
2010-09-19 21:01:26 +00:00
Owen Anderson ff82f8a35b Tentatively enabled DAGCombiner Alias Analysis by default. As far as I know,
r114268 fixed the last of the blockers to enabling it.  I will be monitoring
for failures.

llvm-svn: 114312
2010-09-19 19:51:55 +00:00
Daniel Dunbar 549decf4cc Update users manual comments on X86 and ARM support.
llvm-svn: 114311
2010-09-19 19:26:59 +00:00