Commit Graph

121292 Commits

Author SHA1 Message Date
Howard Hinnant 62efe0b062 Nothing but polishing comments.
llvm-svn: 149515
2012-02-01 16:56:40 +00:00
Anna Zaks 97981bdeb0 [analyzer] Testing: add 2 new checkers to the buildbot script.
llvm-svn: 149514
2012-02-01 16:46:57 +00:00
Howard Hinnant 4ca103d14c Move an error detector to a better place.
llvm-svn: 149513
2012-02-01 16:16:11 +00:00
NAKAMURA Takumi 2235e6da8f test/Driver/target.c: Relax expression for "gcc.exe" on win32.
llvm-svn: 149510
2012-02-01 15:16:22 +00:00
Dylan Noblesmith af9be0b6fa cmake: make BUILD_SHARED_LIBS a visible option
It could only be specified on the commandline, and wouldn't show
up as an option in the GUI or when invoked via `cmake -i` at all.

This also tells CMake that it's a BOOL, rather than "UNINITIALIZED".

llvm-svn: 149506
2012-02-01 14:49:39 +00:00
NAKAMURA Takumi fe8186f8b0 test/CodeGen/X86/avx-minmax.ll: Relax expressions for Win32 targets. YMM arguments are passed as indirect on Win32 x64.
llvm-svn: 149505
2012-02-01 14:35:29 +00:00
Dylan Noblesmith 86780e906b include clang's config.h unconditionally
And remove HAVE_CLANG_CONFIG_H, now that the header is generated
in the autoconf build, too. (clang r149497 / llvm r149498)

Also include the config.h header after all other headers, per
the LLVM coding standards.

It also turns out WindowsToolChain.cpp wasn't using the config
header at all, so that include's just deleted now.

llvm-svn: 149504
2012-02-01 14:25:28 +00:00
Tobias Grosser c327932cf5 ScopInfo: Simplify some isl code
llvm-svn: 149503
2012-02-01 14:23:36 +00:00
Tobias Grosser 5772e65be0 CodeGeneration: Rephrase comment slightly
llvm-svn: 149502
2012-02-01 14:23:33 +00:00
Tobias Grosser bda1f8f808 CodeGeneration: Order includes alphabetically
llvm-svn: 149501
2012-02-01 14:23:29 +00:00
NAKAMURA Takumi d8f100f3b9 test/Modules/compiler_builtins.m: Appease Cygwin to add -D__need_wint_t.
On Cygwin, at first, <stddef.h> is included without __need_wint_t.
Next, <stddef.h> is included with __need_wint_t, though Modules feature would not process <stddef.h> twice.
Then, wint_t is not found in system headers.

llvm-svn: 149500
2012-02-01 14:09:19 +00:00
NAKAMURA Takumi 53559c6aa0 test/Modules/compiler_builtins.m: Mark this as XFAIL:win32. MS limits.h provides size_t.
llvm-svn: 149499
2012-02-01 14:09:13 +00:00
Dylan Noblesmith 57f439cb9e autoconf: generate clang's private config.h header
The CMake build already generated one. Follows clang r149497.

This brings us one step closer to compiling and configuring clang
separately from LLVM using the autoconf build, too.

(I lack the right version of autoconf et al. to regen, but it
was a simple change, so I just updated configure manually.)

llvm-svn: 149498
2012-02-01 14:06:21 +00:00
Dylan Noblesmith 96f0db0f84 autoconf: add private config.h to clang
This already exists in the CMake build, which is part of what makes
building clang separately from llvm via cmake possible. This cleans up
that discrepancy between the build systems (and sets the groundwork
for configuring clang separately, too).

llvm-svn: 149497
2012-02-01 13:50:25 +00:00
Dylan Noblesmith c20ccdd786 cmake: don't install config.h
This header is private and shouldn't be used by clients.

llvm-svn: 149496
2012-02-01 13:50:22 +00:00
Dylan Noblesmith 9759e9b11b Frontend: fix comment typos
llvm-svn: 149495
2012-02-01 13:50:20 +00:00
Elena Demikhovsky 824eed70a6 Passing AVX 256-bit structures in Win64 was wrong.
Fixed Win64 calling conventions.

llvm-svn: 149494
2012-02-01 10:46:14 +00:00
Elena Demikhovsky 34cca175ab Shortened code in shuffle masks
llvm-svn: 149493
2012-02-01 10:33:05 +00:00
Alexander Potapenko c97434ecaf Disable wrapping memcpy() on Mac OS Lion, where it
actually falls back to memmove.
In this case we still need to initialize real_memcpy, so we set it to
real_memmove
We check for MACOS_VERSION_SNOW_LEOPARD, because currently only Snow
Leopard and Lion are supported.

