platform/upstream/llvm.git
11 years agoUpdate the version of dwarf we say we're emitting to at least 3.
Eric Christopher [Tue, 9 Apr 2013 20:22:47 +0000 (20:22 +0000)]
Update the version of dwarf we say we're emitting to at least 3.

Deals with a dwarf2 -> dwarf3 DW_FORM_ref_addr change.

llvm-svn: 179122

11 years ago[libclang] In cxtu::getASTUnit(), check for a null CXTranslationUnit.
Argyrios Kyrtzidis [Tue, 9 Apr 2013 20:03:03 +0000 (20:03 +0000)]
[libclang] In cxtu::getASTUnit(), check for a null CXTranslationUnit.

llvm-svn: 179121

11 years agoRevert r179115 as it looks to have killed the ASan tests.
Chad Rosier [Tue, 9 Apr 2013 19:59:12 +0000 (19:59 +0000)]
Revert r179115 as it looks to have killed the ASan tests.

llvm-svn: 179120

11 years agoRationalize the formatting of these case labels. Having two sorted
Chandler Carruth [Tue, 9 Apr 2013 19:46:46 +0000 (19:46 +0000)]
Rationalize the formatting of these case labels. Having two sorted
columns is essentially impossible to edit.

llvm-svn: 179119

11 years agoThis patch enables llvm to switch between compiling for mips32/mips64
Reed Kotler [Tue, 9 Apr 2013 19:46:01 +0000 (19:46 +0000)]
This patch enables llvm to switch between compiling for mips32/mips64
and mips16 on a per function basis.

Because this patch is somewhat involved I have provide an overview of the
key pieces of it.

The patch is written so as to not change the behavior of the non mixed
mode. We have tested this a lot but it is something new to switch subtargets
so we don't want any chance of regression in the mainline compiler until
we have more confidence in this.

Mips32/64 are very different from Mip16 as is the case of ARM vs Thumb1.
For that reason there are derived versions of the register info, frame info,
instruction info and instruction selection classes.

Now we register three separate passes for instruction selection.
One which is used to switch subtargets (MipsModuleISelDAGToDAG.cpp) and then
one for each of the current subtargets (Mips16ISelDAGToDAG.cpp and
MipsSEISelDAGToDAG.cpp).

When the ModuleISel pass runs, it determines if there is a need to switch
subtargets and if so, the owning pointers in MipsTargetMachine are
appropriately changed.

When 16Isel or SEIsel is run, they will return immediately without doing
any work if the current subtarget mode does not apply to them.

In addition, MipsAsmPrinter needs to be reset on a function basis.

The pass BasicTargetTransformInfo is substituted with a null pass since the
pass is immutable and really needs to be a function pass for it to be
used with changing subtargets. This will be fixed in a follow on patch.

llvm-svn: 179118

11 years agoAdd support for bottom-up SLP vectorization infrastructure.
Nadav Rotem [Tue, 9 Apr 2013 19:44:35 +0000 (19:44 +0000)]
Add support for bottom-up SLP vectorization infrastructure.

This commit adds the infrastructure for performing bottom-up SLP vectorization (and other optimizations) on parallel computations.
The infrastructure has three potential users:

  1. The loop vectorizer needs to be able to vectorize AOS data structures such as (sum += A[i] + A[i+1]).

  2. The BB-vectorizer needs this infrastructure for bottom-up SLP vectorization, because bottom-up vectorization is faster to compute.

  3. A loop-roller needs to be able to analyze consecutive chains and roll them into a loop, in order to reduce code size. A loop roller does not need to create vector instructions, and this infrastructure separates the chain analysis from the vectorization.

This patch also includes a simple (100 LOC) bottom up SLP vectorizer that uses the infrastructure, and can vectorize this code:

void SAXPY(int *x, int *y, int a, int i) {
  x[i]   = a * x[i]   + y[i];
  x[i+1] = a * x[i+1] + y[i+1];
  x[i+2] = a * x[i+2] + y[i+2];
  x[i+3] = a * x[i+3] + y[i+3];
}

llvm-svn: 179117

11 years agoMake check depend on all.
Eric Christopher [Tue, 9 Apr 2013 19:42:12 +0000 (19:42 +0000)]
Make check depend on all.

llvm-svn: 179116

11 years ago[ms-inline asm] Use parsePrimaryExpr in lieu of parseExpression if we need to
Chad Rosier [Tue, 9 Apr 2013 19:34:59 +0000 (19:34 +0000)]
[ms-inline asm] Use parsePrimaryExpr in lieu of parseExpression if we need to
parse an identifier.  Otherwise, parseExpression may parse multiple tokens,
which makes it impossible to properly compute an immediate displacement.
An example of such a case is the source operand (i.e., [Symbol + ImmDisp]) in
the below example:

 __asm mov eax, [Symbol + ImmDisp]

The existing test cases exercise this patch.
rdar://13611297

llvm-svn: 179115

