platform/upstream/llvm.git
11 years agoAlways initialize FPContractable.
Benjamin Kramer [Wed, 3 Oct 2012 20:58:04 +0000 (20:58 +0000)]
Always initialize FPContractable.

false is used as a baseline here, we may want to allow contraction in some of
the cases.  Found by valgrind.

llvm-svn: 165156

11 years agoHolger Arnold: Correct the use and testing of __GNUC__ and __GNUC_MINOR__ in <__config>.
Howard Hinnant [Wed, 3 Oct 2012 20:48:05 +0000 (20:48 +0000)]
Holger Arnold:  Correct the use and testing of __GNUC__ and __GNUC_MINOR__ in <__config>.

llvm-svn: 165151

11 years ago[Options] Store the owning OptTable in Option so it can construct Group and Alias.
Michael J. Spencer [Wed, 3 Oct 2012 19:58:10 +0000 (19:58 +0000)]
[Options] Store the owning OptTable in Option so it can construct Group and Alias.

llvm-svn: 165150

11 years agoRemove useless parameter "WantFile" from Driver::GetProgramPath().
Simon Atanasyan [Wed, 3 Oct 2012 19:52:37 +0000 (19:52 +0000)]
Remove useless parameter "WantFile" from Driver::GetProgramPath().
This parameter is useless because nowhere used explicitly and always
gets its default value - "false".

The patch reviewed by Rafael Espindola.

llvm-svn: 165149

11 years agoFix a cycle in the DAG. In this code we replace multiple loads with a single load and
Nadav Rotem [Wed, 3 Oct 2012 19:30:31 +0000 (19:30 +0000)]
Fix a cycle in the DAG. In this code we replace multiple loads with a single load and
multiple stores with a single load. We create the wide loads and stores (and their chains)
before we remove the scalar loads and stores and fix the DAG chain. We attempted to merge
loads with a different chain. When that happened, the assumption that it is safe to RAUW
broke and a cycle was introduced.

llvm-svn: 165148

11 years agoUse unsigned long long instead of uin64_t for OS where that matters.
Nick Kledzik [Wed, 3 Oct 2012 19:27:25 +0000 (19:27 +0000)]
Use unsigned long long instead of uin64_t for OS where that matters.

llvm-svn: 165147

11 years agoAn API in Clang got renamed; fixing LLDB to match.
Sean Callanan [Wed, 3 Oct 2012 19:23:27 +0000 (19:23 +0000)]
An API in Clang got renamed; fixing LLDB to match.

llvm-svn: 165144

11 years agoThis patch enables general varargs support for the 64-bit PPC SVR4 ABI.
Bill Schmidt [Wed, 3 Oct 2012 19:18:57 +0000 (19:18 +0000)]
This patch enables general varargs support for the 64-bit PPC SVR4 ABI.

Most of the pieces for this were already in place, but a proper EmitVAArg
is needed for aggregates and complex numbers to be handled.  Although the
va_list for 64-bit PowerPC SVR4 consists of GPRs 3 through 10 together with
the overflow portion of the parameter save area, we can treat va_list as
pointing to contiguous memory for all parameters, since the back end forces
the parameter GPRs to memory for varargs functions.

There is no need at this time to model parameters and return values beyond
what the DefaultABIInfo provides.

llvm-svn: 165143

11 years agoFix a typo in my last patch reported by Erik Schwiebert.
Fariborz Jahanian [Wed, 3 Oct 2012 19:05:41 +0000 (19:05 +0000)]
Fix a typo in my last patch reported by Erik Schwiebert.

llvm-svn: 165142

11 years agoTypos.
Chad Rosier [Wed, 3 Oct 2012 19:00:20 +0000 (19:00 +0000)]
Typos.

llvm-svn: 165141

11 years agoDon't call getAsUnsignedInteger directly, it fails to compile if uint64_t is not...
Benjamin Kramer [Wed, 3 Oct 2012 18:54:36 +0000 (18:54 +0000)]
Don't call getAsUnsignedInteger directly, it fails to compile if uint64_t is not "unsigned long long".

while there add more test cases.

llvm-svn: 165140

11 years agoRemove ASTReader::needPendingInstantiation(), introduced in r164993,
Douglas Gregor [Wed, 3 Oct 2012 18:38:43 +0000 (18:38 +0000)]
Remove ASTReader::needPendingInstantiation(), introduced in r164993,
which is neither correct nor necessary. The use of this routine was
eliminated by r165137.

llvm-svn: 165139

11 years agoAdd some FIXMEs to the ASTReader code
Douglas Gregor [Wed, 3 Oct 2012 18:36:10 +0000 (18:36 +0000)]
Add some FIXMEs to the ASTReader code

llvm-svn: 165138

