platform/upstream/llvm.git
12 years agoClean up tailing whitespaces
Michael Liao [Wed, 3 Oct 2012 23:43:52 +0000 (23:43 +0000)]
Clean up tailing whitespaces

llvm-svn: 165182

12 years agoAdded missing break in StockSectionChunk constructor.
Hemant Kulkarni [Wed, 3 Oct 2012 23:27:33 +0000 (23:27 +0000)]
Added missing break in StockSectionChunk constructor.
Removed architecture dependent .sbss section creation.

Updated test case to show the change in section types and removal of a sbss section.

llvm-svn: 165181

12 years agoAdded instregex support to TableGen subtarget emitter.
Andrew Trick [Wed, 3 Oct 2012 23:06:32 +0000 (23:06 +0000)]
Added instregex support to TableGen subtarget emitter.

This allows the processor-specific machine model to override selected
base opcodes without any fanciness.
e.g. InstRW<[CoreXWriteVANDP], (instregex "VANDP")>.

llvm-svn: 165180

12 years agoTableGen subtarget emitter, nearly first class support for SchedAlias.
Andrew Trick [Wed, 3 Oct 2012 23:06:28 +0000 (23:06 +0000)]
TableGen subtarget emitter, nearly first class support for SchedAlias.

A processor can now arbitrarily alias one SchedWrite onto
another. Only the SchedAlias definition need be within the processor
model. The aliased SchedWrite may be a SchedVariant, WriteSequence, or
transitively refer to another alias.

llvm-svn: 165179

12 years agoCleanup TableGen subtarget emitter.
Andrew Trick [Wed, 3 Oct 2012 23:06:25 +0000 (23:06 +0000)]
Cleanup TableGen subtarget emitter.

llvm-svn: 165178

12 years agouse ';' instead of '-' in the note part of my last patch.
Fariborz Jahanian [Wed, 3 Oct 2012 22:39:32 +0000 (22:39 +0000)]
use ';' instead of '-' in the note part of my last patch.

llvm-svn: 165177

12 years agoDon't turn on the debugserver log by default.
Jim Ingham [Wed, 3 Oct 2012 22:31:30 +0000 (22:31 +0000)]
Don't turn on the debugserver log by default.

llvm-svn: 165176

12 years agoUpdate test case for r165174.
Chad Rosier [Wed, 3 Oct 2012 22:18:51 +0000 (22:18 +0000)]
Update test case for r165174.

llvm-svn: 165175

12 years ago[ms-inline asm] Default to the 'm' constraint. This matches the behavior of the
Chad Rosier [Wed, 3 Oct 2012 22:18:38 +0000 (22:18 +0000)]
[ms-inline asm] Default to the 'm' constraint.  This matches the behavior of the
MSVC compiler.

llvm-svn: 165174

12 years ago[ms-inline asm] Add support in the X86AsmPrinter for printing memory references
Chad Rosier [Wed, 3 Oct 2012 22:06:44 +0000 (22:06 +0000)]
[ms-inline asm] Add support in the X86AsmPrinter for printing memory references
in the Intel syntax.

The MC layer supports emitting in the Intel syntax, but this would require the
inline assembly MachineInstr to be lowered to an MCInst before emission.  This
is potential future work, but for now emitting directly from the MachineInstr
suffices.

llvm-svn: 165173

12 years agoThis patch moves from using a hard coded number (4)
Jack Carter [Wed, 3 Oct 2012 21:58:54 +0000 (21:58 +0000)]
This patch moves from using a hard coded number (4)
for the number of bytes in a particular instruction
to using
   const MCInstrDesc &Desc = MCII.get(TmpInst.getOpcode());
   Desc.getSize()

This is necessary with the advent of 16 bit instructions with
mips16 and micromips. It is also puts Mips in compliance with
the other targets for getting instruction size.

llvm-svn: 165171

12 years ago * Return correct size and alignment for common symbols.
Sid Manning [Wed, 3 Oct 2012 21:46:48 +0000 (21:46 +0000)]
  * Return correct size and alignment for common symbols.