11 years agoThe .dwo section shouldn't contain the unrelocated values (and
Eric Christopher [Tue, 9 Apr 2013 19:23:15 +0000 (19:23 +0000)]
The .dwo section shouldn't contain the unrelocated values (and
therefore not at all) of the pc or statement list. We also don't
need to emit the compilation dir so save so space and time
and don't bother.

Fix up the testcase accordingly and verify that we don't emit
the attributes or the items that they use.

llvm-svn: 179114

11 years agoCleanup PPCEarlyReturn
Hal Finkel [Tue, 9 Apr 2013 18:25:18 +0000 (18:25 +0000)]
Cleanup PPCEarlyReturn

Some general cleanup and only scan the end of a BB for branches (once we're
done with the terminators and debug values, then there should not be any other
branches). These address post-commit review suggestions by Bill Schmidt.

No functionality change intended.

llvm-svn: 179112

11 years agoRevert r176408 and r176407 to address PR15540.
Nadav Rotem [Tue, 9 Apr 2013 18:16:05 +0000 (18:16 +0000)]
Revert r176408 and r176407 to address PR15540.

llvm-svn: 179111

11 years agoFix the help message for “one-shot”.
Jim Ingham [Tue, 9 Apr 2013 18:05:22 +0000 (18:05 +0000)]
Fix the help message for “one-shot”.

llvm-svn: 179110

11 years ago[ms-inline asm] Maintain a StringRef to reference a symbol in a parsed operand,
Chad Rosier [Tue, 9 Apr 2013 17:53:49 +0000 (17:53 +0000)]
[ms-inline asm] Maintain a StringRef to reference a symbol in a parsed operand,
rather than deriving the StringRef from the Start and End SMLocs.

Using the Start and End SMLocs works fine for operands such as [Symbol], but
not for operands such as [Symbol + ImmDisp].  All existing test cases that
reference a variable exercise this patch.
rdar://13602265

llvm-svn: 179109

11 years agoObjective-C: This patch fixes a none-issuance of warning
Fariborz Jahanian [Tue, 9 Apr 2013 17:52:29 +0000 (17:52 +0000)]
Objective-C: This patch fixes a none-issuance of warning
when result type of protocol property and getter method
differ by fixing a more serious problem. When a forward
protocol declaration comes between its definition and
its use in class protocol list, the forward protocol
ast was being used in building the protocol list.
// rdar://12522752

llvm-svn: 179108

11 years agoFix comments before labels.
Daniel Jasper [Tue, 9 Apr 2013 17:46:55 +0000 (17:46 +0000)]
Fix comments before labels.

Before:
switch (...) {
  // a
  // b
// c
case first:
  break;
}

After:
switch (...) {
// a
// b
// c
case first:
  break;
}

llvm-svn: 179107

11 years agoDAGCombiner: Fold a shuffle on CONCAT_VECTORS into a new CONCAT_VECTORS if possible.
Benjamin Kramer [Tue, 9 Apr 2013 17:41:43 +0000 (17:41 +0000)]
DAGCombiner: Fold a shuffle on CONCAT_VECTORS into a new CONCAT_VECTORS if possible.

This pattern occurs in SROA output due to the way vector arguments are lowered
on ARM.

The testcase from PR15525 now compiles into this, which is better than the code
we got with the old scalarrepl:
_Store:
ldr.w r9, [sp]
vmov d17, r3, r9
vmov d16, r1, r2
vst1.8 {d16, d17}, [r0]
bx lr

Differential Revision: http://llvm-reviews.chandlerc.com/D647

llvm-svn: 179106

11 years agoUse virtual base registers on PPC
Hal Finkel [Tue, 9 Apr 2013 17:27:09 +0000 (17:27 +0000)]
Use virtual base registers on PPC

On PowerPC, non-vector loads and stores have r+i forms; however, in functions
with large stack frames these were not being used to access slots far from the
stack pointer because such slots were out of range for the signed 16-bit
immediate offset field. This increases register pressure because we need a
separate register for each offset (when the r+r form is used). By enabling
virtual base registers, we can deal with large stack frames without unduly
increasing register pressure.

llvm-svn: 179105

11 years agoConvert test PowerPC/2007-09-07-LoadStoreIdxForms to FileCheck
Hal Finkel [Tue, 9 Apr 2013 17:26:55 +0000 (17:26 +0000)]
Convert test PowerPC/2007-09-07-LoadStoreIdxForms to FileCheck

llvm-svn: 179104

11 years agoFix UseNullptr fails to replace c-style explicit cast in a return statement
Ariel J. Bernal [Tue, 9 Apr 2013 16:54:56 +0000 (16:54 +0000)]
Fix UseNullptr fails to replace c-style explicit cast in a return statement

This happens whenever there is a c-style explicit cast to nullptr not
surrounded by parentheses following a return statement.

- Added a white space before nullptr if the character before is alphanumeric
  when replacing the null pointer expression.
- Simplified visitor
- Addes tests

llvm-svn: 179103

11 years agoRewrite test/Linker tests to use FileCheck instead of grep.
Eli Bendersky [Tue, 9 Apr 2013 16:51:13 +0000 (16:51 +0000)]
Rewrite test/Linker tests to use FileCheck instead of grep.