11 years agoRevert most of the functionality in r165001. Instead, make sure that
Douglas Gregor [Wed, 3 Oct 2012 18:34:48 +0000 (18:34 +0000)]
Revert most of the functionality in r165001. Instead, make sure that
the ASTReader doesn't attach a body to a function that is already
defined elsewhere.

llvm-svn: 165137

11 years agoAdd getAsUnsignedInteger test case that checks that known bad values are rejected
Nick Kledzik [Wed, 3 Oct 2012 18:15:27 +0000 (18:15 +0000)]
Add getAsUnsignedInteger test case that checks that known bad values are rejected

llvm-svn: 165136

11 years agoNo need to call functions which do the same thing as the default.
Bill Wendling [Wed, 3 Oct 2012 18:10:49 +0000 (18:10 +0000)]
No need to call functions which do the same thing as the default.

llvm-svn: 165135

11 years agoRemove assert that's too restrictive.
Bill Wendling [Wed, 3 Oct 2012 18:08:57 +0000 (18:08 +0000)]
Remove assert that's too restrictive.

llvm-svn: 165134

11 years agoobjective-C arc: Warn under arc about a use of an ivar inside a block
Fariborz Jahanian [Wed, 3 Oct 2012 17:55:29 +0000 (17:55 +0000)]
objective-C arc: Warn under arc about a use of an ivar inside a block
that doesn't have a 'self' as this implicitly captures 'self' and could
create retain cycles. Provide fixit. // rdar://11194874

llvm-svn: 165133

11 years agoAdd methods which query for the specific attribute instead of using the
Bill Wendling [Wed, 3 Oct 2012 17:54:26 +0000 (17:54 +0000)]
Add methods which query for the specific attribute instead of using the
enums. This allows for better encapsulation of the Attributes class.

llvm-svn: 165132

11 years agoImplement Adnroid MIPS toolchain support:
Simon Atanasyan [Wed, 3 Oct 2012 17:46:38 +0000 (17:46 +0000)]
Implement Adnroid MIPS toolchain support:
1. Add mipsel-linux-android to the list of valid MIPS target triples.
2. Add <gcc install path>/mips-r2 to the list of toolchain specific path
   prefixes if target is mipsel-linux-android.

The patch reviewed by Logan Chien.

llvm-svn: 165131

11 years agoFix failure of newly added test, by using %clang instead of %clang_cc1
Preston Gurd [Wed, 3 Oct 2012 16:52:40 +0000 (16:52 +0000)]
Fix failure of newly added test, by using %clang instead of %clang_cc1
and by specifying a target.

llvm-svn: 165130

11 years agoAdds a test to verify that Clang does the optimization to use a
Preston Gurd [Wed, 3 Oct 2012 16:37:56 +0000 (16:37 +0000)]
Adds a test to verify that Clang does the optimization to use a
fast div/rem instruction (for Intel Atom).

Test case for llvm commit 165126.

Patch by Tyler Nowicki.

llvm-svn: 165129

11 years agoImplement .rel relocation for R_ARM_ABS32 in MCJIT.
Tim Northover [Wed, 3 Oct 2012 16:29:42 +0000 (16:29 +0000)]
Implement .rel relocation for R_ARM_ABS32 in MCJIT.

Patch by Amara Emerson.

llvm-svn: 165128

11 years agoThis Patch corrects a problem whereby the optimization to use a faster divide
Preston Gurd [Wed, 3 Oct 2012 16:11:44 +0000 (16:11 +0000)]
This Patch corrects a problem whereby the optimization to use a faster divide
instruction (for Intel Atom) was not being done by Clang, because
the type context used by Clang is not the default context.

It fixes the problem by getting the global context types for each div/rem
instruction in order to compare them against the types in the BypassTypeMap.

Tests for this will be done as a separate patch to Clang.

Patch by Tyler Nowicki.

llvm-svn: 165126

11 years agoA DAGCombine optimization for mergeing consecutive stores to memory. The optimization
Nadav Rotem [Wed, 3 Oct 2012 16:11:15 +0000 (16:11 +0000)]
A DAGCombine optimization for mergeing consecutive stores to memory. The optimization
is not profitable in many cases because modern processors perform multiple stores
in parallel and merging stores prior to merging requires extra work. We handle two main cases:

1. Store of multiple consecutive constants:
  q->a = 3;
  q->4 = 5;
In this case we store a single legal wide integer.

2. Store of multiple consecutive loads:
  int a = p->a;
  int b = p->b;
  q->a = a;
  q->b = b;
In this case we load/store either ilegal vector registers or legal wide integer registers.

llvm-svn: 165125

11 years agoRevert "InlineObjCInstanceMethod.m: Remove lines introduced in r165079."
Jordan Rose [Wed, 3 Oct 2012 16:00:32 +0000 (16:00 +0000)]
Revert "InlineObjCInstanceMethod.m: Remove lines introduced in r165079."

...and fix the run line so that the expected warnings are the same on
all platforms.

