Commit Graph

132635 Commits

Author SHA1 Message Date
Chad Rosier 0f8487c632 Fix 80-column violation.
llvm-svn: 162575
2012-08-24 18:31:16 +00:00
Sean Callanan 6efc2ba7f8 Changed register ValueObjects to report their
expression path in a way that can actually be
resolved by "expr".

llvm-svn: 162574
2012-08-24 18:21:05 +00:00
Johnny Chen 6d675243b4 rdar://problem/11811338
Add 'attach <pid>|<process-name>' command to lldb, as well as 'detach' which is an alias of 'process detach'.
Add two completion test cases for "attach" and "detach".

llvm-svn: 162573
2012-08-24 18:15:45 +00:00
Manman Ren cf10446ffa BranchProb: modify the definition of an edge in BranchProbabilityInfo to handle
the case of multiple edges from one block to another.

A simple example is a switch statement with multiple values to the same
destination. The definition of an edge is modified from a pair of blocks to
a pair of PredBlock and an index into the successors.

Also set the weight correctly when building SelectionDAG from LLVM IR,
especially when converting a Switch.
IntegersSubsetMapping is updated to calculate the weight for each cluster.

llvm-svn: 162572
2012-08-24 18:14:27 +00:00
Howard Hinnant 45c03a8f8d Fixed order of calling use_facet vs setbuf in basic_filebuf default constructor.
llvm-svn: 162571
2012-08-24 18:06:47 +00:00
Dmitri Gribenko 219bd1554f Comment diagnostics: for unresolved parameters, do not suggest parameter fixit
with parameter that is documented.

Fixes PR13670, <rdar://problem/12155840>.

llvm-svn: 162570
2012-08-24 17:45:39 +00:00
Jakob Stoklund Olesen 8a276c26bd Verify explicit instruction properties when they can be inferred.
It is now allowed to explicitly set hasSideEffects, mayStore, and
mayLoad on instructions with patterns.

Verify that the patterns are consistent with the explicit flags.

llvm-svn: 162569
2012-08-24 17:08:41 +00:00
Chad Rosier 14836bab36 [ms-inline asm] Refactor code. No functional change intended.
llvm-svn: 162568
2012-08-24 17:05:45 +00:00
Howard Hinnant cc27317a62 basic_filebuf needs to delay obtaining a codecvt facet from the global locale to give the client a chance to imbue the proper locale. Fixes http://llvm.org/bugs/show_bug.cgi?id=13663.
llvm-svn: 162567
2012-08-24 16:52:47 +00:00
Kostya Serebryany 4cc511daf0 [asan/tsan] rename FunctionBlackList* to BlackList* as this class is not limited to functions any more
llvm-svn: 162566
2012-08-24 16:44:47 +00:00
Kostya Serebryany 36dfc5ceab [asan/tsan] extend the functionality of FunctionBlackList to globals and modules. Patch by Reid Watson.
llvm-svn: 162565
2012-08-24 16:40:11 +00:00
Chad Rosier 1e17cf9c22 [ms-inline asm] Generate the Input/Output expressions using
Sema::ActOnIdExpression().

llvm-svn: 162564
2012-08-24 16:38:58 +00:00
Jordan Rose 51c27163c0 [analyzer] If we dereference a NULL that came from a function, show the return.
More generally, any time we try to track where a null value came from, we
should show if it came from a function. This usually isn't necessary if
the value is symbolic, but if the value is just a constant we previously
just ignored its origin entirely. Now, we'll step into the function and
recursively add a visitor to the returned expression.

<rdar://problem/12114609>

llvm-svn: 162563
2012-08-24 16:34:31 +00:00
Roman Divacky ace4707ea6 Lower constant pools and jump tables via TOC on PPC64/SVR4.
In collaboration with Adhemerval Zanella.

llvm-svn: 162562
2012-08-24 16:26:02 +00:00
Dmitry Vyukov 7d3d94454c tsan: improve memory allocator a bit
llvm-svn: 162561
2012-08-24 15:53:14 +00:00
Chad Rosier ab24b6e24e Fix 80-column violation.
llvm-svn: 162560
2012-08-24 15:51:10 +00:00
Benjamin Kramer dd62d6b6c8 GVN: Fix quadratic runtime on the number of switch cases.
No intended behavior change.  This was introduced in r162023.  With the fixed
algorithm a Release build of ARMInstPrinter.cpp goes from 16s to 10s on a
2011 MBP.