Some translations here are not 1x1 because there are grep|grep
chains that are non-trivial to implement in terms of FileCheck features. I
made an effort for the tests to remain as similar as possible; do let me know
if you notice anything fishy. The good news are that some buggy tests were
fixed (grep | not grep - a bug waiting to happen).

llvm-svn: 179102

11 years agoAgain macros without trailing semicolons: don't care about declaration context.
Alexander Kornienko [Tue, 9 Apr 2013 16:15:19 +0000 (16:15 +0000)]
Again macros without trailing semicolons: don't care about declaration context.

Summary:
Some codebases use these kinds of macros in functions, e.g. Chromium's
IPC_BEGIN_MESSAGE_MAP, IPC_BEGIN_MESSAGE_HANDLER, etc.

Reviewers: djasper, klimek

Reviewed By: klimek

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

llvm-svn: 179099

11 years agoImprovements to clang-format integrations.
Daniel Jasper [Tue, 9 Apr 2013 15:23:04 +0000 (15:23 +0000)]
Improvements to clang-format integrations.

This adds an emacs editor integration (thanks to Ami Fischman). Also
pulls out the style into a variable for the vi integration and just
uses clang-formats defaults style in clang-format-diff.py.

llvm-svn: 179098

11 years agoConvert MachOObjectFile to a template.
Rafael Espindola [Tue, 9 Apr 2013 14:49:08 +0000 (14:49 +0000)]
Convert MachOObjectFile to a template.

For now it is templated only on being 64 or 32 bits. I will add little/big
endian next.

llvm-svn: 179097

11 years ago[sanitizer] Interceptors for wait*.
Evgeniy Stepanov [Tue, 9 Apr 2013 14:34:59 +0000 (14:34 +0000)]
[sanitizer] Interceptors for wait*.

llvm-svn: 179096

11 years agoDWARF parser: Fix DWARF-2/3 incompatibility: size of DW_FORM_ref_addr is the same...
Alexey Samsonov [Tue, 9 Apr 2013 14:09:42 +0000 (14:09 +0000)]
DWARF parser: Fix DWARF-2/3 incompatibility: size of DW_FORM_ref_addr is the same as DW_FORM_addr in DWARF2, and is 4/8 bytes on 32/64-bit DWARF starting from DWARF3. Adding a test for this is a huge pain - generating and uploading pre-built binary with DWARF3 debug info is way too ugly, and writing fine-grained unittests for DebugInfo is impossible, as it doesn't expose any headers in include/llvm. That said, I'm going to choose the second approach and submit the patch exposing DebugInfo headers for review soon enough.

llvm-svn: 179095

11 years agoMention the changes in the handling of language linkage in the release notes.
Rafael Espindola [Tue, 9 Apr 2013 12:51:24 +0000 (12:51 +0000)]
Mention the changes in the handling of language linkage in the release notes.

llvm-svn: 179094

11 years ago[ms-cxxabi] Add "$$C" when mangling template arg QualTypes
Reid Kleckner [Tue, 9 Apr 2013 12:47:38 +0000 (12:47 +0000)]
[ms-cxxabi] Add "$$C" when mangling template arg QualTypes

Credit goes to Timur Iskhodzhanov for finding the problem and solution.

llvm-svn: 179093

11 years agoOne more follow-up to r179082 - parse PIC/PIE arguments even on platfroms that force...
Alexey Samsonov [Tue, 9 Apr 2013 12:28:19 +0000 (12:28 +0000)]
One more follow-up to r179082 - parse PIC/PIE arguments even on platfroms that force default PIC (like Darwin x86-64), otherwise specifying -fPIC will produce bogus unused argument warning

llvm-svn: 179092

11 years ago[msan] Intercept glob() with tests.
Evgeniy Stepanov [Tue, 9 Apr 2013 11:35:13 +0000 (11:35 +0000)]
[msan] Intercept glob() with tests.

llvm-svn: 179091

11 years ago[Sanitizer] fix TSan tests: remove global ctor from sanitizer_common, run load_shared...
Alexey Samsonov [Tue, 9 Apr 2013 07:46:20 +0000 (07:46 +0000)]
[Sanitizer] fix TSan tests: remove global ctor from sanitizer_common, run load_shared_lib test only in lit

llvm-svn: 179090

11 years agoFollow-up for r179082: more careful handling of -f(no-)sanitize-address-zero-base...
Alexey Samsonov [Tue, 9 Apr 2013 07:27:44 +0000 (07:27 +0000)]
Follow-up for r179082: more careful handling of -f(no-)sanitize-address-zero-base-shadow on Android

llvm-svn: 179089

11 years ago[asan] relax Linux/zero-base-shadow.cc to make it pass on newer Ubuntu; fix lint
Kostya Serebryany [Tue, 9 Apr 2013 07:08:05 +0000 (07:08 +0000)]
[asan] relax Linux/zero-base-shadow.cc to make it pass on newer Ubuntu; fix lint

