Commit Graph

132398 Commits

Author SHA1 Message Date
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
Enrico Granata 6167ab2819 Hooking up two more calls for the PythonOSPlugin stuff. The part of code to fetch the data and convert it to C++ objects is still missing, but will come
llvm-svn: 162522
2012-08-24 00:51:29 +00:00
Alexander Kornienko 4bcd58b87d Updated LibTooling.html, minor improvements in CommonOptionsParser
llvm-svn: 162521
2012-08-24 00:39:14 +00:00
Richard Smith f3c75f7e7c Fix undefined behavior (negation of INT_MIN) in ARM backend.
llvm-svn: 162520
2012-08-24 00:35:46 +00:00
Enrico Granata 051c60caad Was forcing everyone on ToT to use the PythonOSPlugin.. my bad
llvm-svn: 162519
2012-08-24 00:32:51 +00:00
Richard Smith c621af1f60 Fix floating-point divide by zero, in a case where the value was not going to be used anyway.
llvm-svn: 162518
2012-08-24 00:31:45 +00:00
Jakob Stoklund Olesen d3511235d1 Remove some spurious mayLoad = 0 flags.
They were inserted to silence TableGen's warning about
redundant properties. That warning is now gone.

llvm-svn: 162517
2012-08-24 00:31:20 +00:00
Jakob Stoklund Olesen 94ed4d42f8 Heed guessInstructionProperties, and stop warning on redundant flags.
Emit TableGen errors if guessInstructionProperties is 0 and
instruction properties can't be inferred from patterns.

Allow explicit instruction properties even when they can be inferred.

This patch doesn't change the TableGen output. Redundant properties
are not yet verified because the tree has errors.

llvm-svn: 162516
2012-08-24 00:31:16 +00:00
Jakob Stoklund Olesen acf7c47e64 Add missing SDNP properties on the flushw node.
llvm-svn: 162515
2012-08-24 00:31:13 +00:00
Jakob Stoklund Olesen df1faa0503 X86MemBarrier has unmodeled side effects.
llvm-svn: 162514
2012-08-24 00:31:10 +00:00
Enrico Granata 5790759a06 Adding bindings to the Script Interpreter for some basic Python OS plugin functionality (still WIP)
llvm-svn: 162513
2012-08-24 00:30:47 +00:00
Dmitri Gribenko def829ee86 DeclPrinter tests: mark test case we get wrong currently with WRONG.
llvm-svn: 162512
2012-08-24 00:27:50 +00:00
Dmitri Gribenko 340c0f6776 DeclPrinter tests: add two more tests.
llvm-svn: 162511
2012-08-24 00:26:25 +00:00
Johnny Chen 260808c583 Fix a typo.
llvm-svn: 162510
2012-08-24 00:11:29 +00:00
Chad Rosier fe31e626ca [ms-inline asm] Add the basic APIs for Exprs to the MSAsmStmt AST. Next we need
generate the Input/Output expressions using Sema::ActOnIdExpression().

llvm-svn: 162509
2012-08-24 00:07:09 +00:00
Anna Zaks 3d5d3d3e2c [analyzer] Make analyzer less aggressive when dealing with [self init].
With inlining, retain count checker starts tracking 'self' through the
init methods. The analyser results were too noisy if the developer
did not follow 'self = [super init]' pattern (which is common
especially in older code bases) - we reported self init anti-pattern AND
possible use-after-free. This patch teaches the retain count
checker to assume that [super init] does not fail when it's not consumed
by another expression. This silences the retain count warning that warns
about possibility of use-after-free when init fails, while preserving
all the other checking on 'self'.

llvm-svn: 162508
2012-08-24 00:06:12 +00:00
Dmitri Gribenko 907f6b8c06 Comment semantic analysis: treat function typedefs as functions so that one can
use \param and \returns in documentation.

Fixes PR13533.

llvm-svn: 162507
2012-08-24 00:05:30 +00:00
Dmitri Gribenko dd28e7930c Fix a few -Wdocumentation warnings.
llvm-svn: 162506
2012-08-24 00:01:24 +00:00
Richard Smith 156d92037a Fix undefined behavior (signed integer overflow) when Clang parses a hexfloat with an enormous exponent. Caught by an existing unit test + -ftrapv.
llvm-svn: 162505
2012-08-24 00:01:19 +00:00
Greg Clayton 281d7998b8 Switch over to using object instances for all PythonData objects.
llvm-svn: 162504
2012-08-23 23:49:47 +00:00
Jim Ingham 84c7bd7406 Clarify the doc string for register-name a bit, add flags.
llvm-svn: 162503
2012-08-23 23:47:08 +00:00
Johnny Chen 039330c292 Take '--help' as well as '-h' as hint to emit the usage output.
llvm-svn: 162502
2012-08-23 23:45:26 +00:00
Benjamin Kramer cc4c49dd63 Now that ASTMultiPtr is nothing more than a array reference, make it a MutableArrayRef.
This required changing all get() calls to data() and using the simpler constructors.

