9 years agobasic_filebuf needs to delay obtaining a codecvt facet from the global locale to...
Howard Hinnant [Fri, 24 Aug 2012 16:52:47 +0000 (16:52 +0000)]
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 llvm.org/bugs/show_bug.cgi?id=13663.

llvm-svn: 162567

9 years ago[asan/tsan] rename FunctionBlackList* to BlackList* as this class is not limited...
Kostya Serebryany [Fri, 24 Aug 2012 16:44:47 +0000 (16:44 +0000)]
[asan/tsan] rename FunctionBlackList* to BlackList* as this class is not limited to functions any more

llvm-svn: 162566

9 years ago[asan/tsan] extend the functionality of FunctionBlackList to globals and modules...
Kostya Serebryany [Fri, 24 Aug 2012 16:40:11 +0000 (16:40 +0000)]
[asan/tsan] extend the functionality of FunctionBlackList to globals and modules. Patch by Reid Watson.

llvm-svn: 162565

9 years ago[ms-inline asm] Generate the Input/Output expressions using
Chad Rosier [Fri, 24 Aug 2012 16:38:58 +0000 (16:38 +0000)]
[ms-inline asm] Generate the Input/Output expressions using

llvm-svn: 162564

9 years ago[analyzer] If we dereference a NULL that came from a function, show the return.
Jordan Rose [Fri, 24 Aug 2012 16:34:31 +0000 (16:34 +0000)]
[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.


llvm-svn: 162563

9 years agoLower constant pools and jump tables via TOC on PPC64/SVR4.
Roman Divacky [Fri, 24 Aug 2012 16:26:02 +0000 (16:26 +0000)]
Lower constant pools and jump tables via TOC on PPC64/SVR4.

In collaboration with Adhemerval Zanella.

llvm-svn: 162562

9 years agotsan: improve memory allocator a bit
Dmitry Vyukov [Fri, 24 Aug 2012 15:53:14 +0000 (15:53 +0000)]
tsan: improve memory allocator a bit

llvm-svn: 162561

9 years agoFix 80-column violation.
Chad Rosier [Fri, 24 Aug 2012 15:51:10 +0000 (15:51 +0000)]
Fix 80-column violation.

llvm-svn: 162560

9 years agoGVN: Fix quadratic runtime on the number of switch cases.
Benjamin Kramer [Fri, 24 Aug 2012 15:06:28 +0000 (15:06 +0000)]
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

9 years agoFix load/store SDNode flags.
Jakob Stoklund Olesen [Fri, 24 Aug 2012 14:43:30 +0000 (14:43 +0000)]
Fix load/store SDNode flags.

llvm-svn: 162558

9 years agoAdd missing SDNPSideEffect flags.
Jakob Stoklund Olesen [Fri, 24 Aug 2012 14:43:27 +0000 (14:43 +0000)]
Add missing SDNPSideEffect flags.

llvm-svn: 162557

9 years agoRemove more mayLoad workarounds.
Jakob Stoklund Olesen [Fri, 24 Aug 2012 14:43:22 +0000 (14:43 +0000)]
Remove more mayLoad workarounds.

llvm-svn: 162556

9 years agoPoCC: Simplify condition
Tobias Grosser [Fri, 24 Aug 2012 13:56:56 +0000 (13:56 +0000)]
PoCC: Simplify condition

llvm-svn: 162555

9 years agoSort includes
Tobias Grosser [Fri, 24 Aug 2012 13:54:40 +0000 (13:54 +0000)]
Sort includes

llvm-svn: 162554

9 years agoPoCC: Adapt to earlier vectorizer changes
Tobias Grosser [Fri, 24 Aug 2012 13:54:36 +0000 (13:54 +0000)]
PoCC: Adapt to earlier vectorizer changes

llvm-svn: 162553

9 years agoPush ArrayRef through the Expr hierarchy.
Benjamin Kramer [Fri, 24 Aug 2012 11:54:20 +0000 (11:54 +0000)]
Push ArrayRef through the Expr hierarchy.

No functionality change.

llvm-svn: 162552

9 years agoFix the definition of JSONAnchorSource. MSVC mangles variable symbols, and "volatile...
NAKAMURA Takumi [Fri, 24 Aug 2012 10:39:28 +0000 (10:39 +0000)]
Fix the definition of JSONAnchorSource. MSVC mangles variable symbols, and "volatile" affects.

llvm-svn: 162550

9 years agoTry to appease MSVC even more elaborately in the alignment hacking space.
Chandler Carruth [Fri, 24 Aug 2012 09:53:43 +0000 (09:53 +0000)]
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

9 years agoRevert the erroneous changes made to Makefile.old in r162547
Alexander Potapenko [Fri, 24 Aug 2012 09:31:53 +0000 (09:31 +0000)]
Revert the erroneous changes made to Makefile.old in r162547
Remove a spare newline from asan_rtl.cc

llvm-svn: 162548

9 years agoIf the program is linked to a dynamic ASan runtime which is not present in DYLD_INSER...
Alexander Potapenko [Fri, 24 Aug 2012 09:22:05 +0000 (09:22 +0000)]
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

llvm-svn: 162547

9 years agoAdd add_clang_runtime_shared_library() CMake function and use it to put the shared...
Alexander Potapenko [Fri, 24 Aug 2012 07:49:22 +0000 (07:49 +0000)]
Add add_clang_runtime_shared_library() CMake function and use it to put the shared ASan runtime in the appropriate place.

llvm-svn: 162546

9 years agoTeach CFG that 'if (x & 0)' and 'if (x * 0)' is an unfeasible branch.
Ted Kremenek [Fri, 24 Aug 2012 07:42:09 +0000 (07:42 +0000)]
Teach CFG that 'if (x & 0)' and 'if (x * 0)' is an unfeasible branch.

Fixes <rdar://problem/11005770>.

llvm-svn: 162545

9 years agoAllow RecursiveASTVisitor to visit CXXCtorInitializer objects for which
James Dennett [Fri, 24 Aug 2012 06:59:51 +0000 (06:59 +0000)]
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

9 years agoGo ahead and show experimental checkers in the scan-build "-h" output.
Ted Kremenek [Fri, 24 Aug 2012 06:49:34 +0000 (06:49 +0000)]
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

9 years agoRemove printf that go left in the code.
Greg Clayton [Fri, 24 Aug 2012 06:43:15 +0000 (06:43 +0000)]
Remove printf that go left in the code.

llvm-svn: 162542

9 years agoUse LLVM's plugin registry to enable registering new compilation
Daniel Jasper [Fri, 24 Aug 2012 05:50:27 +0000 (05:50 +0000)]
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

9 years agoThe OS plug-in can now get data from a python script that implements the protocol.
Greg Clayton [Fri, 24 Aug 2012 05:45:15 +0000 (05:45 +0000)]
The OS plug-in can now get data from a python script that implements the protocol.

llvm-svn: 162540

9 years agoChange AST matcher names to conform with the new naming.
Daniel Jasper [Fri, 24 Aug 2012 05:39:51 +0000 (05:39 +0000)]
Change AST matcher names to conform with the new naming.

llvm-svn: 162539

9 years agoRename the ASTMatchers to better match AST nodes. Now, all
Daniel Jasper [Fri, 24 Aug 2012 05:12:34 +0000 (05:12 +0000)]
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

9 years agoOn OS X, use xcrun (if present) to find the clang to use for static analysis if
Ted Kremenek [Fri, 24 Aug 2012 04:53:06 +0000 (04:53 +0000)]
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

9 years agoCustom lower FMA intrinsics to target specific nodes and remove the patterns.
Craig Topper [Fri, 24 Aug 2012 04:03:22 +0000 (04:03 +0000)]
Custom lower FMA intrinsics to target specific nodes and remove the patterns.

llvm-svn: 162534

9 years ago[analyzer] Fix realloc related bug in the malloc checker.
Anna Zaks [Fri, 24 Aug 2012 02:28:20 +0000 (02:28 +0000)]
[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

9 years agoWe have a partially working OS plug-in through python!
Greg Clayton [Fri, 24 Aug 2012 02:01:39 +0000 (02:01 +0000)]
We have a partially working OS plug-in through python!

llvm-svn: 162532

9 years agoFixing an issue in the OS sample
Enrico Granata [Fri, 24 Aug 2012 01:53:47 +0000 (01:53 +0000)]
Fixing an issue in the OS sample

llvm-svn: 162531

9 years agoAdded Args::StringForEncoding(), Args::StringToGenericRegister() and centralized...
Greg Clayton [Fri, 24 Aug 2012 01:42:50 +0000 (01:42 +0000)]
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

9 years ago[analyzer] Remove unnecessary code.
Anna Zaks [Fri, 24 Aug 2012 01:39:13 +0000 (01:39 +0000)]
[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

9 years ago[analyzer] Move DynamicTypeInfo out of the ProgramState.h
Anna Zaks [Fri, 24 Aug 2012 01:39:10 +0000 (01:39 +0000)]
[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

9 years agoFixing a bunch of issues with the OS plugin code
Enrico Granata [Fri, 24 Aug 2012 01:34:39 +0000 (01:34 +0000)]
Fixing a bunch of issues with the OS plugin code

llvm-svn: 162527

9 years agoUse DW_FORM_flag_present to save space in debug information if we're
Eric Christopher [Fri, 24 Aug 2012 01:14:27 +0000 (01:14 +0000)]
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

9 years agoAdd support for some missing DW_FORM_*.
Eric Christopher [Fri, 24 Aug 2012 01:14:23 +0000 (01:14 +0000)]
Add support for some missing DW_FORM_*.

TODO: Fix code duplication and coding style.
llvm-svn: 162525

9 years agoFormatting.
Eric Christopher [Fri, 24 Aug 2012 01:14:21 +0000 (01:14 +0000)]

llvm-svn: 162524

9 years agoNew -fcatch-undefined-behavior features:
Richard Smith [Fri, 24 Aug 2012 00:54:33 +0000 (00:54 +0000)]
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

9 years agoHooking up two more calls for the PythonOSPlugin stuff. The part of code to fetch...
Enrico Granata [Fri, 24 Aug 2012 00:51:29 +0000 (00:51 +0000)]
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

9 years agoUpdated LibTooling.html, minor improvements in CommonOptionsParser
Alexander Kornienko [Fri, 24 Aug 2012 00:39:14 +0000 (00:39 +0000)]
Updated LibTooling.html, minor improvements in CommonOptionsParser

llvm-svn: 162521

9 years agoFix undefined behavior (negation of INT_MIN) in ARM backend.
Richard Smith [Fri, 24 Aug 2012 00:35:46 +0000 (00:35 +0000)]
Fix undefined behavior (negation of INT_MIN) in ARM backend.

llvm-svn: 162520

9 years agoWas forcing everyone on ToT to use the PythonOSPlugin.. my bad
Enrico Granata [Fri, 24 Aug 2012 00:32:51 +0000 (00:32 +0000)]
Was forcing everyone on ToT to use the PythonOSPlugin.. my bad

llvm-svn: 162519

9 years agoFix floating-point divide by zero, in a case where the value was not going to be...
Richard Smith [Fri, 24 Aug 2012 00:31:45 +0000 (00:31 +0000)]
Fix floating-point divide by zero, in a case where the value was not going to be used anyway.

llvm-svn: 162518

9 years agoRemove some spurious mayLoad = 0 flags.
Jakob Stoklund Olesen [Fri, 24 Aug 2012 00:31:20 +0000 (00:31 +0000)]
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

9 years agoHeed guessInstructionProperties, and stop warning on redundant flags.
Jakob Stoklund Olesen [Fri, 24 Aug 2012 00:31:16 +0000 (00:31 +0000)]
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

9 years agoAdd missing SDNP properties on the flushw node.
Jakob Stoklund Olesen [Fri, 24 Aug 2012 00:31:13 +0000 (00:31 +0000)]
Add missing SDNP properties on the flushw node.

llvm-svn: 162515

9 years agoX86MemBarrier has unmodeled side effects.
Jakob Stoklund Olesen [Fri, 24 Aug 2012 00:31:10 +0000 (00:31 +0000)]
X86MemBarrier has unmodeled side effects.

llvm-svn: 162514

9 years agoAdding bindings to the Script Interpreter for some basic Python OS plugin functionali...
Enrico Granata [Fri, 24 Aug 2012 00:30:47 +0000 (00:30 +0000)]
Adding bindings to the Script Interpreter for some basic Python OS plugin functionality (still WIP)

llvm-svn: 162513

9 years agoDeclPrinter tests: mark test case we get wrong currently with WRONG.
Dmitri Gribenko [Fri, 24 Aug 2012 00:27:50 +0000 (00:27 +0000)]
DeclPrinter tests: mark test case we get wrong currently with WRONG.

llvm-svn: 162512

9 years agoDeclPrinter tests: add two more tests.
Dmitri Gribenko [Fri, 24 Aug 2012 00:26:25 +0000 (00:26 +0000)]
DeclPrinter tests: add two more tests.

llvm-svn: 162511

9 years agoFix a typo.
Johnny Chen [Fri, 24 Aug 2012 00:11:29 +0000 (00:11 +0000)]
Fix a typo.

llvm-svn: 162510

9 years ago[ms-inline asm] Add the basic APIs for Exprs to the MSAsmStmt AST. Next we need
Chad Rosier [Fri, 24 Aug 2012 00:07:09 +0000 (00:07 +0000)]
[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

9 years ago[analyzer] Make analyzer less aggressive when dealing with [self init].
Anna Zaks [Fri, 24 Aug 2012 00:06:12 +0000 (00:06 +0000)]
[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

9 years agoComment semantic analysis: treat function typedefs as functions so that one can
Dmitri Gribenko [Fri, 24 Aug 2012 00:05:30 +0000 (00:05 +0000)]
Comment semantic analysis: treat function typedefs as functions so that one can
use \param and \returns in documentation.

Fixes PR13533.

llvm-svn: 162507

9 years agoFix a few -Wdocumentation warnings.
Dmitri Gribenko [Fri, 24 Aug 2012 00:01:24 +0000 (00:01 +0000)]
Fix a few -Wdocumentation warnings.

llvm-svn: 162506

9 years agoFix undefined behavior (signed integer overflow) when Clang parses a hexfloat with...
Richard Smith [Fri, 24 Aug 2012 00:01:19 +0000 (00:01 +0000)]
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

9 years agoSwitch over to using object instances for all PythonData objects.
Greg Clayton [Thu, 23 Aug 2012 23:49:47 +0000 (23:49 +0000)]
Switch over to using object instances for all PythonData objects.

llvm-svn: 162504

9 years agoClarify the doc string for register-name a bit, add flags.
Jim Ingham [Thu, 23 Aug 2012 23:47:08 +0000 (23:47 +0000)]
Clarify the doc string for register-name a bit, add flags.

llvm-svn: 162503

9 years agoTake '--help' as well as '-h' as hint to emit the usage output.
Johnny Chen [Thu, 23 Aug 2012 23:45:26 +0000 (23:45 +0000)]
Take '--help' as well as '-h' as hint to emit the usage output.

llvm-svn: 162502

9 years agoNow that ASTMultiPtr is nothing more than a array reference, make it a MutableArrayRef.
Benjamin Kramer [Thu, 23 Aug 2012 23:38:35 +0000 (23:38 +0000)]
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

9 years agoDocument the generic register names in help for register-name.
Jim Ingham [Thu, 23 Aug 2012 23:37:31 +0000 (23:37 +0000)]
Document the generic register names in help for register-name.

llvm-svn: 162500

9 years agoFormatting cleanup.
Eric Christopher [Thu, 23 Aug 2012 23:26:57 +0000 (23:26 +0000)]
Formatting cleanup.

llvm-svn: 162499

9 years agoAdd an assert here in case parsing gave us a NULL compile unit.
Eric Christopher [Thu, 23 Aug 2012 23:21:11 +0000 (23:21 +0000)]
Add an assert here in case parsing gave us a NULL compile unit.

llvm-svn: 162498

9 years ago[scan-build] Accept -fno-objc-arc as well as -fobjc-arc.
Jordan Rose [Thu, 23 Aug 2012 23:16:34 +0000 (23:16 +0000)]
[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

9 years ago[analyzer] For now, treat pointers-to-members as non-null void * symbols.
Jordan Rose [Thu, 23 Aug 2012 23:01:43 +0000 (23:01 +0000)]
[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

9 years ago[analyzer] Handle UserDefinedConversion casts in C++.
Jordan Rose [Thu, 23 Aug 2012 23:01:39 +0000 (23:01 +0000)]
[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

9 years agoRemove the DW_AT_MIPS_linkage name attribute when we don't need it
Eric Christopher [Thu, 23 Aug 2012 22:52:55 +0000 (22:52 +0000)]
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

9 years agoRemove ASTOwningVector, it doesn't own anything and provides no value over SmallVector.
Benjamin Kramer [Thu, 23 Aug 2012 22:51:59 +0000 (22:51 +0000)]
Remove ASTOwningVector, it doesn't own anything and provides no value over SmallVector.

llvm-svn: 162492

9 years agoAttaching comments to decls: since it was decided that Decl::isImplicit should
Dmitri Gribenko [Thu, 23 Aug 2012 22:40:40 +0000 (22:40 +0000)]
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

9 years agoTurn these two options in to trinary state so that they can be
Eric Christopher [Thu, 23 Aug 2012 22:36:40 +0000 (22:36 +0000)]
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

9 years agoAdd a flag to DwarfDebug to allow it to communicate whether or not
Eric Christopher [Thu, 23 Aug 2012 22:36:36 +0000 (22:36 +0000)]
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

9 years agoPreserve operand flags in convertToThreeAddress() by copying operands.
Jakob Stoklund Olesen [Thu, 23 Aug 2012 22:36:31 +0000 (22:36 +0000)]
Preserve operand flags in convertToThreeAddress() by copying operands.

No test case, this is a generalization of r160260.

llvm-svn: 162485

9 years agoCope with the case where the user-supplied callbacks want the watchpoint itself to...
Johnny Chen [Thu, 23 Aug 2012 22:28:26 +0000 (22:28 +0000)]
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

9 years agoA first version of a bunch of classes that wrap commonly used Python objects in a...
Enrico Granata [Thu, 23 Aug 2012 22:02:23 +0000 (22:02 +0000)]
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

9 years ago[ms-inline asm] Add a few helper function to the MSAsmStmt class that are needed
Chad Rosier [Thu, 23 Aug 2012 21:55:11 +0000 (21:55 +0000)]
[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

9 years agoRip out remnants of move semantic emulation and smart pointers in Sema.
Benjamin Kramer [Thu, 23 Aug 2012 21:35:17 +0000 (21:35 +0000)]
Rip out remnants of move semantic emulation and smart pointers in Sema.

These were nops for quite a while and only lead to confusion. ASTMultiPtr
now behaves like a proper dumb array reference.

llvm-svn: 162475

9 years agoAdded a hollowed out version of an OperatingSystem plugin that will use a class in...
Greg Clayton [Thu, 23 Aug 2012 21:17:11 +0000 (21:17 +0000)]
Added a hollowed out version of an OperatingSystem plugin that will use a class in python to get thread information for threads stored in memory.

llvm-svn: 162472

9 years agoAdded a method to DeclContext that marks the
Sean Callanan [Thu, 23 Aug 2012 21:16:40 +0000 (21:16 +0000)]
Added a method to DeclContext that marks the
lookup table as needing to be built.

This is required for LLDB, which provides the
contents of many DeclContexts through a custom

llvm-svn: 162471

9 years agogdb format should default to count of 1.
Jim Ingham [Thu, 23 Aug 2012 21:16:25 +0000 (21:16 +0000)]
gdb format should default to count of 1.

llvm-svn: 162470

9 years agoChange a bunch of cases where we do "getAs<...>->doSomething()" to
Ted Kremenek [Thu, 23 Aug 2012 20:46:57 +0000 (20:46 +0000)]
Change a bunch of cases where we do "getAs<...>->doSomething()" to
"castAs<...>->doSomething()".  The analyzer was flagging these
as potential null dereferences, which is technically true.  The
invariants appear to be that these casts should never fail, so
let's use castAs<> instead and avoid a runtime check.

llvm-svn: 162468

9 years agoMake the substring un-matching more robust.
Johnny Chen [Thu, 23 Aug 2012 20:25:04 +0000 (20:25 +0000)]
Make the substring un-matching more robust.

llvm-svn: 162467

9 years agoMake a test scenario stronger, since, by default, the setting interpreter.expand...
Johnny Chen [Thu, 23 Aug 2012 20:22:16 +0000 (20:22 +0000)]
Make a test scenario stronger, since, by default, the setting interpreter.expand-regex-aliases is false.

llvm-svn: 162465

9 years agoWhen disambiguating an expression-statement from a declaraton-statement, if the
Richard Smith [Thu, 23 Aug 2012 20:19:14 +0000 (20:19 +0000)]
When disambiguating an expression-statement from a declaraton-statement, if the
statement starts with an identifier for which name lookup will fail either way,
look at later tokens to disambiguate in order to improve error recovery.

llvm-svn: 162464

9 years ago[ms-inline asm] Remove an unused argument. This logic can now be reused by the
Chad Rosier [Thu, 23 Aug 2012 20:00:18 +0000 (20:00 +0000)]
[ms-inline asm] Remove an unused argument.  This logic can now be reused by the
ms-style inline asms.

llvm-svn: 162463

9 years agoFix the test suite failures as a result of r162418 check-in.
Johnny Chen [Thu, 23 Aug 2012 19:36:03 +0000 (19:36 +0000)]
Fix the test suite failures as a result of r162418 check-in.

llvm-svn: 162462

9 years agoTristate mayLoad, mayStore, and hasSideEffects.
Jakob Stoklund Olesen [Thu, 23 Aug 2012 19:34:46 +0000 (19:34 +0000)]
Tristate mayLoad, mayStore, and hasSideEffects.

Keep track of the set/unset state of these bits along with their
true/false values, but treat '?' as '0' for now.

llvm-svn: 162461

9 years agoAdd CodeGenTarget::guessInstructionProperties.
Jakob Stoklund Olesen [Thu, 23 Aug 2012 19:34:41 +0000 (19:34 +0000)]
Add CodeGenTarget::guessInstructionProperties.

Currently, TableGen just guesses instruction properties when it can't
infer them form patterns.

This adds a guessInstructionProperties flag to the instruction set
definition that will be used to disable guessing. The flag is intended
as a migration aid. It will be removed again when no more targets need
their properties guessed.

llvm-svn: 162460

9 years agoFix attributes on X86 store intrinsics.
Jakob Stoklund Olesen [Thu, 23 Aug 2012 19:21:38 +0000 (19:21 +0000)]
Fix attributes on X86 store intrinsics.

These intrinsics don't have unmodeled side effects, they are just

llvm-svn: 162459

9 years agoFix a stub signature. HeuristicReduce should return a bool.
Lang Hames [Thu, 23 Aug 2012 19:06:23 +0000 (19:06 +0000)]
Fix a stub signature. HeuristicReduce should return a bool.

This should fix a -Wdocumentation warning.

llvm-svn: 162458

9 years agotsan: allow to override per-thread event trace size
Dmitry Vyukov [Thu, 23 Aug 2012 18:26:03 +0000 (18:26 +0000)]
tsan: allow to override per-thread event trace size
useful if you don't see the second stack trace

llvm-svn: 162456

9 years agoFavor FMA3 over FMA4 if both are enabled.
Craig Topper [Thu, 23 Aug 2012 18:14:30 +0000 (18:14 +0000)]
Favor FMA3 over FMA4 if both are enabled.

llvm-svn: 162454

9 years ago[analyzer] Support C++ default arguments if they are literal values.
Jordan Rose [Thu, 23 Aug 2012 18:10:53 +0000 (18:10 +0000)]
[analyzer] Support C++ default arguments if they are literal values.

A CXXDefaultArgExpr wraps an Expr owned by a ParmVarDecl belonging to the
called function. In general, ExprEngine and Environment ought to treat this
like a ParenExpr or other transparent wrapper expression, with the inside
expression evaluated first.

However, if we call the same function twice, we'd produce a CFG that contains
the same wrapped expression twice, and we're not set up to handle that. I've
added a FIXME to the CFG builder to come back to that, but meanwhile we can
at least handle expressions that don't need to be explicitly evaluated:
literals. This probably handles many common uses of default parameters:
true/false, null, etc.

Part of PR13385 / <rdar://problem/12156507>

llvm-svn: 162453

9 years agoFix a bunch of -Wdocumentation warnings.
Dmitri Gribenko [Thu, 23 Aug 2012 17:58:28 +0000 (17:58 +0000)]
Fix a bunch of -Wdocumentation warnings.

llvm-svn: 162452

9 years agotsan: fix new memory allocator
Dmitry Vyukov [Thu, 23 Aug 2012 17:16:07 +0000 (17:16 +0000)]
tsan: fix new memory allocator
Deallocate: drain blocks to central cache if cached too much (instead of never drain).
Allocate: batch allocate fixed amount of blocks (instead of all blocks).
This significantly reduces memory consumption of large heavy-multithreaded programs.

llvm-svn: 162447

9 years agoFix a bunch of -Wdocumentation warnings.
Dmitri Gribenko [Thu, 23 Aug 2012 16:54:08 +0000 (16:54 +0000)]
Fix a bunch of -Wdocumentation warnings.

llvm-svn: 162446

9 years ago[ms-inline asm] Rename a few induction variables to avoid confusion and silence
Chad Rosier [Thu, 23 Aug 2012 15:44:35 +0000 (15:44 +0000)]
[ms-inline asm] Rename a few induction variables to avoid confusion and silence
a gcc warning.

llvm-svn: 162444