llvm-svn: 179088

11 years agoConverted 8x tests of SimplifyCFG to use FileCheck instead of grep.
Michael Gottesman [Tue, 9 Apr 2013 05:18:53 +0000 (05:18 +0000)]
Converted 8x tests of SimplifyCFG to use FileCheck instead of grep.

llvm-svn: 179087

11 years agoExtract a function.
Jakob Stoklund Olesen [Tue, 9 Apr 2013 05:11:52 +0000 (05:11 +0000)]
Extract a function.

llvm-svn: 179086

11 years agoRemove the confusing sentence.
Nadav Rotem [Tue, 9 Apr 2013 04:48:40 +0000 (04:48 +0000)]
Remove the confusing sentence.

llvm-svn: 179085

11 years agoRevert 179071 because it is not the right way to support non standard new/new[] opera...
Nadav Rotem [Tue, 9 Apr 2013 04:43:46 +0000 (04:43 +0000)]
Revert 179071 because it is not the right way to support non standard new/new[] operators.

llvm-svn: 179084

11 years agoCompute correct frame sizes for SPARC v9 64-bit frames.
Jakob Stoklund Olesen [Tue, 9 Apr 2013 04:37:47 +0000 (04:37 +0000)]
Compute correct frame sizes for SPARC v9 64-bit frames.

The save area is twice as big and there is no struct return slot. The
stack pointer is always 16-byte aligned (after adding the bias).

Also eliminate the stack adjustment instructions around calls when the
function has a reserved stack frame.

llvm-svn: 179083

11 years agoIf the user requested a zero-base-shadow sanitizer, infer -pie and -fPIC when appropr...
Peter Collingbourne [Tue, 9 Apr 2013 04:35:11 +0000 (04:35 +0000)]
If the user requested a zero-base-shadow sanitizer, infer -pie and -fPIC when appropriate.

Differential Revision: http://llvm-reviews.chandlerc.com/D502

llvm-svn: 179082

11 years ago[analyzer] Replace isIntegerType() with isIntegerOrEnumerationType().
Jordan Rose [Tue, 9 Apr 2013 02:30:33 +0000 (02:30 +0000)]
[analyzer] Replace isIntegerType() with isIntegerOrEnumerationType().

Previously, the analyzer used isIntegerType() everywhere, which uses the C
definition of "integer". The C++ predicate with the same behavior is
isIntegerOrUnscopedEnumerationType().

However, the analyzer is /really/ using this to ask if it's some sort of
"integrally representable" type, i.e. it should include C++11 scoped
enumerations as well. hasIntegerRepresentation() sounds like the right
predicate, but that includes vectors, which the analyzer represents by its
elements.

This commit audits all uses of isIntegerType() and replaces them with the
general isIntegerOrEnumerationType(), except in some specific cases where
it makes sense to exclude scoped enumerations, or any enumerations. These
cases now use isIntegerOrUnscopedEnumerationType() and getAs<BuiltinType>()
plus BuiltinType::isInteger().

isIntegerType() is hereby banned in the analyzer - lib/StaticAnalysis and
include/clang/StaticAnalysis. :-)

Fixes real assertion failures. PR15703 / <rdar://problem/12350701>

llvm-svn: 179081

11 years agoWhen checking for illegal expressions in a default-argument
John McCall [Tue, 9 Apr 2013 01:56:28 +0000 (01:56 +0000)]
When checking for illegal expressions in a default-argument
expression, look through pseudo-object expressions.

rdar://13602832

llvm-svn: 179080

11 years agoSkip transparent contexts when looking for using directives in name lookup.
Douglas Gregor [Tue, 9 Apr 2013 01:49:26 +0000 (01:49 +0000)]
Skip transparent contexts when looking for using directives in name lookup.

Fixes the bootstrap regression I introduced in r179067.

llvm-svn: 179079

11 years agoMark as referenced the functions from instantiated UserDefinedLiterals.
Argyrios Kyrtzidis [Tue, 9 Apr 2013 01:17:02 +0000 (01:17 +0000)]
Mark as referenced the functions from instantiated UserDefinedLiterals.

Fixes rdar://13589856

llvm-svn: 179078

11 years agoFixed the way we allocate executable memory on
Sean Callanan [Tue, 9 Apr 2013 01:13:08 +0000 (01:13 +0000)]
Fixed the way we allocate executable memory on
behalf of the JIT.  We don't need it to be writable
since we are using special APIs to write into it.

<rdar://problem/13599185>

llvm-svn: 179077

11 years agoMore uses for SymbolTableEntryBase.
Rafael Espindola [Tue, 9 Apr 2013 01:04:06 +0000 (01:04 +0000)]
More uses for SymbolTableEntryBase.

llvm-svn: 179076

11 years ago[analyzer] Keep tracking the pointer after the escape to more aggressively report...
Anna Zaks [Tue, 9 Apr 2013 00:30:28 +0000 (00:30 +0000)]
[analyzer] Keep tracking the pointer after the escape to more aggressively report mismatched deallocator