llvm-svn: 162501
2012-08-23 23:38:35 +00:00
Jim Ingham 931e674a58 Document the generic register names in help for register-name.
llvm-svn: 162500
2012-08-23 23:37:31 +00:00
Eric Christopher 20b897b693 Formatting cleanup.
llvm-svn: 162499
2012-08-23 23:26:57 +00:00
Eric Christopher 9142ea7bec Add an assert here in case parsing gave us a NULL compile unit.
llvm-svn: 162498
2012-08-23 23:21:11 +00:00
Jordan Rose 060b163801 [scan-build] Accept -fno-objc-arc as well as -fobjc-arc.
This is how Xcode lets individual files be marked as non-ARC when the rest
of the project is ARC-enabled, so this is necessary for scan-build xcodebuild.

Patch by Paul Eipper!

llvm-svn: 162497
2012-08-23 23:16:34 +00:00
Jordan Rose 434f132060 [analyzer] For now, treat pointers-to-members as non-null void * symbols.
Until we have full support for pointers-to-members, we can at least
approximate some of their use by tracking null and non-null values.
We thus treat &A::m_ptr as a non-null void * symbol, and MemberPointer(0)
as a pointer-sized null constant.

This enables support for what is sometimes called the "safe bool" idiom,
demonstrated in the test case.

llvm-svn: 162495
2012-08-23 23:01:43 +00:00
Jordan Rose 081af085eb [analyzer] Handle UserDefinedConversion casts in C++.
This is trivial; the UserDefinedConversion always wraps a CXXMemberCallExpr
for the appropriate conversion function, so it's just a matter of
propagating that value to the CastExpr itself.

llvm-svn: 162494
2012-08-23 23:01:39 +00:00
Eric Christopher acb7115bde Remove the DW_AT_MIPS_linkage name attribute when we don't need it
output (we're emitting a specification already and the information
isn't changing) and we're not in old gdb compat mode.

Saves 1% on the debug information for a build of llvm.

Fixes rdar://11043421

llvm-svn: 162493
2012-08-23 22:52:55 +00:00
Benjamin Kramer f062343889 Remove ASTOwningVector, it doesn't own anything and provides no value over SmallVector.
llvm-svn: 162492
2012-08-23 22:51:59 +00:00
Dmitri Gribenko 91bbf41914 Attaching comments to decls: since it was decided that Decl::isImplicit should
not be set for implicit instantiations, remove the FIXME.  This should be the
last bit for PR13634.  The actual fix happened in r162238.

Motivation: it might be misleading to mark implicit instantiations as
Decl::isImplicit = true.  Because then, in order to be consistent, we should
mark all instantiated members as implicit.  But the user did actually type the
declaration for the member, but the compiler played with it a little bit.

llvm-svn: 162488
2012-08-23 22:40:40 +00:00
Eric Christopher 20b76a77c3 Turn these two options in to trinary state so that they can be
turned on and off separate from the platform if you're on darwin.

llvm-svn: 162487
2012-08-23 22:36:40 +00:00
Eric Christopher 4977f214d7 Add a flag to DwarfDebug to allow it to communicate whether or not
we're using the darwin old gdb compat mode for emitting dwarf.

llvm-svn: 162486
2012-08-23 22:36:36 +00:00
Jakob Stoklund Olesen 7030427623 Preserve operand flags in convertToThreeAddress() by copying operands.
No test case, this is a generalization of r160260.

llvm-svn: 162485
2012-08-23 22:36:31 +00:00
Johnny Chen 892943f9dd Cope with the case where the user-supplied callbacks want the watchpoint itself to be disabled!
Previously we put a WatchpointSentry object within StopInfo.cpp to disable-and-then-enable the watchpoint itself
while we are performing the actions associated with the triggered watchpoint, which can cause the user-initiated
watchpoint disabling action to be negated.

Add a test case to verify that a watchpoint can be disabled during the callbacks.

llvm-svn: 162483
2012-08-23 22:28:26 +00:00
Enrico Granata 0845a1a077 A first version of a bunch of classes that wrap commonly used Python objects in a ref-counting and type-safe C++ API
llvm-svn: 162481
2012-08-23 22:02:23 +00:00
Chad Rosier 2f7c451ae5 [ms-inline asm] Add a few helper function to the MSAsmStmt class that are needed
by CodeGen.

In the long-term, much of the codegen logic will be shared between the GNU-style
and MS-style inline assembly, but for now I'm replicating this logic to avoid
regressions with the GNU-style.

llvm-svn: 162478
2012-08-23 21:55:11 +00:00