llvm-svn: 162559
2012-08-24 15:06:28 +00:00
Jakob Stoklund Olesen 3ac45d9a1f Fix load/store SDNode flags.
llvm-svn: 162558
2012-08-24 14:43:30 +00:00
Jakob Stoklund Olesen a954e92053 Add missing SDNPSideEffect flags.
llvm-svn: 162557
2012-08-24 14:43:27 +00:00
Jakob Stoklund Olesen 8ff666fcb6 Remove more mayLoad workarounds.
llvm-svn: 162556
2012-08-24 14:43:22 +00:00
Tobias Grosser 6f9465591e PoCC: Simplify condition
llvm-svn: 162555
2012-08-24 13:56:56 +00:00
Tobias Grosser 4a67e01216 Sort includes
llvm-svn: 162554
2012-08-24 13:54:40 +00:00
Tobias Grosser c8fc2d7045 PoCC: Adapt to earlier vectorizer changes
llvm-svn: 162553
2012-08-24 13:54:36 +00:00
Benjamin Kramer c215e76f78 Push ArrayRef through the Expr hierarchy.
No functionality change.

llvm-svn: 162552
2012-08-24 11:54:20 +00:00
NAKAMURA Takumi d574ac2f4d Fix the definition of JSONAnchorSource. MSVC mangles variable symbols, and "volatile" affects.
llvm-svn: 162550
2012-08-24 10:39:28 +00:00
Chandler Carruth 387ffe7d4b Try to appease MSVC even more elaborately in the alignment hacking space.
MSVC doesn't support passing by-value parameters with alignment of
16-bytes or higher apparantly. What is deeply confusing is that it seems
to *sometimes* (but not always) apply this to any type whose alignment
is set using __declspec(align(...)). This caused lots of errors when we switch
SmallVector over to use the automatically aligned character array
utilities as they used __declspec(align(...)) heavily.

As a pretty horrible but effective work-around, we instead cherry pick
the smallest alignment sizes with specific types that happen to have the
correct alignment, and then fall back to the attribute solution past
them. This should resolve the MSVC build errors folks have been hitting.
Sorry for that. In good news, it will do this without introducing other
UB I hope. =]

Thanks to Timur Iskhodzhanov for helping me test this!

llvm-svn: 162549
2012-08-24 09:53:43 +00:00
Alexander Potapenko 00492cab3e Revert the erroneous changes made to Makefile.old in r162547
Remove a spare newline from asan_rtl.cc

llvm-svn: 162548
2012-08-24 09:31:53 +00:00
Alexander Potapenko fefc1e989c If the program is linked to a dynamic ASan runtime which is not present in DYLD_INSERT_LIBRARIES
(which, in turn, is required for our interceptors to take effect), re-exec the program with
DYLD_INSERT_LIBRARIES set.

llvm-svn: 162547
2012-08-24 09:22:05 +00:00
Alexander Potapenko d79d80b4a0 Add add_clang_runtime_shared_library() CMake function and use it to put the shared ASan runtime in the appropriate place.
llvm-svn: 162546
2012-08-24 07:49:22 +00:00
Ted Kremenek 64fea5fc8f Teach CFG that 'if (x & 0)' and 'if (x * 0)' is an unfeasible branch.
Fixes <rdar://problem/11005770>.

llvm-svn: 162545
2012-08-24 07:42:09 +00:00
James Dennett 75c100b8e5 Allow RecursiveASTVisitor to visit CXXCtorInitializer objects for which
isWritten() returns false, if shouldVisitImplicitCode() returns true.
Previously those CXXCtorInitializers were always skipped.

In order to make this change easier to test, this patch also extends the
test class template ExpectedLocationVisitor to support arbitrary numbers
of expected matches and disallowed matches.

llvm-svn: 162544
2012-08-24 06:59:51 +00:00
Ted Kremenek b5e409fd20 Go ahead and show experimental checkers in the scan-build "-h" output.
They are labeled as not being enabled-by-default, and how else
are users going to test them.

Fixes <rdar://problem/11654923>