This reverts r165088 / d09074f0ca06626914108f1c0d4e70adeb851e01.

llvm-svn: 165124

11 years agoSet up MCSchedModel after detecting the CPU type in X86SubTarget.
Preston Gurd [Wed, 3 Oct 2012 15:55:13 +0000 (15:55 +0000)]
Set up MCSchedModel after detecting the CPU type in X86SubTarget.

Corrects a problem whereby MCSchedModel was not being set up when
the CPU type was auto-detected.

Patch by Andy Zhang.

llvm-svn: 165122

11 years agoSet ASAN_NEEDS_SEGV=0 on Android only.
Alexander Potapenko [Wed, 3 Oct 2012 15:09:17 +0000 (15:09 +0000)]
Set ASAN_NEEDS_SEGV=0 on Android only.

llvm-svn: 165120

11 years agoclang-check: Add clangRewriteCore.a to the Makefile build to make it link again.
Benjamin Kramer [Wed, 3 Oct 2012 14:35:38 +0000 (14:35 +0000)]
clang-check: Add clangRewriteCore.a to the Makefile build to make it link again.

llvm-svn: 165119

11 years agoMatching block names with FileCheck requires asserts.
Benjamin Kramer [Wed, 3 Oct 2012 14:21:33 +0000 (14:21 +0000)]
Matching block names with FileCheck requires asserts.

llvm-svn: 165118

11 years agoCodeGen: Fix a silly typo when emitting subs of block addresses.
Benjamin Kramer [Wed, 3 Oct 2012 14:15:39 +0000 (14:15 +0000)]
CodeGen: Fix a silly typo when emitting subs of block addresses.

Part of PR14005.

llvm-svn: 165117

11 years agoWhen mangling an APSInt with the ms abi, make sure to look at all nibbles.
Nico Weber [Wed, 3 Oct 2012 13:39:49 +0000 (13:39 +0000)]
When mangling an APSInt with the ms abi, make sure to look at all nibbles.

Currently, it's ignored if the number of set bits isn't divisible by 4.

llvm-svn: 165116

11 years agoAs opposed to the clang-fixit tool described on
Daniel Jasper [Wed, 3 Oct 2012 13:28:43 +0000 (13:28 +0000)]
As opposed to the clang-fixit tool described on
http://clang.llvm.org/docs/ClangTools.html, this adds -fixit option to
clang-check. Thus, clang-check can become a general-purpose tool to run
clang capitalizing on the info stored in a compilation database.

Review: http://llvm-reviews.chandlerc.com/D51
llvm-svn: 165110

11 years agotsan: update the test for new atomic enums
Dmitry Vyukov [Wed, 3 Oct 2012 13:19:20 +0000 (13:19 +0000)]
tsan: update the test for new atomic enums

llvm-svn: 165109

11 years agotsan: update the test for new atomic enums
Dmitry Vyukov [Wed, 3 Oct 2012 13:13:54 +0000 (13:13 +0000)]
tsan: update the test for new atomic enums

llvm-svn: 165108

11 years agotsan: prepare for migration to new memory_order enum values (ABI compatible)
Dmitry Vyukov [Wed, 3 Oct 2012 13:00:57 +0000 (13:00 +0000)]
tsan: prepare for migration to new memory_order enum values (ABI compatible)

llvm-svn: 165107

11 years agotsan: prepare for migration to new memory_order enum values (ABI compatible)
Dmitry Vyukov [Wed, 3 Oct 2012 13:00:13 +0000 (13:00 +0000)]
tsan: prepare for migration to new memory_order enum values (ABI compatible)

llvm-svn: 165106

11 years agoFix typo in comments.
Logan Chien [Wed, 3 Oct 2012 09:26:43 +0000 (09:26 +0000)]
Fix typo in comments.

llvm-svn: 165105

11 years agoComment to XML conversion: escape XML special chars correctly; use correct
Dmitri Gribenko [Wed, 3 Oct 2012 09:04:56 +0000 (09:04 +0000)]
Comment to XML conversion: escape XML special chars correctly; use correct
regex for version tuples.

llvm-svn: 165104

11 years agoThe top-level clang Makefile is #included into other Makefiles. (sigh) So we
Bill Wendling [Wed, 3 Oct 2012 08:39:19 +0000 (08:39 +0000)]
The top-level clang Makefile is #included into other Makefiles. (sigh) So we
can't have the logic here to add in the 'tools/{driver,libclang}' directories,
because they will be added in for ALL Makefiles which #include the top-level
one. Place the logic into the 'tools' Makefile.

llvm-svn: 165103

11 years agoFixed a bug in the ExecutionDependencyFix pass that caused dependencies to not propag...
Silviu Baranga [Wed, 3 Oct 2012 08:29:36 +0000 (08:29 +0000)]
Fixed a bug in the ExecutionDependencyFix pass that caused dependencies to not propagate through implicit defs.

