platform/upstream/llvm.git
11 years agoChange getX86SubSuperRegister to take an MVT::SimpleValueType rather than an EVT...
Craig Topper [Sun, 30 Sep 2012 19:49:56 +0000 (19:49 +0000)]
Change getX86SubSuperRegister to take an MVT::SimpleValueType rather than an EVT and add llvm_unreachable to the switches. Helps it compile to dramatically better code.

llvm-svn: 164919

11 years agoArgumentPromotion: Remove ancient workaround for a bug in the C backend.
Benjamin Kramer [Sun, 30 Sep 2012 17:31:56 +0000 (17:31 +0000)]
ArgumentPromotion: Remove ancient workaround for a bug in the C backend.

Fun fact: The CBE learned how to deal with this situation before it was removed.

llvm-svn: 164918

11 years agoCodeGen: Copy tail padding when we're not dealing with a trivial copy assign or move...
Benjamin Kramer [Sun, 30 Sep 2012 12:43:37 +0000 (12:43 +0000)]
CodeGen: Copy tail padding when we're not dealing with a trivial copy assign or move assign operator.

This fixes a regression from r162254, the optimizer has problems reasoning
about the smaller memcpy as it's often not safe to widen a store but making it
smaller is.

llvm-svn: 164917

11 years agoFilter out tools and unittests which we don't want to build when we're building clang...
Bill Wendling [Sun, 30 Sep 2012 11:23:30 +0000 (11:23 +0000)]
Filter out tools and unittests which we don't want to build when we're building clang only.

llvm-svn: 164916

11 years agoRemove this hack in favor of another, better way of performing the same thing.
Bill Wendling [Sun, 30 Sep 2012 11:22:45 +0000 (11:22 +0000)]
Remove this hack in favor of another, better way of performing the same thing.

llvm-svn: 164915

11 years agoIgnore apparent buffer overruns on external or weak globals. This is a major
Duncan Sands [Sun, 30 Sep 2012 07:30:10 +0000 (07:30 +0000)]
Ignore apparent buffer overruns on external or weak globals.  This is a major
source of false positives due to globals being declared in a header with some
kind of incomplete (small) type, but the actual definition being bigger.

llvm-svn: 164912

11 years agoRevert r164910 because it causes failures to several phase2 builds.
Nadav Rotem [Sun, 30 Sep 2012 07:17:56 +0000 (07:17 +0000)]
Revert r164910 because it causes failures to several phase2 builds.

llvm-svn: 164911

11 years agoA DAGCombine optimization for merging consecutive stores. This optimization is not...
Nadav Rotem [Sun, 30 Sep 2012 06:24:14 +0000 (06:24 +0000)]
A DAGCombine optimization for merging consecutive stores. This optimization is not profitable in many cases
because moden processos can store multiple values in parallel, and preparing the consecutive store requires
some work.  We only handle these cases:

1. Consecutive stores where the values and consecutive loads. For example:
 int a = p->a;
 int b = p->b;
 q->a = a;
 q->b = b;

2. Consecutive stores where the values are constants. Foe example:
 q->a = 4;
 q->b = 5;

llvm-svn: 164910

11 years agoTemporarily comment out some new arm variants to try to fix buildbots.
Bob Wilson [Sun, 30 Sep 2012 05:34:28 +0000 (05:34 +0000)]
Temporarily comment out some new arm variants to try to fix buildbots.

llvm-svn: 164909

11 years agoSpecify a full target in an attempt to appease buildbots.
Bob Wilson [Sun, 30 Sep 2012 00:58:28 +0000 (00:58 +0000)]
Specify a full target in an attempt to appease buildbots.

llvm-svn: 164908

11 years agoAdd Clang support for iOS6.
Bob Wilson [Sat, 29 Sep 2012 23:52:58 +0000 (23:52 +0000)]
Add Clang support for iOS6.

llvm-svn: 164907

11 years agoAdd ARM VFPv4 feature and enable it by default for Swift.
Bob Wilson [Sat, 29 Sep 2012 23:52:52 +0000 (23:52 +0000)]
Add ARM VFPv4 feature and enable it by default for Swift.

llvm-svn: 164906

11 years agoAdd armv7s and some other arm variants supported by Mach-O files.
Bob Wilson [Sat, 29 Sep 2012 23:52:50 +0000 (23:52 +0000)]
Add armv7s and some other arm variants supported by Mach-O files.

llvm-svn: 164905

11 years agoAdd an FMA intrinsic for ARM Neon.
Bob Wilson [Sat, 29 Sep 2012 23:52:48 +0000 (23:52 +0000)]
Add an FMA intrinsic for ARM Neon.

llvm-svn: 164904

11 years agoAdd compiler-rt support for Swift.
Bob Wilson [Sat, 29 Sep 2012 23:37:01 +0000 (23:37 +0000)]
Add compiler-rt support for Swift.

llvm-svn: 164903

11 years agoAdd support for iOS6.
Bob Wilson [Sat, 29 Sep 2012 23:25:48 +0000 (23:25 +0000)]
Add support for iOS6.

llvm-svn: 164902