Test that the path notes do not change. I don’t think we should print a note on escape.

Also, I’ve removed a check that assumed that the family stored in the RefStete could be
AF_None and added an assert in the constructor.

llvm-svn: 179075

11 years agoAdd a SymbolTableEntryBase.
Rafael Espindola [Tue, 9 Apr 2013 00:22:58 +0000 (00:22 +0000)]
Add a SymbolTableEntryBase.

Use it when we don't need to know if we have a 32 or 64 bit SymbolTableEntry.

llvm-svn: 179074

11 years agoFix PointerIntPair to be enum class compatible.
Joe Groff [Tue, 9 Apr 2013 00:01:51 +0000 (00:01 +0000)]
Fix PointerIntPair to be enum class compatible.

Some parts of PointerIntPair assumed that the IntType of the pair was implicitly
convertible to intptr_t, which is not the case for enum class values. Add a
static_cast<intptr_t> to make these conversions explicit and allow
PointerIntPair to be used with an enum class IntType. While we're here, rename
some of the argument values so we don't have variables named "Int" floating
around.

llvm-svn: 179073

11 years agoAdd a SectionBase struct.
Rafael Espindola [Mon, 8 Apr 2013 23:57:13 +0000 (23:57 +0000)]
Add a SectionBase struct.

Use it to share code and when we don't need to know if we have a 32 or 64
bit Section.

llvm-svn: 179072

11 years agoc++ new operators are not malloc-like functions because they do not return uninitiali...
Nadav Rotem [Mon, 8 Apr 2013 23:40:47 +0000 (23:40 +0000)]
c++ new operators are not malloc-like functions because they do not return uninitialized memory.
Users may overide new-operators and implement any function that they like.

llvm-svn: 179071

11 years agoAdd test case calling a deprecated method from a subclass that reimplements that...
Ted Kremenek [Mon, 8 Apr 2013 23:39:32 +0000 (23:39 +0000)]
Add test case calling a deprecated method from a subclass that reimplements that method gets a warning.

Test case from <rdar://problem/11627873>.

llvm-svn: 179070

11 years agoDon't copy just to capture a strong block pointer under ARC.
John McCall [Mon, 8 Apr 2013 23:27:49 +0000 (23:27 +0000)]
Don't copy just to capture a strong block pointer under ARC.
It turns out that the optimizer can't eliminate this without extra
information, for which there's a separate bug.

rdar://13588325

llvm-svn: 179069

11 years ago<rdar://problem/13584715> Converted constant expressions are expected to have integra...
Douglas Gregor [Mon, 8 Apr 2013 23:24:07 +0000 (23:24 +0000)]
<rdar://problem/13584715> Converted constant expressions are expected to have integral values.

We were assuming that any expression used as a converted constant
expression would either not have a folded constant value or would be
an integer, which is not the case for some ill-formed constant
expressions. Because converted constant expressions are only used
where integral values are expected, we can simply treat this as an
error path. If that ever changes, we'll need to widen the interface of
Sema::CheckConvertedConstantExpression() anyway.

llvm-svn: 179068

11 years ago<rdar://problem/13540899> Collect using directives from all of the semantic contexts...
Douglas Gregor [Mon, 8 Apr 2013 23:11:25 +0000 (23:11 +0000)]
<rdar://problem/13540899> Collect using directives from all of the semantic contexts not represented by scopes.

This fixes a regression I introduced in r178136, where we would not
consider the using directives from the semantic declaration contexts
that aren't represented by the lexical scopes (Scope) when performing
unqualified name lookup. This lead to horribly funny diagnostics like
"no identifier named 'foo'; did you mean 'foo'?".

llvm-svn: 179067

11 years agoInstructionSimplify.cpp: Fix a ligature, "fi", to get rid of utf8 in comment.
NAKAMURA Takumi [Mon, 8 Apr 2013 23:05:21 +0000 (23:05 +0000)]
InstructionSimplify.cpp: Fix a ligature, "fi", to get rid of utf8 in comment.

llvm-svn: 179066

11 years agoclang/test/Index/annotate-tokens.cpp: Appease msvc-targets with -fno-delayed-template...
NAKAMURA Takumi [Mon, 8 Apr 2013 23:05:10 +0000 (23:05 +0000)]
clang/test/Index/annotate-tokens.cpp: Appease msvc-targets with -fno-delayed-template-parsing.

llvm-svn: 179065

11 years agoRecognize function-like macro usages without semicolon in declaration context.
Alexander Kornienko [Mon, 8 Apr 2013 22:16:06 +0000 (22:16 +0000)]
Recognize function-like macro usages without semicolon in declaration context.

Summary:
Preserve line breaks after function-like macro usages without
semicolon, e.g.:

QQQ(xxx)
class X {
};

Reviewers: djasper, klimek

Reviewed By: djasper

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

llvm-svn: 179064

11 years agoRedo the fix Benjamin Kramer committed in r178793 about iterator invalidation in...
Shuxin Yang [Mon, 8 Apr 2013 22:00:43 +0000 (22:00 +0000)]
Redo the fix Benjamin Kramer committed in r178793 about iterator invalidation in Reassociate.