llvm-svn: 165170

12 years ago<rdar://problem/12408181> Fixing a bug where we would try to look for types in a...
Enrico Granata [Wed, 3 Oct 2012 21:31:35 +0000 (21:31 +0000)]
<rdar://problem/12408181> Fixing a bug where we would try to look for types in a module, and then fail to look for them anywhere else because the same SymbolContext was being passed everywhere

llvm-svn: 165169

12 years agotblgen: Remove last traces of old TableGenMain API.
Sean Silva [Wed, 3 Oct 2012 21:31:08 +0000 (21:31 +0000)]
tblgen: Remove last traces of old TableGenMain API.

llvm-svn: 165168

12 years agotblgen: Migrate clang-tblgen to new TableGenMain API.
Sean Silva [Wed, 3 Oct 2012 21:29:30 +0000 (21:29 +0000)]
tblgen: Migrate clang-tblgen to new TableGenMain API.

llvm-svn: 165167

12 years agotblgen: Migrate llvm-tblgen to new TableGenMain API.
Sean Silva [Wed, 3 Oct 2012 21:29:19 +0000 (21:29 +0000)]
tblgen: Migrate llvm-tblgen to new TableGenMain API.

llvm-svn: 165166

12 years agotblgen: Put new TableGenMain API in place.
Sean Silva [Wed, 3 Oct 2012 21:29:18 +0000 (21:29 +0000)]
tblgen: Put new TableGenMain API in place.

In order to avoid rev-lock with Clang when moving to the new API, also
preserve the current API temporarily and insert a shim to implement the
new API in terms of the old.

llvm-svn: 165165

12 years agoAdd function to return return attributes.
Bill Wendling [Wed, 3 Oct 2012 21:19:35 +0000 (21:19 +0000)]
Add function to return return attributes.

llvm-svn: 165164

12 years agoUpdate to use the predicate methods to query if an attribute exists.
Bill Wendling [Wed, 3 Oct 2012 21:17:09 +0000 (21:17 +0000)]
Update to use the predicate methods to query if an attribute exists.

llvm-svn: 165163

12 years agoRemove the directory that these are already in.
Bill Wendling [Wed, 3 Oct 2012 21:08:21 +0000 (21:08 +0000)]
Remove the directory that these are already in.

llvm-svn: 165162

12 years ago[libclang] When indexing, invoke the importedASTFile for PCH files as well.
Argyrios Kyrtzidis [Wed, 3 Oct 2012 21:05:51 +0000 (21:05 +0000)]
[libclang] When indexing, invoke the importedASTFile for PCH files as well.

llvm-svn: 165161

12 years ago[libclang] Simplify indexing of module imports by handling implicit
Argyrios Kyrtzidis [Wed, 3 Oct 2012 21:05:44 +0000 (21:05 +0000)]
[libclang] Simplify indexing of module imports by handling implicit
imports via ImportDecls.

llvm-svn: 165160

12 years agoBack out my temporary workaround for Apple buildbots.
Bob Wilson [Wed, 3 Oct 2012 21:03:42 +0000 (21:03 +0000)]
Back out my temporary workaround for Apple buildbots.
--- Reverse-merging r164909 into '.':
U    make/platform/clang_darwin.mk

llvm-svn: 165159

12 years agoPR14004: Fix typo in documentation.
Richard Smith [Wed, 3 Oct 2012 21:02:25 +0000 (21:02 +0000)]
PR14004: Fix typo in documentation.

llvm-svn: 165158

12 years agoFix invalid reads by memcmp.
Benjamin Kramer [Wed, 3 Oct 2012 20:58:09 +0000 (20:58 +0000)]
Fix invalid reads by memcmp.

Str may be smaller than Start->Name here. Use strncmp to avoid scanning past the
end. Found by valgrind.

llvm-svn: 165157

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

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

llvm-svn: 165141

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

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

llvm-svn: 165085

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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

12 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