llvm-svn: 165102

11 years agoFix an issue where we failed to adjust the alignment constraint on
Chandler Carruth [Wed, 3 Oct 2012 08:26:28 +0000 (08:26 +0000)]
Fix an issue where we failed to adjust the alignment constraint on
a memcpy to reflect that '0' has a different meaning when applied to
a load or store. Now we correctly use underaligned loads and stores for
the test case added.

llvm-svn: 165101

11 years agoTry to use a better set of abstractions for computing the alignment
Chandler Carruth [Wed, 3 Oct 2012 08:14:02 +0000 (08:14 +0000)]
Try to use a better set of abstractions for computing the alignment
necessary during rewriting. As part of this, fix a real think-o here
where we might have left off an alignment specification when the address
is in fact underaligned. I haven't come up with any way to trigger this,
as there is always some other factor that reduces the alignment, but it
certainly might have been an observable bug in some way I can't think
of. This also slightly changes the strategy for placing explicit
alignments on loads and stores to only do so when the alignment does not
match that required by the ABI. This causes a few redundant alignments
to go away from test cases.

I've also added a couple of tests that really push on the alignment that
we end up with on loads and stores. More to come here as I try to fix an
underlying bug I have conjectured and produced test cases for, although
it's not clear if this bug is the one currently hitting dragonegg's
gcc47 bootstrap.

llvm-svn: 165100

11 years agoRevert 165051-165049 while looking into the foreach.m failure in
Eric Christopher [Wed, 3 Oct 2012 08:10:01 +0000 (08:10 +0000)]
Revert 165051-165049 while looking into the foreach.m failure in
more detail.

llvm-svn: 165099

11 years agoAdd the missing backslash-newline which was causing make errors.
Bill Wendling [Wed, 3 Oct 2012 08:07:20 +0000 (08:07 +0000)]
Add the missing backslash-newline which was causing make errors.

llvm-svn: 165098

11 years agoMake sure 32-bit ASan runtime is available on 64-bit Linux platforms
Alexey Samsonov [Wed, 3 Oct 2012 07:23:03 +0000 (07:23 +0000)]
Make sure 32-bit ASan runtime is available on 64-bit Linux platforms

llvm-svn: 165097

11 years agoBuild ASan runtime on Linux for both x86_64 and i386, same as we do with full compile...
Alexey Samsonov [Wed, 3 Oct 2012 07:16:31 +0000 (07:16 +0000)]
Build ASan runtime on Linux for both x86_64 and i386, same as we do with full compiler_rt and libprofile

llvm-svn: 165096

11 years agoWhile I'm here, resync a %select with the enum definition it selects on.
Nico Weber [Wed, 3 Oct 2012 06:57:02 +0000 (06:57 +0000)]
While I'm here, resync a %select with the enum definition it selects on.

* nullptr used to be mapped to ERROR, now mapped to nullptr
* integral was missing
* expressions now have their own error message, so they won't reach
  this. Map them to ERROR.

Note that clang usually crashes before emitting this diagnostic anyway
(see PR13984), so this change alone doesn't have an observable effect.
It makes the code more correct though.

llvm-svn: 165095

11 years agoFix doxygen comment to match function name.
Craig Topper [Wed, 3 Oct 2012 06:47:18 +0000 (06:47 +0000)]
Fix doxygen comment to match function name.

llvm-svn: 165094

11 years agoMove expression mangling in the microsoft mangler to its own function.
Nico Weber [Wed, 3 Oct 2012 06:46:47 +0000 (06:46 +0000)]
Move expression mangling in the microsoft mangler to its own function.

This matches what's done in ItaniumMangle and makes it a bit easier
to implement mangling for more expressions. Also use the slightly nicer
"not yet implemented" error message from there.

No functionality change (except for the different error message).

llvm-svn: 165093

11 years agoRemove unused function that used to get itineraries from SubTargetFeatures. This...
Craig Topper [Wed, 3 Oct 2012 06:26:11 +0000 (06:26 +0000)]
Remove unused function that used to get itineraries from SubTargetFeatures. This is done from MCSubTargetInfo these days.

llvm-svn: 165092

11 years agoReplace a default: with an explicit list of cases. No functionality change.
Nico Weber [Wed, 3 Oct 2012 06:12:27 +0000 (06:12 +0000)]
Replace a default: with an explicit list of cases. No functionality change.

llvm-svn: 165091

11 years agoUpdate the block specification for some long-settled subleties.
John McCall [Wed, 3 Oct 2012 04:57:59 +0000 (04:57 +0000)]
Update the block specification for some long-settled subleties.

llvm-svn: 165090

11 years agoFix 80-column violation
Craig Topper [Wed, 3 Oct 2012 03:56:12 +0000 (03:56 +0000)]
Fix 80-column violation

llvm-svn: 165089