I brazenly think this change is slightly simpler than r178793 because:
  - no "state" in functor
  - "OpndPtrs[i]" looks simpler than "&Opnds[OpndIndices[i]]"

  While I can reproduce the probelm in Valgrind, it is rather difficult to come up
a standalone testing case. The reason is that when an iterator is invalidated,
the stale invalidated elements are not yet clobbered by nonsense data, so the
optimizer can still proceed successfully.

  Thank Benjamin for fixing this bug and generously providing the test case.

llvm-svn: 179062

11 years agoFix typo in assertion.
Nick Lewycky [Mon, 8 Apr 2013 21:55:21 +0000 (21:55 +0000)]
Fix typo in assertion.

llvm-svn: 179061

11 years agoUpdate the docs about the fact that the loop vectorizer is enabled by default for...
Nadav Rotem [Mon, 8 Apr 2013 21:34:49 +0000 (21:34 +0000)]
Update the docs about the fact that the loop vectorizer is enabled by default for -O3.

llvm-svn: 179060

11 years agoThe PNaCl target no longer permits __attribute__((regparm)).
Eli Bendersky [Mon, 8 Apr 2013 21:31:01 +0000 (21:31 +0000)]
The PNaCl target no longer permits __attribute__((regparm)).

Remove the custom lowering code dealing with it, disallow it in PNaclTargetInfo
and adjust tests accordingly.

llvm-svn: 179059

11 years agoUpdate PlatformDarwinKernel::GetMacDirectoriesToSearch to also try
Jason Molenda [Mon, 8 Apr 2013 21:24:40 +0000 (21:24 +0000)]
Update PlatformDarwinKernel::GetMacDirectoriesToSearch to also try
/Volumes/KernelDebugKit (the default mount point for the Kernel Debug
Kit dmgs).

llvm-svn: 179058

11 years ago<rdar://problem/13559825> Further reduce template instantiation depth down to 256...
Douglas Gregor [Mon, 8 Apr 2013 21:13:13 +0000 (21:13 +0000)]
<rdar://problem/13559825> Further reduce template instantiation depth down to 256, since we're blowing the stack for a trivial "factorial" class template.

llvm-svn: 179057

11 years agoFix PR15634, better error message for template deduction failure.
Richard Trieu [Mon, 8 Apr 2013 21:11:40 +0000 (21:11 +0000)]
Fix PR15634, better error message for template deduction failure.

When two template decls with the same name are used in this diagnostic,
force them to print their qualified names.  This changes the bad message of:

candidate template ignored: could not match 'array' against 'array'

to the better message of:

candidate template ignored: could not match 'NS2::array' against 'NS1::array'

llvm-svn: 179056

11 years agoUpdate checker build to checker-273
Ted Kremenek [Mon, 8 Apr 2013 21:02:16 +0000 (21:02 +0000)]
Update checker build to checker-273

llvm-svn: 179055

11 years agoRevert r179012: "[msan] Intercept glob()."
Chandler Carruth [Mon, 8 Apr 2013 20:59:44 +0000 (20:59 +0000)]
Revert r179012: "[msan] Intercept glob()."

This was committed without tests and contains obvious bugs. That's not
acceptable. It broke address sanitizer for most programs using glob(3).

llvm-svn: 179054

11 years ago<rdar://problem/13540921> Fix a crasher when an Objective-C for-in loop gets a non...
Douglas Gregor [Mon, 8 Apr 2013 20:52:24 +0000 (20:52 +0000)]
<rdar://problem/13540921> Fix a crasher when an Objective-C for-in loop gets a non-variable iteration declaration.

llvm-svn: 179053

11 years agofix indentation
Adrian Prantl [Mon, 8 Apr 2013 20:52:12 +0000 (20:52 +0000)]
fix indentation

llvm-svn: 179052

11 years agoTemplate the MachO types over the word size.
Rafael Espindola [Mon, 8 Apr 2013 20:45:01 +0000 (20:45 +0000)]
Template the MachO types over the word size.

llvm-svn: 179051

11 years agoThe recent GCOV changes expect the initial version string to be in forward order.
Bill Wendling [Mon, 8 Apr 2013 20:36:44 +0000 (20:36 +0000)]
The recent GCOV changes expect the initial version string to be in forward order.

llvm-svn: 179050

11 years agoRevamp indentation behavior for complex binary expressions.
Daniel Jasper [Mon, 8 Apr 2013 20:33:42 +0000 (20:33 +0000)]
Revamp indentation behavior for complex binary expressions.

The idea is to indent according to operator precedence and pretty much
identical to how stuff would be indented with parenthesis.

Before:
bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
             aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
             aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ==
             aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *
             bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +
             bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb &&
             aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *
             aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa >
             ccccccccccccccccccccccccccccccccccccccccc;

After:
  bool value = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
                       aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
                       aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ==
                   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *
                           bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +
                       bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb &&
               aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa *
                       aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa >
                   ccccccccccccccccccccccccccccccccccccccccc;