llvm-svn: 149492
2012-02-01 10:07:52 +00:00
Alexander Potapenko f504602a0f Disables testing memcpy() on Mac OS 10.7,
where memcpy() in fact aliases memmove() and thus calling it with
overlapping parameters is not an error.

llvm-svn: 149491
2012-02-01 09:47:40 +00:00
Richard Smith 1b470417e4 constexpr: check for overflow in pointer subtraction.
This is a mess. According to the C++11 standard, pointer subtraction only has
undefined behavior if the difference of the array indices does not fit into a
ptrdiff_t.

However, common implementations effectively perform a char* subtraction first,
and then divide the result by the element size, which can cause overflows in
some cases. Those cases are not considered to be undefined behavior by this
change; perhaps they should be.

llvm-svn: 149490
2012-02-01 08:10:20 +00:00
Greg Clayton 6b2bd93918 Added many more python convenience accessors:
You can now access a frame in a thread using:

lldb.SBThread.frame[int] -> lldb.SBFrame object for a frame in a thread

Where "int" is an integer index. You can also access a list object with all of
the frames using:

lldb.SBThread.frames => list() of lldb.SBFrame objects

All SB objects that give out SBAddress objects have properties named "addr"

lldb.SBInstructionList now has the following convenience accessors for len() and
instruction access using an index:

insts = lldb.frame.function.instructions
for idx in range(len(insts)):
    print insts[idx]
    
Instruction lists can also lookup an isntruction using a lldb.SBAddress as the key:

pc_inst = lldb.frame.function.instructions[lldb.frame.addr]

lldb.SBProcess now exposes:

lldb.SBProcess.is_alive => BOOL Check if a process is exists and is alive
lldb.SBProcess.is_running => BOOL check if a process is running (or stepping):
lldb.SBProcess.is_running => BOOL check if a process is currently stopped or crashed:
lldb.SBProcess.thread[int] => lldb.SBThreads for a given "int" zero based index
lldb.SBProcess.threads => list() containing all lldb.SBThread objects in a process

SBInstruction now exposes:
lldb.SBInstruction.mnemonic => python string for instruction mnemonic
lldb.SBInstruction.operands => python string for instruction operands
lldb.SBInstruction.command => python string for instruction comment

SBModule now exposes:

lldb.SBModule.uuid => uuid.UUID(), an UUID object from the "uuid" python module
lldb.SBModule.symbol[int] => lldb.Symbol, lookup symbol by zero based index
lldb.SBModule.symbol[str] => list() of lldb.Symbol objects that match "str"
lldb.SBModule.symbol[re] => list() of lldb.Symbol objecxts that match the regex
lldb.SBModule.symbols => list() of all symbols in a module

  
SBAddress objects can now access the current load address with the "lldb.SBAddress.load_addr"
property. The current "lldb.target" will be used to try and resolve the load address.

Load addresses can also be set using this accessor:

addr = lldb.SBAddress()
addd.load_addr = 0x123023

Then you can check the section and offset to see if the address got resolved.

SBTarget now exposes:

lldb.SBTarget.module[int] => lldb.SBModule from zero based module index
lldb.SBTarget.module[str] => lldb.SBModule by basename or fullpath or uuid string
lldb.SBTarget.module[uuid.UUID()] => lldb.SBModule whose UUID matches
lldb.SBTarget.module[re] => list() of lldb.SBModule objects that match the regex
lldb.SBTarget.modules => list() of all lldb.SBModule objects in the target

SBSymbol now exposes:

lldb.SBSymbol.name => python string for demangled symbol name
lldb.SBSymbol.mangled => python string for mangled symbol name or None if there is none
lldb.SBSymbol.type => lldb.eSymbolType enum value
lldb.SBSymbol.addr => SBAddress object that represents the start address for this symbol (if there is one)
lldb.SBSymbol.end_addr => SBAddress for the end address of the symbol  (if there is one)
lldb.SBSymbol.prologue_size => pythin int containing The size of the prologue in bytes
lldb.SBSymbol.instructions => SBInstructionList containing all instructions for this symbol

SBFunction now also has these new properties in addition to what is already has:
lldb.SBFunction.addr => SBAddress object that represents the start address for this function
lldb.SBFunction.end_addr => SBAddress for the end address of the function
lldb.SBFunction.instructions => SBInstructionList containing all instructions for this function