11 years agoInlineObjCInstanceMethod.m: Remove lines introduced in r165079. It broke some builds...
NAKAMURA Takumi [Wed, 3 Oct 2012 02:35:19 +0000 (02:35 +0000)]
InlineObjCInstanceMethod.m: Remove lines introduced in r165079. It broke some builds, on FreeBSD, Linux and Windows.

error: 'warning' diagnostics expected but not seen:
  Line 94: types are incompatible
1 error generated.

llvm-svn: 165088

11 years ago[PCH] Fix serialization of an ImportDecl.
Argyrios Kyrtzidis [Wed, 3 Oct 2012 01:58:45 +0000 (01:58 +0000)]
[PCH] Fix serialization of an ImportDecl.

ImportDecl's module ID was not written out and the reader accepted as module ID
the serialized:
  Record.push_back(!IdentifierLocs.empty());

llvm-svn: 165087

11 years agoSet the file entry for a Module* that was created during deserialization
Argyrios Kyrtzidis [Wed, 3 Oct 2012 01:58:42 +0000 (01:58 +0000)]
Set the file entry for a Module* that was created during deserialization
of a module file.

llvm-svn: 165086

11 years agoAdd a FIXME.
Argyrios Kyrtzidis [Wed, 3 Oct 2012 01:58:39 +0000 (01:58 +0000)]
Add a FIXME.

llvm-svn: 165085

11 years agoIntroduce ASTConsumer::HandleImplicitImportDecl() callback that is invoked
Argyrios Kyrtzidis [Wed, 3 Oct 2012 01:58:37 +0000 (01:58 +0000)]
Introduce ASTConsumer::HandleImplicitImportDecl() callback that is invoked
when an ImportDecl that was implicitly created due to an inclusion directive.

llvm-svn: 165084

11 years agoSome renames to use the 'visitor' nomenclature, no functionality change.
Argyrios Kyrtzidis [Wed, 3 Oct 2012 01:58:28 +0000 (01:58 +0000)]
Some renames to use the 'visitor' nomenclature, no functionality change.

llvm-svn: 165083

11 years agoImprove C++11 attribute parsing.
Michael Han [Wed, 3 Oct 2012 01:56:22 +0000 (01:56 +0000)]
Improve C++11 attribute parsing.

- General C++11 attributes were previously parsed and ignored. Now they are parsed and stored in AST.
- Add support to parse arguments of attributes that in 'gnu' namespace.
- Differentiate unknown attributes and known attributes that can't be applied to statements when emitting diagnostic.

llvm-svn: 165082

11 years agotest/ExecutionEngine/MCJIT: MCJIT should work also on mingw.
NAKAMURA Takumi [Wed, 3 Oct 2012 01:42:37 +0000 (01:42 +0000)]
test/ExecutionEngine/MCJIT: MCJIT should work also on mingw.

FIXME: Also cygwin?
llvm-svn: 165081

11 years agoThe kernel loading code is now isolated in the DynamicLoaderDarwinKernel;
Jason Molenda [Wed, 3 Oct 2012 01:29:34 +0000 (01:29 +0000)]
The kernel loading code is now isolated in the DynamicLoaderDarwinKernel;
remove the duplicates of this code in ProcessGDBRemote and ProcessKDP.
These two Process plugins will hardcode their DynamicLoader name to be
the DynamicLoaderDarwinKernel so the correct DynamicLoader is picked,
and return the kernel load address as the ImageInfosAddress.
<rdar://problem/12417038>

llvm-svn: 165080

11 years ago[analyzer] Adjust the return type of an inlined devirtualized method call.
Jordan Rose [Wed, 3 Oct 2012 01:08:35 +0000 (01:08 +0000)]
[analyzer] Adjust the return type of an inlined devirtualized method call.

In C++, overriding virtual methods are allowed to specify a covariant
return type -- that is, if the return type of the base method is an
object pointer type (or reference type), the overriding method's return
type can be a pointer to a subclass of the original type. The analyzer
was failing to take this into account when devirtualizing a method call,
and anything that relied on the return value having the proper type later
would crash.

In Objective-C, overriding methods are allowed to specify ANY return type,
meaning we can NEVER be sure that devirtualizing will give us a "safe"
return value. Of course, a program that does this will most likely crash
at runtime, but the analyzer at least shouldn't crash.

The solution is to check and see if the function/method being inlined is
the function that static binding would have picked. If not, check that
the return value has the same type. If the types don't match, see if we
can fix it with a derived-to-base cast (the C++ case). If we can't,
return UnknownVal to avoid crashing later.

<rdar://problem/12409977>

llvm-svn: 165079

11 years ago[analyzer] Push evalDynamicCast and evalDerivedToBase up to Store.
Jordan Rose [Wed, 3 Oct 2012 01:08:32 +0000 (01:08 +0000)]
[analyzer] Push evalDynamicCast and evalDerivedToBase up to Store.