11 years agoWhitespace.
Bob Wilson [Sat, 29 Sep 2012 22:08:54 +0000 (22:08 +0000)]
Whitespace.

llvm-svn: 164900

11 years agoAdd LLVM support for Swift.
Bob Wilson [Sat, 29 Sep 2012 21:43:49 +0000 (21:43 +0000)]
Add LLVM support for Swift.

llvm-svn: 164899

11 years agoWhitespace.
Bob Wilson [Sat, 29 Sep 2012 21:27:31 +0000 (21:27 +0000)]
Whitespace.

llvm-svn: 164898

11 years agoShrink TargetAlignElem a bit, we do a lot of searches on them.
Benjamin Kramer [Sat, 29 Sep 2012 19:57:14 +0000 (19:57 +0000)]
Shrink TargetAlignElem a bit, we do a lot of searches on them.

llvm-svn: 164897

11 years agoFix refersToDeclaration()-matcher and add missing test case. This was
Daniel Jasper [Sat, 29 Sep 2012 15:55:18 +0000 (15:55 +0000)]
Fix refersToDeclaration()-matcher and add missing test case. This was
broken as of r164656 as TemplateArgument::getAsDecl() now asserts
instead of returning NULL for other template arugment kinds.

llvm-svn: 164896

11 years agoMove the 'find macro by spelling' infrastructure to the Preprocessor class and
Dmitri Gribenko [Sat, 29 Sep 2012 11:40:46 +0000 (11:40 +0000)]
Move the 'find macro by spelling' infrastructure to the Preprocessor class and
use it to suggest appropriate macro for __attribute__((deprecated)) in
-Wdocumentation-deprecated-sync.

llvm-svn: 164892

11 years agoFix a somewhat surprising miscompile where code relying on an ABI
Chandler Carruth [Sat, 29 Sep 2012 10:41:21 +0000 (10:41 +0000)]
Fix a somewhat surprising miscompile where code relying on an ABI
alignment could lose it due to the alloca type moving down to a much
smaller alignment guarantee.

Now SROA will actively compute a proper alignment, factoring the target
data, any explicit alignment, and the offset within the struct. This
will in some cases lower the alignment requirements, but when we lower
them below those of the type, we drop the alignment entirely to give
freedom to the code generator to align it however is convenient.

Thanks to Duncan for the lovely test case that pinned this down. =]

llvm-svn: 164891

11 years agoSpeculatively revert commit 164885 (nadav) in the hope of ressurecting a pile of
Duncan Sands [Sat, 29 Sep 2012 10:25:35 +0000 (10:25 +0000)]
Speculatively revert commit 164885 (nadav) in the hope of ressurecting a pile of
buildbots.  Original commit message:

A DAGCombine optimization for merging consecutive stores. This optimization is not profitable in many cases
because moden processos can store multiple values in parallel, and preparing the consecutive store requires
some work.  We only handle these cases:

1. Consecutive stores where the values and consecutive loads. For example:
  int a = p->a;
  int b = p->b;
  q->a = a;
  q->b = b;

2. Consecutive stores where the values are constants. Foe example:
  q->a = 4;
  q->b = 5;

llvm-svn: 164890

11 years agoComment XML schema: correct indentation.
Dmitri Gribenko [Sat, 29 Sep 2012 08:27:37 +0000 (08:27 +0000)]
Comment XML schema: correct indentation.

llvm-svn: 164889

11 years agoAdd the RelocateOrLoadKernel and LoadKernel methods to ProcessGDBRemote::DoRemoteConn...
Jason Molenda [Sat, 29 Sep 2012 08:03:33 +0000 (08:03 +0000)]
Add the RelocateOrLoadKernel and LoadKernel methods to ProcessGDBRemote::DoRemoteConnect().
When attaching to a remote system that does not look like a typical vendor system, and no
executable binary was specified to lldb, check a couple of fixed locations where kernels
running in ASLR mode (slid in memory to a random address) store their load addr when booted
in debug mode, and relocate the symbols or load the kernel wholesale from the host computer
if we can find it.

<rdar://problem/7714201>

llvm-svn: 164888

11 years agoTidy up to match coding standards. Remove 'else' after 'return' and moving operators...
Craig Topper [Sat, 29 Sep 2012 07:18:53 +0000 (07:18 +0000)]
Tidy up to match coding standards. Remove 'else' after 'return' and moving operators to end of preceding line. No functional change intended.

llvm-svn: 164887

11 years agoReplace a couple if/elses around similar calls with conditional operators on the...
Craig Topper [Sat, 29 Sep 2012 06:54:22 +0000 (06:54 +0000)]
Replace a couple if/elses around similar calls with conditional operators on the varying arguments. No functional change.

llvm-svn: 164886

11 years agoA DAGCombine optimization for merging consecutive stores. This optimization is not...
Nadav Rotem [Sat, 29 Sep 2012 06:33:25 +0000 (06:33 +0000)]
A DAGCombine optimization for merging consecutive stores. This optimization is not profitable in many cases
because moden processos can store multiple values in parallel, and preparing the consecutive store requires
some work.  We only handle these cases:

1. Consecutive stores where the values and consecutive loads. For example:
  int a = p->a;
  int b = p->b;
  q->a = a;
  q->b = b;

2. Consecutive stores where the values are constants. Foe example:
  q->a = 4;
  q->b = 5;

llvm-svn: 164885

11 years agoAdd support for debugging KASLR kernels via kdp (the kernel being
Jason Molenda [Sat, 29 Sep 2012 04:02:01 +0000 (04:02 +0000)]
Add support for debugging KASLR kernels via kdp (the kernel being
loaded at a random offset).

To get the kernel's UUID and load address I need to send a kdp
packet so I had to implement the kernel relocation (and attempt to
find the kernel if none was provided to lldb already) in ProcessKDP
-- but this code really properly belongs in DynamicLoaderDarwinKernel.

I also had to add an optional Stream to ConnectRemote so
ProcessKDP::DoConnectRemote can print feedback about the remote kernel's
UUID, load address, and notify the user if we auto-loaded the kernel via
the UUID.

<rdar://problem/7714201>

llvm-svn: 164881

11 years agoRemove more LLVM_DELETED_FUNCTIONs from destructors to fix -std=c++11 build on gcc...
Craig Topper [Sat, 29 Sep 2012 02:25:34 +0000 (02:25 +0000)]
Remove more LLVM_DELETED_FUNCTIONs from destructors to fix -std=c++11 build on gcc 4.7.

llvm-svn: 164880

11 years agoclang/test/CodeGen/tbaa-struct.cpp: Fix. Be aware of 32 bit pointer.
NAKAMURA Takumi [Sat, 29 Sep 2012 02:00:04 +0000 (02:00 +0000)]
clang/test/CodeGen/tbaa-struct.cpp: Fix. Be aware of 32 bit pointer.

llvm-svn: 164879

11 years agoNow in the presence of an Objective-C version 2
Sean Callanan [Sat, 29 Sep 2012 01:53:36 +0000 (01:53 +0000)]
Now in the presence of an Objective-C version 2
runtime, we read method signatures for both class
and instance methods out of the runtime data.

(lldb) fr var str
(NSString *) str = 0x0000000105000180 @"Hello from '/Volumes/Data/projects/lldb/test/lang/objc/foundation/a.out'"
(lldb) expr str.length
(unsigned long long) $0 = 72
(lldb) expr [NSString stringWithCString:"Hello world!" encoding:1]
(id) $1 = 0x0000000105100050
(lldb) po $1
$1 = 0x0000000105100050 Hello world!

(lldb) fr var array1
(NSArray *) array1 = 0x000000010010a6e0 @"3 objects"
(lldb) expr array1.count
(unsigned long long) $0 = 3
(lldb) expr [array1 objectAtIndex:2]
(id) $1 = 0x00000001000025d0
(lldb) po $1
$1 = 0x00000001000025d0 array1 object3

Notice that both regular and property-style notation
work.  I still need to add explicit support for
properties with non-default setters/getters.

This information is only queried if an Objective-C
object does not have debug information for a complete
type available.  Otherwise we query debug information
as usual.

llvm-svn: 164878

11 years agoRevert "[analyzer] Create a temporary region for rvalue structs when accessing fields"
Jordan Rose [Sat, 29 Sep 2012 01:36:51 +0000 (01:36 +0000)]
Revert "[analyzer] Create a temporary region for rvalue structs when accessing fields"

This reverts commit 6f61df3e7256413dcb99afb9673f4206e3c4992c.

llvm-svn: 164877

11 years agoRevert "[analyzer] Create a temp region when a method is called on a struct rvalue."
Jordan Rose [Sat, 29 Sep 2012 01:36:47 +0000 (01:36 +0000)]
Revert "[analyzer] Create a temp region when a method is called on a struct rvalue."

This reverts commit 0006ba445962621ed82ec84400a6b978205a3fbc.

llvm-svn: 164876

11 years agoRevert "[analyzer] Handle inlined constructors for rvalue temporaries correctly."
Jordan Rose [Sat, 29 Sep 2012 01:36:42 +0000 (01:36 +0000)]
Revert "[analyzer] Handle inlined constructors for rvalue temporaries correctly."

This reverts commit 580cd17f256259f39a382e967173f34d68e73859.

llvm-svn: 164875

11 years agoFor PPCallbacks::InclusionDirective() add a parameter for the module, whenever
Argyrios Kyrtzidis [Sat, 29 Sep 2012 01:06:10 +0000 (01:06 +0000)]
For PPCallbacks::InclusionDirective() add a parameter for the module, whenever
an inclusion directive was automatically turned into a module import, and
PPCallbacks::moduleImport() for an explicit module import.

llvm-svn: 164874

11 years agoIn the Module class, add a reference to the corresponding AST file.
Argyrios Kyrtzidis [Sat, 29 Sep 2012 01:06:04 +0000 (01:06 +0000)]
In the Module class, add a reference to the corresponding AST file.

llvm-svn: 164873

11 years agoAdd an assertion to make sure the implicitly imported module
Argyrios Kyrtzidis [Sat, 29 Sep 2012 01:06:01 +0000 (01:06 +0000)]
Add an assertion to make sure the implicitly imported module
is the same as the suggested one when looking up the include filename.

llvm-svn: 164872

11 years ago<rdar://problem/12378910> Fix a bunch of other places where similar problems could...
Enrico Granata [Sat, 29 Sep 2012 00:47:43 +0000 (00:47 +0000)]
<rdar://problem/12378910> Fix a bunch of other places where similar problems could happen

llvm-svn: 164871

11 years ago<rdar://problem/12378910> Fixing a potential crasher in the data formatters where...
Enrico Granata [Sat, 29 Sep 2012 00:45:53 +0000 (00:45 +0000)]
<rdar://problem/12378910> Fixing a potential crasher in the data formatters where we fail to check for NULL or empty class name

llvm-svn: 164870

11 years ago[analyzer] Do not visit ObjCMethodDecl twice in the AST checkers.
Anna Zaks [Sat, 29 Sep 2012 00:20:40 +0000 (00:20 +0000)]
[analyzer] Do not visit ObjCMethodDecl twice in the AST checkers.

llvm-svn: 164869

11 years ago[analyzer] Re-implement IvarInvalidationChecker so that it verifies that
Anna Zaks [Sat, 29 Sep 2012 00:20:38 +0000 (00:20 +0000)]
[analyzer] Re-implement IvarInvalidationChecker so that it verifies that
the validation occurred.

The original implementation was pessimistic - we assumed that ivars
which escape are invalidated. This version is optimistic, it assumes
that the ivars will always be explicitly invalidated: either set to nil
or sent an invalidation message.

llvm-svn: 164868

11 years agoAdd test case for r164850.
Evan Cheng [Sat, 29 Sep 2012 00:12:08 +0000 (00:12 +0000)]
Add test case for r164850.

llvm-svn: 164867

11 years agoDo not delete BBs if their addresses are taken. rdar://12396696
Evan Cheng [Fri, 28 Sep 2012 23:58:57 +0000 (23:58 +0000)]
Do not delete BBs if their addresses are taken. rdar://12396696

llvm-svn: 164866

11 years agoImplementing plugins that provide commands.
Enrico Granata [Fri, 28 Sep 2012 23:57:51 +0000 (23:57 +0000)]
Implementing plugins that provide commands.
This checkin adds the capability for LLDB to load plugins from external dylibs that can provide new commands
It exports an SBCommand class from the public API layer, and a new SBCommandPluginInterface

There is a minimal load-only plugin manager built into the debugger, which can be accessed via Debugger::LoadPlugin.

Plugins are loaded from two locations at debugger startup (LLDB.framework/Resources/PlugIns and ~/Library/Application Support/LLDB/PlugIns) and more can be (re)loaded via the "plugin load" command

For an example of how to make a plugin, refer to the fooplugin.cpp file in examples/plugins/commands

Caveats:
Currently, the new API objects and features are not exposed via Python.
The new commands can only be "parsed" (i.e. not raw) and get their command line via a char** parameter (we do not expose our internal Args object)
There is no unloading feature, which can potentially lead to leaks if you overwrite the commands by reloading the same or different plugins
There is no API exposed for option parsing, which means you may need to use getopt or roll-your-own

llvm-svn: 164865

11 years agoPR13941: Mark all virtual functions as unnamed_addr. It's not possible to
Richard Smith [Fri, 28 Sep 2012 22:46:07 +0000 (22:46 +0000)]
PR13941: Mark all virtual functions as unnamed_addr. It's not possible to
observe their addresses (taking their address gives the vtable slot) so we are
free to merge their definitions.

llvm-svn: 164864

11 years agoSet up code under _LIBCXX_DYNAMIC_FALLBACK which is off by default. For a full descr...
Howard Hinnant [Fri, 28 Sep 2012 22:43:50 +0000 (22:43 +0000)]
Set up code under _LIBCXX_DYNAMIC_FALLBACK which is off by default.  For a full description of _LIBCXX_DYNAMIC_FALLBACK, see src/private_typeinfo.cpp.

llvm-svn: 164863

11 years agoUse a custom DenseMapInfo for WeakObjectProfileTy.
Jordan Rose [Fri, 28 Sep 2012 22:42:04 +0000 (22:42 +0000)]
Use a custom DenseMapInfo for WeakObjectProfileTy.

We can't specialize the usual llvm::DenseMapInfo at the end of the file
because by that point the DenseMap in FunctionScopeInfo has already been
instantiated.

No functionality change.

llvm-svn: 164862

11 years ago[Doc parsing] Add availability information to generated Comment XML.
Fariborz Jahanian [Fri, 28 Sep 2012 22:35:49 +0000 (22:35 +0000)]
[Doc parsing] Add availability information to generated Comment XML.
(I still need to add a test once I figure it out).
Reviewed off-line by Doug. // rdar://12378879

llvm-svn: 164861

11 years agoDon't use bit-wise operations to query for inclusion/exclusion of attributes.
Bill Wendling [Fri, 28 Sep 2012 22:30:18 +0000 (22:30 +0000)]
Don't use bit-wise operations to query for inclusion/exclusion of attributes.

llvm-svn: 164860

11 years agoFix buildbots by not using a template from another namespace.
Jordan Rose [Fri, 28 Sep 2012 22:29:02 +0000 (22:29 +0000)]
Fix buildbots by not using a template from another namespace.

No need to specialize BeforeThanCompare for a comparator that's only
going to be used once.

llvm-svn: 164859

11 years agoCompatibility macro detection for the -Wimplicit-fallthrough diagnostic.
Alexander Kornienko [Fri, 28 Sep 2012 22:24:03 +0000 (22:24 +0000)]
Compatibility macro detection for the -Wimplicit-fallthrough diagnostic.

Summary:
When issuing a diagnostic message for the -Wimplicit-fallthrough diagnostics, always try to find the latest macro, defined at the point of fallthrough, which is immediately expanded to "[[clang::fallthrough]]", and use it's name instead of the actual sequence.

Known issues:
  * uses PP.getSpelling() to compare macro definition with a string (anyone can suggest a convenient way to fill a token array, or maybe lex it in runtime?);
  * this can be generalized and used in other similar cases, any ideas where it should reside then?

Reviewers: doug.gregor, rsmith

Reviewed By: rsmith

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D50

llvm-svn: 164858

11 years ago-Wreceiver-is-weak: rephrase warning text and add a suggestion Note.
Jordan Rose [Fri, 28 Sep 2012 22:21:42 +0000 (22:21 +0000)]
-Wreceiver-is-weak: rephrase warning text and add a suggestion Note.

New output:
  warning: weak property may be unpredictably set to nil
  note: property declared here
  note: assign the value to a strong variable to keep the object alive
        during use

<rdar://problem/12277204>

llvm-svn: 164857

11 years agoPull ScopeInfo implementation into its own file.
Jordan Rose [Fri, 28 Sep 2012 22:21:39 +0000 (22:21 +0000)]
Pull ScopeInfo implementation into its own file.

The infrastructure for -Warc-repeated-use-of-weak got a little too heavy
to leave sitting at the top of Sema.cpp.

No functionality change.

llvm-svn: 164856

11 years ago-Warc-repeated-use-of-weak: check ivars and variables as well.
Jordan Rose [Fri, 28 Sep 2012 22:21:35 +0000 (22:21 +0000)]
-Warc-repeated-use-of-weak: check ivars and variables as well.

Like properties, loading from a weak ivar twice in the same function can
give you inconsistent results if the object is deallocated between the
two loads. It is safer to assign to a strong local variable and use that.

Second half of <rdar://problem/12280249>.

llvm-svn: 164855

11 years agoAdd a warning (off by default) for repeated use of the same weak property.
Jordan Rose [Fri, 28 Sep 2012 22:21:30 +0000 (22:21 +0000)]
Add a warning (off by default) for repeated use of the same weak property.

The motivating example:

if (self.weakProp)
  use(self.weakProp);

As with any non-atomic test-then-use, it is possible a weak property to be
non-nil at the 'if', but be deallocated by the time it is used. The correct
way to write this example is as follows:

id tmp = self.weakProp;
if (tmp)
  use(tmp);

The warning is controlled by -Warc-repeated-use-of-receiver, and uses the
property name and base to determine if the same property on the same object
is being accessed multiple times. In cases where the base is more
complicated than just a single Decl (e.g. 'foo.bar.weakProp'), it picks a
Decl for some degree of uniquing and reports the problem under a subflag,
-Warc-maybe-repeated-use-of-receiver. This gives a way to tune the
aggressiveness of the warning for a particular project.

The warning is not on by default because it is not flow-sensitive and thus
may have a higher-than-acceptable rate of false positives, though it is
less noisy than -Wreceiver-is-weak. On the other hand, it will not warn
about some cases that may be legitimate issues that -Wreceiver-is-weak
will catch, and it does not attempt to reason about methods returning weak
values.

Even though this is not a real "analysis-based" check I've put the bug
emission code in AnalysisBasedWarnings for two reasons: (1) to run on
every kind of code body (function, method, block, or lambda), and (2) to
suggest that it may be enhanced by flow-sensitive analysis in the future.

The second (smaller) half of this work is to extend it to weak locals
and weak ivars. This should use most of the same infrastructure.

Part of <rdar://problem/12280249>

llvm-svn: 164854

11 years agoAdd basic support for adding !tbaa.struct metadata on llvm.memcpy calls for
Dan Gohman [Fri, 28 Sep 2012 21:58:29 +0000 (21:58 +0000)]
Add basic support for adding !tbaa.struct metadata on llvm.memcpy calls for
struct assignment.

llvm-svn: 164853

11 years ago<rdar://problem/12398225>
Greg Clayton [Fri, 28 Sep 2012 21:51:54 +0000 (21:51 +0000)]
<rdar://problem/12398225>

Improve performance of StringExtractor::GetHexS8().

llvm-svn: 164852

11 years agoWhen processing an InitListExpr and skipping the initialization of an invalid
Richard Smith [Fri, 28 Sep 2012 21:23:50 +0000 (21:23 +0000)]
When processing an InitListExpr and skipping the initialization of an invalid
record, skip at least one element from the InitListExpr to avoid an infinite
loop if we're initializing an array of unknown bound.

llvm-svn: 164851

11 years agoGlobalDCE should be run at -O2 / -Os to eliminate unused dtor, etc. rdar://9142819
Evan Cheng [Fri, 28 Sep 2012 21:23:26 +0000 (21:23 +0000)]
GlobalDCE should be run at -O2 / -Os to eliminate unused dtor, etc. rdar://9142819

llvm-svn: 164850

11 years agoMIPS DSP: add operands to make sure instruction strings are being matched.
Akira Hatanaka [Fri, 28 Sep 2012 21:23:16 +0000 (21:23 +0000)]
MIPS DSP: add operands to make sure instruction strings are being matched.

llvm-svn: 164849

11 years agoRemove unused methods.
Bill Wendling [Fri, 28 Sep 2012 21:22:24 +0000 (21:22 +0000)]
Remove unused methods.

llvm-svn: 164848

11 years agodocs: dedent list on index.rst
Sean Silva [Fri, 28 Sep 2012 21:18:37 +0000 (21:18 +0000)]
docs: dedent list on index.rst

In reStructuredText, indented blocks denote block quotes [1]. This list
is not a block quote.

[1]. http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#block-quotes

llvm-svn: 164847

11 years agoFix -Wcovered-switch-default warning.
Michael J. Spencer [Fri, 28 Sep 2012 21:07:58 +0000 (21:07 +0000)]
Fix -Wcovered-switch-default warning.

llvm-svn: 164846

11 years agoMIPS DSP: other miscellaneous instructions.
Akira Hatanaka [Fri, 28 Sep 2012 20:50:31 +0000 (20:50 +0000)]
MIPS DSP: other miscellaneous instructions.

llvm-svn: 164845

11 years agoFixed a bug where if something went wrong while
Sean Callanan [Fri, 28 Sep 2012 20:47:47 +0000 (20:47 +0000)]
Fixed a bug where if something went wrong while
constructing the ObjCInterfaceDecl for an ISA,
we'd continue and try to use that Decl anyway,
possibly causing a crash.

llvm-svn: 164844

11 years agoUpdate template type diffing to handle qualifiers. Differing qualifiers will
Richard Trieu [Fri, 28 Sep 2012 20:32:51 +0000 (20:32 +0000)]
Update template type diffing to handle qualifiers.  Differing qualifiers will
now be printed with highlighting.

llvm-svn: 164843

11 years agoTestcase for r164835
Manman Ren [Fri, 28 Sep 2012 20:26:33 +0000 (20:26 +0000)]
Testcase for r164835

llvm-svn: 164842

11 years agoAllow __builtin_bswap32/64 in constant expressions, like gcc does. Patch by Tijl...
Richard Smith [Fri, 28 Sep 2012 20:20:52 +0000 (20:20 +0000)]
Allow __builtin_bswap32/64 in constant expressions, like gcc does. Patch by Tijl Coosemans!

llvm-svn: 164841

11 years agoMIPS DSP: ADDUH.QB instruction sub-class.
Akira Hatanaka [Fri, 28 Sep 2012 20:16:04 +0000 (20:16 +0000)]
MIPS DSP: ADDUH.QB instruction sub-class.

llvm-svn: 164840

11 years agoClean up part of template type diffing. Moved repeated code to separate
Richard Trieu [Fri, 28 Sep 2012 19:51:57 +0000 (19:51 +0000)]
Clean up part of template type diffing.  Moved repeated code to separate
functions.  Reworked one of the conditionals.  No functional changes.

llvm-svn: 164839

11 years agoModern objcective-C translator. When doing rewriting, Do not
Fariborz Jahanian [Fri, 28 Sep 2012 19:05:17 +0000 (19:05 +0000)]
Modern objcective-C translator. When doing rewriting, Do not
use the integrated pre-processor, preprocess in objective-c++ mode.
// rdar://12189793.

llvm-svn: 164836

11 years agoX86: when replacing SUB with TEST in ISelDAGToDAG, only replace uses of the
Manman Ren [Fri, 28 Sep 2012 18:53:24 +0000 (18:53 +0000)]
X86: when replacing SUB with TEST in ISelDAGToDAG, only replace uses of the
second output of SUB with first output of TEST.

PR13966

llvm-svn: 164835

11 years agoImprove the diagnostic messages on dynamic_cast.
Howard Hinnant [Fri, 28 Sep 2012 17:58:48 +0000 (17:58 +0000)]
Improve the diagnostic messages on dynamic_cast.

llvm-svn: 164833

11 years agoDue to a mistake on my own part, I need to burn some version numbers. This does...
Howard Hinnant [Fri, 28 Sep 2012 17:42:25 +0000 (17:42 +0000)]
Due to a mistake on my own part, I need to burn some version numbers.  This does not impact any of the implementation of libc++, and does not impact the ABI in any way.

llvm-svn: 164832

11 years agoRemoving dependency on third party library for Intel JIT event support.
Andrew Kaylor [Fri, 28 Sep 2012 17:35:20 +0000 (17:35 +0000)]
Removing dependency on third party library for Intel JIT event support.
Patch committed on behalf of Kirill Uhanov

llvm-svn: 164831

11 years ago[analyzer] Handle inlined constructors for rvalue temporaries correctly.
Jordan Rose [Fri, 28 Sep 2012 17:15:25 +0000 (17:15 +0000)]
[analyzer] Handle inlined constructors for rvalue temporaries correctly.

Previously the analyzer treated all inlined constructors like lvalues,
setting the value of the CXXConstructExpr to the newly-constructed
region. However, some CXXConstructExprs behave like rvalues -- in
particular, the implicit copy constructor into a pass-by-value argument.
In this case, we want only the /contents/ of a temporary object to be
passed, so that we can use the same "copy each argument into the
parameter region" algorithm that we use for scalar arguments.

This may change when we start modeling destructors of temporaries,
but for now this is the last part of <rdar://problem/12137950>.

llvm-svn: 164830

11 years ago[analyzer] Create a temp region when a method is called on a struct rvalue.
Jordan Rose [Fri, 28 Sep 2012 17:15:21 +0000 (17:15 +0000)]
[analyzer] Create a temp region when a method is called on a struct rvalue.

An rvalue has no address, but calling a C++ member function requires a
'this' pointer. This commit makes the analyzer create a temporary region
in which to store the struct rvalue and use as a 'this' pointer whenever
a member function is called on an rvalue, which is essentially what
CodeGen does.

More of <rdar://problem/12137950>. The last part is tracking down the
C++ FIXME in array-struct-region.cpp.

llvm-svn: 164829

11 years ago[analyzer] Create a temporary region for rvalue structs when accessing fields
Jordan Rose [Fri, 28 Sep 2012 17:15:12 +0000 (17:15 +0000)]
[analyzer] Create a temporary region for rvalue structs when accessing fields

Struct rvalues are represented in the analyzer by CompoundVals,
LazyCompoundVals, or plain ConjuredSymbols -- none of which have associated
regions. If the entire structure is going to persist, this is not a
problem -- either the rvalue will be assigned to an existing region, or
a MaterializeTemporaryExpr will be present to create a temporary region.
However, if we just need a field from the struct, we need to create the
temporary region ourselves.

This is inspired by the way CodeGen handles calls to temporaries;
support for that in the analyzer is coming next.

Part of <rdar://problem/12137950>

llvm-svn: 164828

11 years agoAvoid malloc thrashing in the uninitialized value analysis.
Benjamin Kramer [Fri, 28 Sep 2012 16:44:29 +0000 (16:44 +0000)]
Avoid malloc thrashing in the uninitialized value analysis.

- The size of the packed vector is often small, save mallocs using SmallBitVector.
- Copying SmallBitVectors is also cheap, remove a level of indirection.

llvm-svn: 164827

11 years agoPackedVector: Make the BitVector implementation configurable.
Benjamin Kramer [Fri, 28 Sep 2012 16:40:29 +0000 (16:40 +0000)]
PackedVector: Make the BitVector implementation configurable.

llvm-svn: 164826

11 years agoFix a bug introduced in an earlier revision: actually return the StopReason, when...
Filipe Cabecinhas [Fri, 28 Sep 2012 15:55:43 +0000 (15:55 +0000)]
Fix a bug introduced in an earlier revision: actually return the StopReason, when we have a StopInfo object.

llvm-svn: 164825

11 years agoSet Diag.ErrorOccurred even if a DiagnosticConsumer does not want it in
Daniel Jasper [Fri, 28 Sep 2012 15:45:07 +0000 (15:45 +0000)]
Set Diag.ErrorOccurred even if a DiagnosticConsumer does not want it in
diagnostic count.

If a DiagnosticConsumer sub-class overwrites IncludeInDiagnosticCounts,
this should change diagnostic counts. However, it currently also
influences Diag.ErrorOccurred, which in turn influences the behavior of
parsing and semantic analysis (in a way that can make it crash).

llvm-svn: 164824

11 years agoProvide malloc-free sentinels for the SparseBitVector internals.
Benjamin Kramer [Fri, 28 Sep 2012 15:36:41 +0000 (15:36 +0000)]
Provide malloc-free sentinels for the SparseBitVector internals.

llvm-svn: 164823

11 years agoReplace the use of strncpy() and sprintf() with std::string and LLVM streams.
Dmitri Gribenko [Fri, 28 Sep 2012 14:15:28 +0000 (14:15 +0000)]
Replace the use of strncpy() and sprintf() with std::string and LLVM streams.

Patch by Martinez, Javier E.

llvm-svn: 164822

11 years ago[ASan] Fix unit test headers. Add an option to change substitute asan_test_config...
Alexey Samsonov [Fri, 28 Sep 2012 12:24:23 +0000 (12:24 +0000)]
[ASan] Fix unit test headers. Add an option to change substitute asan_test_config.h file

llvm-svn: 164821

11 years ago[ASan] use llvm-symbolizer (in offline mode) in ASan output tests on Linux
Alexey Samsonov [Fri, 28 Sep 2012 11:05:41 +0000 (11:05 +0000)]
[ASan] use llvm-symbolizer (in offline mode) in ASan output tests on Linux

llvm-svn: 164819

11 years agoCorrelatedPropagation: BasicBlock::removePredecessor can simplify PHI nodes. If the...
Benjamin Kramer [Fri, 28 Sep 2012 10:42:50 +0000 (10:42 +0000)]
CorrelatedPropagation: BasicBlock::removePredecessor can simplify PHI nodes. If the it's the condition of a SwitchInst, reload it.

Fixes PR13972.

llvm-svn: 164818

11 years agoMake backtraces work again with both the configure and cmake build.
Benjamin Kramer [Fri, 28 Sep 2012 10:10:46 +0000 (10:10 +0000)]
Make backtraces work again with both the configure and cmake build.

llvm-svn: 164817

11 years ago[asan] Change defaults for Android target.
Evgeniy Stepanov [Fri, 28 Sep 2012 10:07:53 +0000 (10:07 +0000)]
[asan] Change defaults for Android target.

This way building without -DASAN_* in CFLAGS produces working binaries.

llvm-svn: 164816

11 years agoGlobalOpt: non-constexpr bitcasts or GEPs can occur even if the global value is only...
Benjamin Kramer [Fri, 28 Sep 2012 10:01:27 +0000 (10:01 +0000)]
GlobalOpt: non-constexpr bitcasts or GEPs can occur even if the global value is only stored once.

Fixes PR13968.

llvm-svn: 164815

11 years agoSurprisingly, we missed a trivial case here. Fix that!
Nick Lewycky [Fri, 28 Sep 2012 09:33:53 +0000 (09:33 +0000)]
Surprisingly, we missed a trivial case here. Fix that!

llvm-svn: 164814

11 years agoRemove a LLVM_DELETED_FUNCTION from destructor to fix -std=c++11 build on gcc 4.7.
Craig Topper [Fri, 28 Sep 2012 07:17:01 +0000 (07:17 +0000)]
Remove a LLVM_DELETED_FUNCTION from destructor to fix -std=c++11 build on gcc 4.7.

llvm-svn: 164813

11 years agoRecognize the eax/ebp/eip etc version of x86 register
Jason Molenda [Fri, 28 Sep 2012 05:46:55 +0000 (05:46 +0000)]
Recognize the eax/ebp/eip etc version of x86 register
names in addition to the rax/rbp/rip register names when
deciding whether a register is volatile or not.

llvm-svn: 164812

11 years ago1. Add load/store words from the stack
Reed Kotler [Fri, 28 Sep 2012 02:26:24 +0000 (02:26 +0000)]
1. Add load/store words from the stack
2. As part of this, added assembly format FEXT_RI16_SP_explicit_ins and
moved other lines for FEXT_RI16 formats to be in the right place in the code.
3. Added mayLoad and mayStore assignements for the load/store instructions added and for ones already there that did not have this assignment.
4. Another patch will deal with the problem of load/store byte/halfword to the stack. This is a particular Mips16 problem.

llvm-svn: 164811

11 years agoFix the extra space char being emitted in this message when breakpoints resolve -
Jason Molenda [Fri, 28 Sep 2012 01:50:47 +0000 (01:50 +0000)]
Fix the extra space char being emitted in this message when breakpoints resolve -

1 location  added to breakpoint 2

llvm-svn: 164810

11 years agoTwo changes: 1) I still didn't have the ABI correct to match the gcc-4.2 std::strin...
Howard Hinnant [Fri, 28 Sep 2012 00:05:34 +0000 (00:05 +0000)]
Two changes:  1)  I still didn't have the ABI correct to match the gcc-4.2 std::string under the exception classes.  I think the changes to stdexcept.cpp have got that down now.  2) On Apple platforms I'm seeing visibility bugs in applications with respect to type_info's being hidden.  This is causing dynamic_cast to malfunction because there are multiple type_info's running around for one type within an application, making dynamic_cast believe that one type is actually multiple types.  As a stop gap measure I'm trying to detect this error, print out an error message, but continue with the most likely desired result.  This is all under __APPLE__.  This behavior can be expanded to other platforms if desired.

llvm-svn: 164809

11 years agoImproved the runtime reading to also get data
Sean Callanan [Thu, 27 Sep 2012 23:47:51 +0000 (23:47 +0000)]
Improved the runtime reading to also get data
out of the metaclass, so as to enumerate class
methods for an object.

llvm-svn: 164808

11 years agoRemove <def,read-undef> flags from partial redefinitions.
Jakob Stoklund Olesen [Thu, 27 Sep 2012 23:31:32 +0000 (23:31 +0000)]
Remove <def,read-undef> flags from partial redefinitions.

The new coalescer can turn a full virtual register definition into a
partial redef by merging another value into an unused vector lane.

Make sure to clear the <read-undef> flag on such defs.

llvm-svn: 164807