SBFrame now exposes the SBAddress for the frame:
lldb.SBFrame.addr => SBAddress which is the section offset address for the current frame PC

These are all in addition to what was already added. Documentation and website
updates coming soon.

llvm-svn: 149489
2012-02-01 08:09:32 +00:00
Elena Demikhovsky 0e48c70ba7 Optimization for "truncate" operation on AVX.
Truncating v4i64 -> v4i32 and v8i32 -> v8i16 may be done with set of shuffles.

llvm-svn: 149485
2012-02-01 07:56:44 +00:00
Stepan Dyatkovskiy 5fecf54460 Compatability fix for SwitchInst refactoring.
The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want.

What was done:

1. Changed semantics of index inside the getCaseValue method:
getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous.
2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned.
3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment.
4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst.
4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor.
4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor.

Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang.
llvm-svn: 149482
2012-02-01 07:50:21 +00:00
Stepan Dyatkovskiy 513aaa5691 SwitchInst refactoring.
The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want.

What was done:

1. Changed semantics of index inside the getCaseValue method:
getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous.
2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned.
3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment.
4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst.
4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor.
4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor.

Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang.
llvm-svn: 149481
2012-02-01 07:49:51 +00:00
Andrew Trick cbc845f9cf Add pass printer passes in the right place.
The pass pointer should never be referenced after sending it to
schedulePass(), which may delete the pass. To fix this bug I had to
clean up the design leading to more goodness.

You may notice now that any non-analysis pass is printed. So things like loop-simplify and lcssa show up, while target lib, target data, alias analysis do not show up. Normally, analysis don't mutate the IR, but you can now check this by using both -print-after and -print-before. The effects of analysis will now show up in between the two.

The llc path is still in bad shape. But I'll be improving it in my next checkin. Meanwhile, print-machineinstrs still works the same way. With print-before/after, many llc passes that were not printed before now are, some of these should be converted to analysis. A few very important passes, isel and scheduler, are not properly initialized, so not printed.

llvm-svn: 149480
2012-02-01 07:16:20 +00:00
Andrew Trick 96c2159289 whitespace
llvm-svn: 149479
2012-02-01 07:16:17 +00:00
Craig Topper 9cdb8bdf04 Don't create VBROADCAST nodes if any nodes use the chain result from the load. Fixes PR11900.
llvm-svn: 149478
2012-02-01 06:51:58 +00:00
Argyrios Kyrtzidis a11b35a9b0 Revert r149363 which was part a series of commits that were reverted in llvm
commit 149470. This fixes test/CodeGen/PR3589-freestanding-libcalls.c.

Original log:

    ConstantArray::get() (for strings) is going away, use
    ConstantDataArray::getString instead.

    Many instances of ConstantArray::get() could be moved to
    use more efficient ConstantDataArray methods that avoid a ton
    of intermediate Constant*'s for each element (e.g.
    GetConstantArrayFromStringLiteral).  I don't plan on doing this
    in the short-term though.

llvm-svn: 149477
2012-02-01 06:36:49 +00:00
Argyrios Kyrtzidis c3c9ee5623 Remove redundant checks in CXXRecordDecl::isCLike(), as suggested by Sebastian.
llvm-svn: 149476
2012-02-01 06:36:44 +00:00
NAKAMURA Takumi e1d61f666b BBVectorize.cpp: Try to fix MSVC build. map::iterator and multimap::iterator are incompatible.
llvm-svn: 149475
2012-02-01 06:11:58 +00:00
Eric Christopher ee4ab93906 For pass-by-value record arguments to functions emit a forward decl
instead of the entire class definition.

llvm-svn: 149474
2012-02-01 06:07:23 +00:00
Richard Smith c8042323e1 constexpr: overflow checking for integral and floating-point arithmetic.
llvm-svn: 149473
2012-02-01 05:53:12 +00:00
Hal Finkel 8a3aebe5e0 A few of the changes suggested in code review (by Nick Lewycky)
llvm-svn: 149472
2012-02-01 05:51:45 +00:00
Douglas Gregor d3cebdba41 When providing code completions for a switch over a scoped enumeration
type, be sure to add the qualifier for the enumeration type.

llvm-svn: 149471
2012-02-01 05:02:47 +00:00
Argyrios Kyrtzidis 17c981a45b Revert Chris' commits up to r149348 that started causing VMCoreTests unit test to fail.
These are:

r149348
r149351
r149352
r149354
r149356
r149357
r149361
r149362
r149364
r149365

llvm-svn: 149470
2012-02-01 04:51:17 +00:00
Richard Smith 0287910521 constexpr: Unlike other incomplete types, 'void' cannot possibly be completed as
a literal type. Disallow it as the return type of a constexpr function
declaration.

llvm-svn: 149469
2012-02-01 04:40:02 +00:00
Hal Finkel c34e51132c Add a basic-block autovectorization pass.
This is the initial checkin of the basic-block autovectorization pass along with some supporting vectorization infrastructure.
Special thanks to everyone who helped review this code over the last several months (especially Tobias Grosser).

llvm-svn: 149468
2012-02-01 03:51:43 +00:00
Richard Smith 47b349328b constexpr: require 'this' to point to an object in a constexpr method call.
llvm-svn: 149467
2012-02-01 02:39:43 +00:00
Greg Clayton 2415586faa Added a new convenience property on lldb.SBThread names "frames" which always returns a complete list of all lldb.SBFrame objects:
(lldb) script
>>> frames = lldb.thread.frames
>>> for frame in frames:
...   print frame

Also changed all of the "__repr__" methods to strip any trailing newline characters so we don't end up with entra newlines.

llvm-svn: 149466
2012-02-01 02:30:27 +00:00
Johnny Chen fdc80a5cf7 lldb should warn when dSYM does not match the binary.
o Symbols.cpp:

  Emit a warning message when dSYM does not match the binary.

o warnings/uuid:

  Added regression test case.

o lldbtest.py:

  Modified to allow test case writer to demand that the build command does not begin
  with a clean first; required to make TestUUIDMismatchWanring.py work.

rdar://problem/10515708

llvm-svn: 149465
2012-02-01 01:49:50 +00:00
Greg Clayton 05e8d19446 Added a new class to the lldb python module:
lldb.value()

It it designed to be given a lldb.SBValue object and it allows natural
use of a variable value:

    pt = lldb.value(lldb.frame.FindVariable("pt"))
    print pt
    print pt.x
    print pt.y

    pt = lldb.frame.FindVariable("rectangle_array")
    print rectangle_array[12]
    print rectangle_array[5].origin.x

Note that array access works just fine and works on arrays or pointers:

pt = lldb.frame.FindVariable("point_ptr")
print point_ptr[5].y

Also note that pointer child accesses are done using a "." instead of "->":

print point_ptr.x

llvm-svn: 149464
2012-02-01 01:46:19 +00:00
Richard Smith 7bb0067c06 constexpr: add support for comparisons of pointer-to-members.
llvm-svn: 149463
2012-02-01 01:42:44 +00:00
Douglas Gregor 53a9bdf17e Improve checking of explicit captures in a C++11 lambda expression:
- Actually building the var -> capture mapping properly (there was an off-by-one error)
  - Keeping track of the source location of each capture
  - Minor QoI improvements, e.g, highlighing the prior capture if
  there are multiple captures, pointing at the variable declaration we
  found if we reject it.

As part of this, add standard citations for the various semantic
checks we perform, and note where we're not performing those checks as
we should.

llvm-svn: 149462
2012-02-01 01:18:43 +00:00
Enrico Granata 8680c713a6 remove spurious leftover code from std::list testcase
llvm-svn: 149461
2012-02-01 00:43:33 +00:00
Nico Weber f8bb3de488 Fix crash on invalid in microsoft anonymous struct extension.
Fixes PR11847. Patch from Jason Haslam!

llvm-svn: 149460
2012-02-01 00:41:00 +00:00
Howard Hinnant 3b22c6c395 Here's a test for catching pointers.
llvm-svn: 149459
2012-02-01 00:22:38 +00:00
Douglas Gregor 0e8ff39dc7 Diagnose attempts to explicitly capture a __block variable in a lambda.
llvm-svn: 149458
2012-02-01 00:09:55 +00:00
Jim Grosbach 9fa0481569 Disable InstCombine unsafe folding bitcasts of calls w/ varargs.
Changing arguments from being passed as fixed to varargs is unsafe, as
the ABI may require they be handled differently (stack vs. register, for
example).

Remove two tests which rely on the bitcast being folded into the direct
call, which is exactly the transformation that's unsafe.

llvm-svn: 149457
2012-02-01 00:08:17 +00:00
Tobias Grosser ab1f7c4ee3 www: More typos
Pointed out by Chad Rosier

llvm-svn: 149456
2012-02-01 00:08:10 +00:00