These functions are store-agnostic, and would benefit from information in
DynamicTypeInfo but gain nothing from the store type.

No intended functionality change.

llvm-svn: 165078

11 years agoTeach getCXXRecordDeclForPointerType about references.
Jordan Rose [Wed, 3 Oct 2012 01:08:28 +0000 (01:08 +0000)]
Teach getCXXRecordDeclForPointerType about references.

Then, rename it getPointeeCXXRecordDecl and give it a nice doc comment,
and actually use it.

No intended functionality change.

llvm-svn: 165077

11 years agoThird try at fixing this. ;] Go back to using std::remove_if, which has
Chandler Carruth [Wed, 3 Oct 2012 01:04:07 +0000 (01:04 +0000)]
Third try at fixing this. ;] Go back to using std::remove_if, which has
most of the behavior we want, but wrap the predicate in one which erases
elements from the set if they pass the predicate. Oh what I wouldn't
give for a lambda here.

Let me know if the predicate wrapping is too much magic. ;]

llvm-svn: 165076

11 years agoThe early if conversion pass is ready to be used as an opt-in.
Jakob Stoklund Olesen [Wed, 3 Oct 2012 00:51:32 +0000 (00:51 +0000)]
The early if conversion pass is ready to be used as an opt-in.

Enable the pass by default for targets that request it, and change the
-enable-early-ifcvt to the opposite -disable-early-ifcvt.

There are still some x86 regressions when enabling early if-conversion
because of the missing machine models. Disable the pass for x86 until
machine models are added.

llvm-svn: 165075

11 years agoChange how the SelfReferenceChecker handles MemberExpr. Instead of treating
Richard Trieu [Wed, 3 Oct 2012 00:41:36 +0000 (00:41 +0000)]
Change how the SelfReferenceChecker handles MemberExpr.  Instead of treating
each one separately, process a stack of MemberExpr's as a single unit so that
static calls and member access will not be warned on.

llvm-svn: 165074

11 years agoSwitch the SetVector::remove_if implementation to use partition which
Chandler Carruth [Wed, 3 Oct 2012 00:03:00 +0000 (00:03 +0000)]
Switch the SetVector::remove_if implementation to use partition which
preserves the values of the relocated entries, unlikely remove_if. This
allows walking them and erasing them.

Also flesh out the predicate we are using for this to support the
various constraints actually imposed on a UnaryPredicate -- without this
we can't compose it with std::not1.

Thanks to Sean Silva for the review here and noticing the issue with
std::remove_if.

llvm-svn: 165073

11 years agoFix a serious X86 instruction selection bug. In
Evan Cheng [Tue, 2 Oct 2012 23:49:13 +0000 (23:49 +0000)]
Fix a serious X86 instruction selection bug. In
X86DAGToDAGISel::PreprocessISelDAG(), isel is moving load inside
callseq_start / callseq_end so it can be folded into a call. This can
create a cycle in the DAG when the call is glued to a copytoreg. We
have been lucky this hasn't caused too many issues because the pre-ra
scheduler has special handling of call sequences. However, it has
caused a crash in a specific tailcall case.

rdar://12393897

llvm-svn: 165072

11 years agoRevert "Don't use a debug location for frame setup instructions in the"
Eric Christopher [Tue, 2 Oct 2012 23:43:11 +0000 (23:43 +0000)]
Revert "Don't use a debug location for frame setup instructions in the"

This reverts 165055 and 165052 temporarily while I look at debugger
failures.

llvm-svn: 165071

11 years agoRevert 165058, per Jim request. This requires further discussion.
Chad Rosier [Tue, 2 Oct 2012 23:38:55 +0000 (23:38 +0000)]
Revert 165058, per Jim request.  This requires further discussion.

llvm-svn: 165070

11 years agoRevert 165057, per Jim's request. This requires further discussion.
Chad Rosier [Tue, 2 Oct 2012 23:38:50 +0000 (23:38 +0000)]
Revert 165057, per Jim's request.  This requires further discussion.

llvm-svn: 165069

11 years agoAdded a test for C++11 statement attributes serialization.
Alexander Kornienko [Tue, 2 Oct 2012 23:11:53 +0000 (23:11 +0000)]
Added a test for C++11 statement attributes serialization.

Summary: Uses [[clang::fallthrough]] attribute in a template function, and -Wimplicit-fallthrough to check the attribute presence in an instantiation.

Reviewers: rsmith

Reviewed By: rsmith

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

llvm-svn: 165068

11 years agoThe mips 64bit instructions DSLL, DSRA, DSRL, DEXT and DINS get transformed by the...
Jack Carter [Tue, 2 Oct 2012 23:09:40 +0000 (23:09 +0000)]
The mips 64bit instructions DSLL, DSRA, DSRL, DEXT and DINS get transformed by the assembler or through codegen direct object output to other variants based on the value of the immediate values of the operands.