llvm-svn: 179049

11 years agoRemove is64BitLoadCommand.
Rafael Espindola [Mon, 8 Apr 2013 20:18:53 +0000 (20:18 +0000)]
Remove is64BitLoadCommand.

llvm-svn: 179048

11 years agoRewrite test/Integer tests to use FileCheck instead of grep
Eli Bendersky [Mon, 8 Apr 2013 20:18:15 +0000 (20:18 +0000)]
Rewrite test/Integer tests to use FileCheck instead of grep

llvm-svn: 179047

11 years agoThread safety analysis: turn on checking within lock and unlock functions.
DeLesley Hutchins [Mon, 8 Apr 2013 20:11:11 +0000 (20:11 +0000)]
Thread safety analysis: turn on checking within lock and unlock functions.
These checks are enabled with the -Wthread-safety-beta flag.

llvm-svn: 179046

11 years agoRewrite test/ExecutionEngine tests to use FileCheck instead of grep
Eli Bendersky [Mon, 8 Apr 2013 19:51:36 +0000 (19:51 +0000)]
Rewrite test/ExecutionEngine tests to use FileCheck instead of grep

llvm-svn: 179043

11 years agofixes a typo in my last patch.
Fariborz Jahanian [Mon, 8 Apr 2013 19:14:15 +0000 (19:14 +0000)]
fixes a typo in my last patch.
// rdar://12379114

llvm-svn: 179042

11 years agoChange <cwchar> and <cstring> to look out for flags which may or may not be set by...
Howard Hinnant [Mon, 8 Apr 2013 18:59:28 +0000 (18:59 +0000)]
Change <cwchar> and <cstring> to look out for flags which may or may not be set by the C headers <wchar.h> and <string.h> indicating C support for the C++-altered wcschr, wcspbrk, wcsrchr, wcsstr, wmemchr, strchr, strpbrk, strrchr, memchr, and strstr.  This was already done in <cstring> for other platforms using other flags, so just had to add one more flag to the list there.

llvm-svn: 179041

11 years agoIn the comparison, both clang and GCC are popular and widely adopted. This is no...
Chris Lattner [Mon, 8 Apr 2013 18:56:15 +0000 (18:56 +0000)]
In the comparison, both clang and GCC are popular and widely adopted.  This is no longer a win of GCC.

This whole doc should really be looked at.

llvm-svn: 179040

11 years agodoce parsing: adding few more headerdoc tags.
Fariborz Jahanian [Mon, 8 Apr 2013 18:53:25 +0000 (18:53 +0000)]
doce parsing: adding few more headerdoc tags.
// rdar://12379114

llvm-svn: 179039

11 years agoUpdate documentation.
Matt Arsenault [Mon, 8 Apr 2013 18:52:58 +0000 (18:52 +0000)]
Update documentation.

First feature is not CPU subtype anymore since r134127

llvm-svn: 179038

11 years ago<rdar://problem/13540921> Cope with instantiations of the C++11 range-based for loop...
Douglas Gregor [Mon, 8 Apr 2013 18:40:13 +0000 (18:40 +0000)]
<rdar://problem/13540921> Cope with instantiations of the C++11 range-based for loop that end up being Objective-C fast enumeration loops.

llvm-svn: 179037

11 years agoRewrite test/Verifier tests to use FileCheck instead of grep
Eli Bendersky [Mon, 8 Apr 2013 18:33:51 +0000 (18:33 +0000)]
Rewrite test/Verifier tests to use FileCheck instead of grep

llvm-svn: 179036

11 years ago<rdar://problem/13540921> Cope with deduced 'auto' in a C++11 for-range loop that...
Douglas Gregor [Mon, 8 Apr 2013 18:25:02 +0000 (18:25 +0000)]
<rdar://problem/13540921> Cope with deduced 'auto' in a C++11 for-range loop that is actually an Objective-C fast enumeration loop.

llvm-svn: 179035

11 years agoTweak warning text for nil value in ObjC container warning.
Ted Kremenek [Mon, 8 Apr 2013 18:09:16 +0000 (18:09 +0000)]
Tweak warning text for nil value in ObjC container warning.

llvm-svn: 179034

11 years agoX86 cost model: Model cost for uitofp and sitofp on SSE2
Arnold Schwaighofer [Mon, 8 Apr 2013 18:05:48 +0000 (18:05 +0000)]
X86 cost model: Model cost for uitofp and sitofp on SSE2

The costs are overfitted so that I can still use the legalization factor.

For example the following kernel has about half the throughput vectorized than
unvectorized when compiled with SSE2. Before this patch we would vectorize it.

unsigned short A[1024];
double B[1024];
void f() {
  int i;
  for (i = 0; i < 1024; ++i) {
    B[i] = (double) A[i];
  }
}

radar://13599001

llvm-svn: 179033

11 years ago[libsymbolized] If we can't find an address in the list of shared libraries, try...
Alexander Potapenko [Mon, 8 Apr 2013 17:46:34 +0000 (17:46 +0000)]
[libsymbolized] If we can't find an address in the list of shared libraries, try to reload it.

