Commit Graph

121515 Commits

Author SHA1 Message Date
Howard Hinnant 30025116de Changed a TODO to a 'maybe some time in the future'.
llvm-svn: 149539
2012-02-01 21:12:07 +00:00
Howard Hinnant 8030b7f751 Removed DEBUG statements.
llvm-svn: 149538
2012-02-01 21:08:30 +00:00
Howard Hinnant 089123e65f Remove a TODO regarding where some can_catch are implemented. I opted to make can_catch pure virtual in the top __shim_type_info, and have each sub-class implement its own. There are some repeated definitions, but they are trivial.
llvm-svn: 149537
2012-02-01 21:06:46 +00:00
Howard Hinnant c325fa7705 Add some tests to test catching nullptr with pointers and member pointers. Tests are only activated if #if __has_feature(cxx_nullptr).
llvm-svn: 149536
2012-02-01 21:01:52 +00:00
Douglas Gregor 2e15c844a5 Make sure that imported definitions get completed before we add
anything into the corresponding DeclContext. Co-hacked with Sean;
fixes <rdar://problem/10768928>.

llvm-svn: 149535
2012-02-01 21:00:38 +00:00
Howard Hinnant 2d6810fbd6 Quash a TODO related to catching pointer-to-member. These tests fail on my copy of gcc-4.2. But I believe the tests to be correct (and they pass for libc++abi). I've enquired on the C++ standards mailing list for a clarification in case I'm wrong. So far I've gotten one response that agrees with me.
llvm-svn: 149534
2012-02-01 20:53:21 +00:00
Benjamin Kramer 72e6ce5aa9 libclang: Mark clang_Cursor_isNull with CINDEX_LINKAGE to make it available on windows.
Patch by Timothy J Fontaine!

llvm-svn: 149533
2012-02-01 20:37:28 +00:00
Argyrios Kyrtzidis 38bacf3429 [libclang] Make sure we don't ever leave a StoredDiagnostic associated with
a SourceManager that has already been deleted, rdar://10768346.

llvm-svn: 149532
2012-02-01 19:54:02 +00:00
Douglas Gregor c48190c10a Add missing dependency to unbreak the CMake build
llvm-svn: 149531
2012-02-01 19:53:01 +00:00
Howard Hinnant a21f8c2acf Quash TODO regarding catch by function type. Add tests to back it up.
llvm-svn: 149530
2012-02-01 19:42:45 +00:00
Johnny Chen ccfa90a5fe Fix indentation.
llvm-svn: 149529
2012-02-01 19:35:55 +00:00
Howard Hinnant 26ffb64177 Quash TODO regarding catch by array type. Add tests to back it up.
llvm-svn: 149527
2012-02-01 19:21:28 +00:00
David Chisnall af066bbb1f size() == 0 -> empty().
Spotted by rjmcall.

llvm-svn: 149526
2012-02-01 19:16:56 +00:00
Anna Zaks 7aba6368fa [analyzer] Fix a crash in CheckerContext::isCLibraryFunction for C++
declarations with special names.

A patch by Dmitri Gribenko.

llvm-svn: 149525
2012-02-01 19:16:20 +00:00
Anna Zaks 314cd09b5c Add a new compiler warning, which flags anti-patterns used as the size
argument in strncat.

The warning is ignored by default since it needs more qualification. 

TODO: The warning message and the note are messy when
strncat is a builtin due to the macro expansion.

llvm-svn: 149524
2012-02-01 19:08:57 +00:00
Johnny Chen fdad6794ac Add const-ness to BreakpointLocation::IsEnabled().
llvm-svn: 149523
2012-02-01 19:05:20 +00:00
Howard Hinnant 69a10f466b Removing a TODO: can_catch is fundamentally different than search_above_dst. can_catch is looking for an unamiguous public base class of a specific type, but at any address. search_above_dst is looking for an unambiguous public base class of a specific type, *and* at a specific address. Additionally can_catch is run for all types. search_above_dst is only run on class types. So these are only superficially similar. Not similar enough for resuse, at least without making the code unreadable.
llvm-svn: 149522
2012-02-01 18:52:35 +00:00
Chad Rosier e273cb08c4 Tidy up.
llvm-svn: 149521
2012-02-01 18:45:51 +00:00
Howard Hinnant d0bfbb336f Teach exception_cleanup_func about dependent exceptions.
llvm-svn: 149520
2012-02-01 18:44:21 +00:00
Johnny Chen 3cfb9c672c Add @expectedFailure decorators.
llvm-svn: 149519
2012-02-01 18:26:25 +00:00
Howard Hinnant 8aa78517ab Treat all exceptions except that the ones that this library throws as foreign. Even other C++ exceptions.
llvm-svn: 149518
2012-02-01 18:15:15 +00:00
Douglas Gregor 6b8ef34f84 Diagnose the restriction on default arguments in C++11 [expr.prim.lambda]p5.
llvm-svn: 149517
2012-02-01 17:18:19 +00:00
Douglas Gregor cdd11d4e7e Introduce the lambda scope before determining explicit captures, which
cleans up and improves a few things:
  - We get rid of the ugly dance of computing all of the captures in
  data structures that clone those of CapturingScopeInfo, centralizing
  the logic for accessing/updating these data structures
  - We re-use the existing capture logic for 'this', which actually
  works now.

Cleaned up some diagnostic wording in minor ways as well.

llvm-svn: 149516
2012-02-01 17:04:21 +00:00
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