If the code is generated as assembler, this transformation does not occur assuming that it will occur later in the assembler.

This code was originally called from  MipsAsmPrinter.cpp and we needed to check for OutStreamer.hasRawTextSupport(). This was not a good place for it and has been moved to MCTargetDesc/MipsMCCodeEmitter.cpp where both direct object and the assembler use it it automagically.

The test cases have been checked in for a number of weeks now.

llvm-svn: 165067

11 years ago[Doc parse]: SUpport for message in deprecated/unavailable
Fariborz Jahanian [Tue, 2 Oct 2012 23:01:04 +0000 (23:01 +0000)]
[Doc parse]: SUpport for message in deprecated/unavailable
attribute going iinto XML document.

llvm-svn: 165066

11 years agoTeach the new SROA to handle cases where an alloca that has already been
Chandler Carruth [Tue, 2 Oct 2012 22:46:45 +0000 (22:46 +0000)]
Teach the new SROA to handle cases where an alloca that has already been
scheduled for processing on the worklist eventually gets deleted while
we are processing another alloca, fixing the original test case in
PR13990.

To facilitate this, add a remove_if helper to the SetVector abstraction.
It's not easy to use the standard abstractions for this because of the
specifics of SetVectors types and implementation.

Finally, a nice small test case is included. Thanks to Benjamin for the
fantastic reduced test case here! All I had to do was delete some empty
basic blocks!

llvm-svn: 165065

11 years agoClean up these doxygen comments to follow the proposed new style. This
Chandler Carruth [Tue, 2 Oct 2012 22:46:40 +0000 (22:46 +0000)]
Clean up these doxygen comments to follow the proposed new style. This
also makes it more consistent with Clang and several passes' doxygen
style.

llvm-svn: 165064

11 years agoMake sure to put our sret argument into %rax on x86-64. Fixes PR13563!
Nick Lewycky [Tue, 2 Oct 2012 22:45:06 +0000 (22:45 +0000)]
Make sure to put our sret argument into %rax on x86-64. Fixes PR13563!

llvm-svn: 165063

11 years agoRemove the old coalescer algorithm.
Jakob Stoklund Olesen [Tue, 2 Oct 2012 22:45:03 +0000 (22:45 +0000)]
Remove the old coalescer algorithm.

The new algorithm has been enabled by default for almost a week now and
seems to be stable.

llvm-svn: 165062

11 years agoChange DynamicLoaderDarwinKernel::OSKextLoadedKextSummary to use
Jason Molenda [Tue, 2 Oct 2012 22:23:42 +0000 (22:23 +0000)]
Change DynamicLoaderDarwinKernel::OSKextLoadedKextSummary to use
the Symbols::LocateExecutableObjectFile method to locate kexts and
kernels instead of copying them out of the memory of the remote
system.  This is the fix for <rdar://problem/12416384>.

Fix a variable shadowing problem in
Symbols::LocateMacOSXFilesUsingDebugSymbols which caused the symbol
rich executable binaries to not be found even if they were listed
in the dSYM Info.plist.

Change Symbols::DownloadObjectAndSymbolFile to ignore dsymForUUID's
negative cache - this is typically being called by the user and we
should try even if there's a incorrect entry in the negative cache.

llvm-svn: 165061

11 years agoHandle reserved registers more accurately in handleMove().
Jakob Stoklund Olesen [Tue, 2 Oct 2012 22:08:36 +0000 (22:08 +0000)]
Handle reserved registers more accurately in handleMove().

Reserved register live ranges look like a set of dead defs - any uses of
reserved registers are ignored.

Instead of skipping the updating of reserved register operands entirely,
just ignore the use operands and treat the def operands normally.

No test case, handleMove() is not commonly used yet.

llvm-svn: 165060

11 years agoSilence -Wunused-value warning.
Ted Kremenek [Tue, 2 Oct 2012 21:50:18 +0000 (21:50 +0000)]
Silence -Wunused-value warning.

llvm-svn: 165059

11 years ago[ms-inline asm] Rewrite the symbol references as wildcard MCParsedAsmOperands.
Chad Rosier [Tue, 2 Oct 2012 21:49:14 +0000 (21:49 +0000)]
[ms-inline asm] Rewrite the symbol references as wildcard MCParsedAsmOperands.
A Sema lookup is used to determine the size of the variable, which is in turn
used during wildcard matching.

llvm-svn: 165058

11 years ago[ms-inline asm] Add basic support for wildcard MCParsedAsmOperands. This type
Chad Rosier [Tue, 2 Oct 2012 21:49:07 +0000 (21:49 +0000)]
[ms-inline asm] Add basic support for wildcard MCParsedAsmOperands.  This type
of operand is specific to MS-style inline assembly and should not be generated
when parsing normal assembly.