Add a regression test for the case where such behavior helps TSan:
  1. race is reported in the main module
  2. new shared library is loaded
  3. race is reported in the shared library

llvm-svn: 179032

11 years agoTest case for r179030.
Chad Rosier [Mon, 8 Apr 2013 17:44:05 +0000 (17:44 +0000)]
Test case for r179030.

llvm-svn: 179031

11 years ago[ms-inline asm] Add support for ImmDisp [ Symbol ] memory operands.
Chad Rosier [Mon, 8 Apr 2013 17:43:47 +0000 (17:43 +0000)]
[ms-inline asm] Add support for ImmDisp [ Symbol ] memory operands.
rdar://13521249

llvm-svn: 179030

11 years ago<rdar://problem/12806802> Propagate access specifiers for conversion functions to...
Douglas Gregor [Mon, 8 Apr 2013 17:12:58 +0000 (17:12 +0000)]
<rdar://problem/12806802> Propagate access specifiers for conversion functions to the conversion function set eagerly.

This slightly propagates an existing hack that delays when we provide
access specifiers for the visible conversion functions of a class by
copying the available access specifier early. The only client this
affects is LLDB, which tends to discover and add conversion functions
after the class is technically "complete". As such, the only
observable difference is in LLDB, so the testing will go there.

llvm-svn: 179029

11 years agoAdd matcher for NamespaceDecls.
Daniel Jasper [Mon, 8 Apr 2013 16:44:05 +0000 (16:44 +0000)]
Add matcher for NamespaceDecls.

llvm-svn: 179027

11 years agoGenerate PPC early conditional returns
Hal Finkel [Mon, 8 Apr 2013 16:24:03 +0000 (16:24 +0000)]
Generate PPC early conditional returns

PowerPC has a conditional branch to the link register (return) instruction: BCLR.
This should be used any time when we'd otherwise have a conditional branch to a
return. This adds a small pass, PPCEarlyReturn, which runs just prior to the
branch selection pass (and, importantly, after block placement) to generate
these conditional returns when possible. It will also eliminate unconditional
branches to returns (these happen rarely; most of the time these have already
been tail duplicated by the time PPCEarlyReturn is invoked). This is a nice
optimization for small functions that do not maintain a stack frame.

llvm-svn: 179026

11 years agoDWARF parser: remove duplicated code and fix code style in DIE extractors.
Alexey Samsonov [Mon, 8 Apr 2013 14:37:16 +0000 (14:37 +0000)]
DWARF parser: remove duplicated code and fix code style in DIE extractors.

llvm-svn: 179023

11 years ago[msan] Interceptors for pipe2 and socketpair.
Evgeniy Stepanov [Mon, 8 Apr 2013 13:45:12 +0000 (13:45 +0000)]
[msan] Interceptors for pipe2 and socketpair.

llvm-svn: 179022

11 years agoAdd all 4 MachO object types. Use the stored type to implement is64Bits().
Rafael Espindola [Mon, 8 Apr 2013 13:25:33 +0000 (13:25 +0000)]
Add all 4 MachO object types. Use the stored type to implement is64Bits().

llvm-svn: 179021

11 years agoR600: Control Flow support for pre EG gen
Vincent Lejeune [Mon, 8 Apr 2013 13:05:49 +0000 (13:05 +0000)]
R600: Control Flow support for pre EG gen

llvm-svn: 179020

11 years agoIndependentBlocks: translate out of SSA all uses escaping the region
Sebastian Pop [Mon, 8 Apr 2013 13:05:41 +0000 (13:05 +0000)]
IndependentBlocks: translate out of SSA all uses escaping the region

llvm-svn: 179019

11 years agoSCEVCodegen should not run createIndVarSimplifyPass
Sebastian Pop [Mon, 8 Apr 2013 13:05:37 +0000 (13:05 +0000)]
SCEVCodegen should not run createIndVarSimplifyPass

llvm-svn: 179018

11 years agoRemove outdated part of help message.
Daniel Jasper [Mon, 8 Apr 2013 10:50:02 +0000 (10:50 +0000)]
Remove outdated part of help message.

The styles are now documented with the -style option. This fixes
llvm.org/PR15689.

llvm-svn: 179017

11 years agoRevert accidental commit r179015.
Daniel Jasper [Mon, 8 Apr 2013 10:45:44 +0000 (10:45 +0000)]
Revert accidental commit r179015.

llvm-svn: 179016

11 years agox
Daniel Jasper [Mon, 8 Apr 2013 10:36:32 +0000 (10:36 +0000)]
x

llvm-svn: 179015

11 years agoSimplify the quoting here. Our lit emulator doesn't deal well with the
Chandler Carruth [Mon, 8 Apr 2013 10:07:50 +0000 (10:07 +0000)]
Simplify the quoting here. Our lit emulator doesn't deal well with the
nested quoting schemes, and they're not important here...

llvm-svn: 179014