llvm-svn: 162543
2012-08-24 06:49:34 +00:00
Greg Clayton bc38679b07 Remove printf that go left in the code.
llvm-svn: 162542
2012-08-24 06:43:15 +00:00
Daniel Jasper 6ed1f85c24 Use LLVM's plugin registry to enable registering new compilation
databases. Move JSONCompilationDatabase.h to its own files and
register it as plugin.

llvm-svn: 162541
2012-08-24 05:50:27 +00:00
Greg Clayton 435ce13937 The OS plug-in can now get data from a python script that implements the protocol.
llvm-svn: 162540
2012-08-24 05:45:15 +00:00
Daniel Jasper 98e00797cd Change AST matcher names to conform with the new naming.
llvm-svn: 162539
2012-08-24 05:39:51 +00:00
Daniel Jasper bd3d76d90c Rename the ASTMatchers to better match AST nodes. Now, all
ASTMatchers have the same name as the corresponding AST nodes
but are lower case. The only exceptions are the "CXX" prefixes
which are not copied over to the matcher names as the goal is to
actually remove these prefixes from the AST node names.

llvm-svn: 162536
2012-08-24 05:12:34 +00:00
Ted Kremenek af592eef7b On OS X, use xcrun (if present) to find the clang to use for static analysis if
no clang can be found relative to the location of scan-build.

Fixes <rdar://problem/11691794>

llvm-svn: 162535
2012-08-24 04:53:06 +00:00
Craig Topper 663d160adb Custom lower FMA intrinsics to target specific nodes and remove the patterns.
llvm-svn: 162534
2012-08-24 04:03:22 +00:00
Anna Zaks fe6eb67b12 [analyzer] Fix realloc related bug in the malloc checker.
When reallocation of a non-allocated (not owned) symbol fails do not
expect it to be freed.

llvm-svn: 162533
2012-08-24 02:28:20 +00:00
Greg Clayton a83b6cf244 We have a partially working OS plug-in through python!
llvm-svn: 162532
2012-08-24 02:01:39 +00:00
Enrico Granata b710b8db3d Fixing an issue in the OS sample
llvm-svn: 162531
2012-08-24 01:53:47 +00:00
Greg Clayton 2443cbd7f5 Added Args::StringForEncoding(), Args::StringToGenericRegister() and centralized the parsing of the string to encoding and string to generic register.
Added code the initialize the register context in the OperatingSystemPython plug-in with the new PythonData classes, and added a test OperatingSystemPython module in lldb/examples/python/operating_system.py that we can use for testing.

llvm-svn: 162530
2012-08-24 01:42:50 +00:00
Anna Zaks 6fb4b055fb [analyzer] Remove unnecessary code.
This code has been added a while ago and removing it does not trigger
any test failures. The false positives it was trying to suppress are
probably handled by other logic (ex: special handling of delegates).

llvm-svn: 162529
2012-08-24 01:39:13 +00:00
Anna Zaks 5e52c2862a [analyzer] Move DynamicTypeInfo out of the ProgramState.h
(I am not sure if we should move the setters and getters as well and
make them into static methods..)

llvm-svn: 162528
2012-08-24 01:39:10 +00:00
Enrico Granata 4300fab2d4 Fixing a bunch of issues with the OS plugin code
llvm-svn: 162527
2012-08-24 01:34:39 +00:00
Eric Christopher bb69a27dbc Use DW_FORM_flag_present to save space in debug information if we're
not in darwin gdb compat mode.

Fixes rdar://10975088

llvm-svn: 162526
2012-08-24 01:14:27 +00:00
Eric Christopher d999bb7ff4 Add support for some missing DW_FORM_*.
TODO: Fix code duplication and coding style.
llvm-svn: 162525
2012-08-24 01:14:23 +00:00
Eric Christopher 67942acc6b Formatting.
llvm-svn: 162524
2012-08-24 01:14:21 +00:00
Richard Smith 69d0d2626a New -fcatch-undefined-behavior features:
* when checking that a pointer or reference refers to appropriate storage for a type, also check the alignment and perform a null check
 * check that references are bound to appropriate storage
 * check that 'this' has appropriate storage in member accesses and member function calls

llvm-svn: 162523
2012-08-24 00:54:33 +00:00