The purpose of the wildcard operands are to allow the AsmParser to match
multiple instructions (i.e., MCInsts) to a given ms-style asm statement.  For
the time being the matcher just returns the first match.  This patch only
implements wildcard matches for memory operands.  Support for register
wildcards will be added in the near future.

llvm-svn: 165057

11 years agoMake sure the whole live range is covered when values are pruned twice.
Jakob Stoklund Olesen [Tue, 2 Oct 2012 21:46:39 +0000 (21:46 +0000)]
Make sure the whole live range is covered when values are pruned twice.

JoinVals::pruneValues() calls LIS->pruneValue() to avoid conflicts when
overlapping two different values. This produces a set of live range end
points that are used to reconstruct the live range (with SSA update)
after joining the two registers.

When a value is pruned twice, the set of end points was insufficient:

  v1 = DEF
  v1 = REPLACE1
  v1 = REPLACE2
  KILL v1

The end point at KILL would only reconstruct the live range from
REPLACE2 to KILL, leaving the range REPLACE1-REPLACE2 dead.

Add REPLACE2 as an end point in this case so the full live range is
reconstructed.

This fixes PR13999.

llvm-svn: 165056

11 years agoAllow alternate instructions to silence bot.
Eric Christopher [Tue, 2 Oct 2012 21:44:16 +0000 (21:44 +0000)]
Allow alternate instructions to silence bot.

llvm-svn: 165055

11 years ago80-col.
Eric Christopher [Tue, 2 Oct 2012 21:44:12 +0000 (21:44 +0000)]
80-col.

llvm-svn: 165054

11 years agoClean-up of memory buffer and object ownership model in MCJIT
Andrew Kaylor [Tue, 2 Oct 2012 21:18:39 +0000 (21:18 +0000)]
Clean-up of memory buffer and object ownership model in MCJIT

llvm-svn: 165053

11 years agoDon't use a debug location for frame setup instructions in the
Eric Christopher [Tue, 2 Oct 2012 21:17:00 +0000 (21:17 +0000)]
Don't use a debug location for frame setup instructions in the
prologue. Also skip frame setup instructions when looking for the
first location.

llvm-svn: 165052

11 years agoUse the existing DebugLoc.
Eric Christopher [Tue, 2 Oct 2012 21:16:55 +0000 (21:16 +0000)]
Use the existing DebugLoc.

llvm-svn: 165051

11 years agoMake the location a parameter since we may not want the next one
Eric Christopher [Tue, 2 Oct 2012 21:16:53 +0000 (21:16 +0000)]
Make the location a parameter since we may not want the next one
in the block.

llvm-svn: 165050

11 years agoRemove the SavePoint infrastructure from fast isel, replace
Eric Christopher [Tue, 2 Oct 2012 21:16:50 +0000 (21:16 +0000)]
Remove the SavePoint infrastructure from fast isel, replace
with just an insert point from the MachineBasicBlock and let
the location be updated as we access it.

llvm-svn: 165049

11 years agoChanged test output comparison to be consistent with the way llvm-objdump and llvm...
Hemant Kulkarni [Tue, 2 Oct 2012 21:12:21 +0000 (21:12 +0000)]
Changed test output comparison to be consistent with the way llvm-objdump and llvm-readobj work.

llvm-svn: 165048

11 years ago[PCH/Module] Change the map of file-level DeclIDs to use a FileID
Argyrios Kyrtzidis [Tue, 2 Oct 2012 21:09:17 +0000 (21:09 +0000)]
[PCH/Module] Change the map of file-level DeclIDs to use a FileID
as key instead of a SLocEntry pointer. This allows the array of
file sorted declarations in a PCH/module to be deterministic.

llvm-svn: 165047

11 years ago[libclang] When indexing an AST file, only deserialize the file level
Argyrios Kyrtzidis [Tue, 2 Oct 2012 21:09:13 +0000 (21:09 +0000)]
[libclang] When indexing an AST file, only deserialize the file level
declarations of the current primary module.

llvm-svn: 165046

11 years ago[ms-inline asm] Fixup test case to be valid ms-style asm. Fix whitespace.
Chad Rosier [Tue, 2 Oct 2012 20:55:30 +0000 (20:55 +0000)]
[ms-inline asm] Fixup test case to be valid ms-style asm.  Fix whitespace.

llvm-svn: 165045

11 years agoRefactor clients of AnalyzerOptions::getBooleanOption() to have
Ted Kremenek [Tue, 2 Oct 2012 20:42:16 +0000 (20:42 +0000)]
Refactor clients of AnalyzerOptions::getBooleanOption() to have
an intermediate helper method to query and populate the Optional value.

llvm-svn: 165043

11 years agoSet the 'build clang only' flag when we're building only clang.
Bill Wendling [Tue, 2 Oct 2012 20:32:23 +0000 (20:32 +0000)]
Set the 'build clang only' flag when we're building only clang.

llvm-svn: 165042