platform/upstream/llvm.git
10 years agoPatch by Howard. First part of fix for PR18218; add type traits needed to do the...
Marshall Clow [Fri, 3 Jan 2014 18:21:14 +0000 (18:21 +0000)]
Patch by Howard. First part of fix for PR18218; add type traits needed to do the right thing. Fix the problems in PR18218 for isnan and pow - they also need to be applied to the other functions in <cmath>. Also, a drive-by fix for the test - now actually calls test_abs()

llvm-svn: 198431

10 years agoReformat the description strings. No functionality change.
Rafael Espindola [Fri, 3 Jan 2014 18:13:17 +0000 (18:13 +0000)]
Reformat the description strings. No functionality change.

llvm-svn: 198430

10 years agoWe haven't cared about VS 2005 in a long time, and VS 2003 in even longer.
Aaron Ballman [Fri, 3 Jan 2014 18:10:25 +0000 (18:10 +0000)]
We haven't cared about VS 2005 in a long time, and VS 2003 in even longer.

llvm-svn: 198429

10 years agoFixed a FIXME; created a print method for Selectors that accepts a raw_ostream, and...
Aaron Ballman [Fri, 3 Jan 2014 17:59:55 +0000 (17:59 +0000)]
Fixed a FIXME; created a print method for Selectors that accepts a raw_ostream, and started using it in places it made sense.

No functional changes intended, just API cleanliness.

llvm-svn: 198428

10 years agoA follow-up to r198426: move AnalysisConsumer.h to include/clang/...
Alexander Kornienko [Fri, 3 Jan 2014 17:24:20 +0000 (17:24 +0000)]
A follow-up to r198426: move AnalysisConsumer.h to include/clang/...

llvm-svn: 198427

10 years agoMake clang::ento::CreateAnalysisConsumer a part of a public interface of the static...
Alexander Kornienko [Fri, 3 Jan 2014 17:23:10 +0000 (17:23 +0000)]
Make clang::ento::CreateAnalysisConsumer a part of a public interface of the static analyzer.

Summary:
This allows for a better alternative to the FrontendAction hack used in
clang-tidy in order to get static analyzer's ASTConsumer.

Reviewers: jordan_rose, krememek

Reviewed By: jordan_rose

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

llvm-svn: 198426

10 years agoFix loop rerolling pass failure with non-consant loop lower bound
David Peixotto [Fri, 3 Jan 2014 17:20:01 +0000 (17:20 +0000)]
Fix loop rerolling pass failure with non-consant loop lower bound

The loop rerolling pass was failing with an assertion failure from a
failed cast on loops like this:

  void foo(int *A, int *B, int m, int n) {
    for (int i = m; i < n; i+=4) {
      A[i+0] = B[i+0] * 4;
      A[i+1] = B[i+1] * 4;
      A[i+2] = B[i+2] * 4;
      A[i+3] = B[i+3] * 4;
    }
  }

The code was casting the SCEV-expanded code for the new
induction variable to a phi-node. When the loop had a non-constant
lower bound, the SCEV expander would end the code expansion with an
add insted of a phi node and the cast would fail.

It looks like the cast to a phi node was only needed to get the
induction variable value coming from the backedge to compute the end
of loop condition. This patch changes the loop reroller to compare
the induction variable to the number of times the backedge is taken
instead of the iteration count of the loop. In other words, we stop
the loop when the current value of the induction variable ==
IterationCount-1. Previously, the comparison was comparing the
induction variable value from the next iteration == IterationCount.

This problem only seems to occur on 32-bit targets. For some reason,
the loop is not rerolled on 64-bit targets.

PR18290

llvm-svn: 198425

10 years agoSimplifying the mutual exclusion check now that the diagnostics engine knows how...
Aaron Ballman [Fri, 3 Jan 2014 16:23:46 +0000 (16:23 +0000)]
Simplifying the mutual exclusion check now that the diagnostics engine knows how to handle Attr objects directly. Updates an associated test case due to the attribute name being properly quoted again.

llvm-svn: 198424

10 years agoClear the diagnostic buffer after flushing it.
Alexander Kornienko [Fri, 3 Jan 2014 15:34:40 +0000 (15:34 +0000)]
Clear the diagnostic buffer after flushing it.

Reviewers: klimek

Reviewed By: klimek

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

llvm-svn: 198423

10 years ago[OpenCL] Add test case for previous commit.
Joey Gouly [Fri, 3 Jan 2014 15:11:57 +0000 (15:11 +0000)]
[OpenCL] Add test case for previous commit.

llvm-svn: 198422

10 years agoUsing the proper helper function instead of manually doing this work. No functional...
Aaron Ballman [Fri, 3 Jan 2014 15:02:58 +0000 (15:02 +0000)]
Using the proper helper function instead of manually doing this work. No functional changes intended.

llvm-svn: 198421

10 years agoRemoving some more unnecessary manual quotes from diagnostics.
Aaron Ballman [Fri, 3 Jan 2014 14:54:10 +0000 (14:54 +0000)]
Removing some more unnecessary manual quotes from diagnostics.

llvm-svn: 198420

10 years agoRemoving an unneeded typecast. getScopeRep() already returns a NestedNameSpecifier.
Aaron Ballman [Fri, 3 Jan 2014 14:48:20 +0000 (14:48 +0000)]
Removing an unneeded typecast. getScopeRep() already returns a NestedNameSpecifier.

llvm-svn: 198419

10 years agoRemoving some more unnecessary manual quotes from diagnostics.
Aaron Ballman [Fri, 3 Jan 2014 14:23:03 +0000 (14:23 +0000)]
Removing some more unnecessary manual quotes from diagnostics.

llvm-svn: 198418

10 years ago[OpenCL] Variables in the constant address space must be initialized.
Joey Gouly [Fri, 3 Jan 2014 14:16:55 +0000 (14:16 +0000)]
[OpenCL] Variables in the constant address space must be initialized.

llvm-svn: 198417

10 years agoRemoving some more unnecessary manual quotes from diagnostics.
Aaron Ballman [Fri, 3 Jan 2014 14:06:37 +0000 (14:06 +0000)]
Removing some more unnecessary manual quotes from diagnostics.

llvm-svn: 198416

10 years agoIt turns out the problem was a bit more wide-spread. Removing a lot of unneeded typec...
Aaron Ballman [Fri, 3 Jan 2014 13:56:08 +0000 (13:56 +0000)]
It turns out the problem was a bit more wide-spread. Removing a lot of unneeded typecasts. getScopeRep() already returns a NestedNameSpecifier.

No functional changes intended.

llvm-svn: 198414

10 years agoRemoving an unneeded typecast. getScopeRep() already returns a NestedNameSpecifier.
Aaron Ballman [Fri, 3 Jan 2014 13:45:46 +0000 (13:45 +0000)]
Removing an unneeded typecast. getScopeRep() already returns a NestedNameSpecifier.

llvm-svn: 198413

10 years agoRemoving some more unnecessary manual quotes from diagnostics. Updated the related...
Aaron Ballman [Fri, 3 Jan 2014 13:34:55 +0000 (13:34 +0000)]
Removing some more unnecessary manual quotes from diagnostics. Updated the related test case to ensure correctness.

llvm-svn: 198412

10 years agoclang-format: Recognize single-line macro usages inside macros.
Daniel Jasper [Fri, 3 Jan 2014 11:50:46 +0000 (11:50 +0000)]
clang-format: Recognize single-line macro usages inside macros.

Before:
  #define LIST(L)                                                     \
    L(FirstElement) L(SecondElement) L(ThirdElement) L(FourthElement) \
        L(FifthElement)

After:
  #define LIST(L)    \
    L(FirstElement)  \
    L(SecondElement) \
    L(ThirdElement)  \
    L(FourthElement) \
    L(FifthElement)

llvm-svn: 198407

10 years agoRework of r198404 to avoid changes in the build configuration.
Alexander Kornienko [Fri, 3 Jan 2014 10:50:17 +0000 (10:50 +0000)]
Rework of r198404 to avoid changes in the build configuration.

llvm-svn: 198405

10 years agoclang-tody: Rework r198403, to fix build.
NAKAMURA Takumi [Fri, 3 Jan 2014 10:24:51 +0000 (10:24 +0000)]
clang-tody: Rework r198403, to fix build.

llvm-svn: 198404

10 years agoclang-tidy: Fix build since r198402 in the case that the source tree of clang-tools...
NAKAMURA Takumi [Fri, 3 Jan 2014 09:49:13 +0000 (09:49 +0000)]
clang-tidy: Fix build since r198402 in the case that the source tree of clang-tools-extra is not located on clang/tools/extra.

FIXME: Get rid of private headers in other modules.
llvm-svn: 198403

10 years agoRefactored Clang-tidy for better reusability.
Alexander Kornienko [Fri, 3 Jan 2014 09:31:57 +0000 (09:31 +0000)]
Refactored Clang-tidy for better reusability.

Summary:
Made ClangTidyAction more slim and moved its declaration to header to
allow easy creation of Clang-tidy ASTConsumer. Don't derive from
clang::ento::AnalysisAction, use clang::ento::CreateAnalysisConsumer instead
(I'll propose making this function a part of a public API in a separate patch).

Use MultiplexConsumer instead of a custom class.

Don't re-filter checkers list for each TU.

Reviewers: klimek

Reviewed By: klimek

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

llvm-svn: 198402

10 years agoMSVC 2010 build fix
Alp Toker [Fri, 3 Jan 2014 07:58:20 +0000 (07:58 +0000)]
MSVC 2010 build fix

Back out the part of r198399 that enabled LLVM_FINAL/LLVM_OVERRIDE on VS 2010.

DwarfUnit.h legitimately uses them on destructors which unfortunately triggers
Compiler Error C3665 (override specifier not allowed on a destructor/finalizer)
prior to MSVC 2012:

  virtual ~DwarfCompileUnit() LLVM_OVERRIDE;

llvm-svn: 198401

10 years agoBasicAA: Use reachabilty instead of dominance for checking value equality in phi
Arnold Schwaighofer [Fri, 3 Jan 2014 05:47:03 +0000 (05:47 +0000)]
BasicAA: Use reachabilty instead of dominance for checking value equality in phi
cycles

This allows the value equality check to work even if we don't have a dominator
tree. Also add some more comments.

I was worried about compile time impacts and did not implement reachability but
used the dominance check in the initial patch. The trade-off was that the
dominator tree was required.
The llvm utility function isPotentiallyReachable cuts off the recursive search
after 32 visits. Testing did not show any compile time regressions showing my
worries unjustfied.

No compile time or performance regressions at O3 -flto -mavx on test-suite +
externals.

Addresses review comments from r198290.

llvm-svn: 198400

10 years agoEnable LLVM_FINAL, LLVM_OVERRIDE and LLVM_HAS_VARIADIC_TEMPLATES with more gcc and...
Alp Toker [Fri, 3 Jan 2014 05:00:46 +0000 (05:00 +0000)]
Enable LLVM_FINAL, LLVM_OVERRIDE and LLVM_HAS_VARIADIC_TEMPLATES with more gcc and MSVC versions

The 'sealed' definition of LLVM_FINAL can be dropped once VS 2010 is
decommissioned.

Some of this is speculative so will keep an eye on the waterfall -- ping me if
you see failures.

Incremental work towards C++11 migration.

llvm-svn: 198399

10 years agoRevert "Debug Info: Type Units: Simplify type hashing using IR-provided unique names."
David Blaikie [Fri, 3 Jan 2014 04:49:04 +0000 (04:49 +0000)]
Revert "Debug Info: Type Units: Simplify type hashing using IR-provided unique names."

Reverting due to bot failure I won't have time to investigate until
tomorrow.

This reverts commit r198397.

llvm-svn: 198398

10 years agoDebug Info: Type Units: Simplify type hashing using IR-provided unique names.
David Blaikie [Fri, 3 Jan 2014 04:20:26 +0000 (04:20 +0000)]
Debug Info: Type Units: Simplify type hashing using IR-provided unique names.

What's good for LTO metadata size problems ought to be good for non-LTO
debug info size too, so let's rely on the same uniqueness in both cases.
If it's insufficient for non-LTO for whatever reason (since we now won't
be uniquing CU-local types or any C types - but these are likely to not
be the most significant contributors to type bloat) we should consider a
frontend solution that'll help both LTO and non-LTO alike, rather than
using DWARF-level DIE-hashing that only helps non-LTO debug info size.

It's also much simpler this way and benefits C++ even more since we can
deduplicate lexically separate definitions of the same C++ type since
they have the same mangled name.

llvm-svn: 198397

10 years agoUse scoped enum.
Rui Ueyama [Fri, 3 Jan 2014 03:29:15 +0000 (03:29 +0000)]
Use scoped enum.

llvm-svn: 198396

10 years agoRemoving some more unnecessary manual quotes from diagnostics.
Aaron Ballman [Fri, 3 Jan 2014 02:20:27 +0000 (02:20 +0000)]
Removing some more unnecessary manual quotes from diagnostics.

llvm-svn: 198395

10 years ago80-column.
Eric Christopher [Fri, 3 Jan 2014 02:17:35 +0000 (02:17 +0000)]
80-column.

llvm-svn: 198394

10 years agoRemove TextSectionSym as it is unused.
Eric Christopher [Fri, 3 Jan 2014 02:16:44 +0000 (02:16 +0000)]
Remove TextSectionSym as it is unused.

llvm-svn: 198393

10 years agoRemoving some more unnecessary manual quotes from attribute diagnostics.
Aaron Ballman [Fri, 3 Jan 2014 02:14:08 +0000 (02:14 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics.

llvm-svn: 198392

10 years agoRemoving some more unnecessary manual quotes from attribute diagnostics.
Aaron Ballman [Fri, 3 Jan 2014 02:07:43 +0000 (02:07 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics.

llvm-svn: 198391

10 years agoRevert "Reverting r193835 due to weirdness with Go..."
David Blaikie [Fri, 3 Jan 2014 01:30:05 +0000 (01:30 +0000)]
Revert "Reverting r193835 due to weirdness with Go..."

The cgo problem was that it wants dwarf2 which doesn't support direct
constant encoding of the location. So let's add support for dwarf2
encoding (using a location expression) of data member locations.

This reverts commit r198385.

llvm-svn: 198389

10 years ago[analyzer] Don't track return value of NSNull +null for retain/release tracking.
Ted Kremenek [Fri, 3 Jan 2014 01:19:28 +0000 (01:19 +0000)]
[analyzer] Don't track return value of NSNull +null for retain/release tracking.

Fixes <rdar://problem/12858915>.

llvm-svn: 198388

10 years agoRemoving some more unnecessary manual quotes from attribute diagnostics.
Aaron Ballman [Fri, 3 Jan 2014 01:09:27 +0000 (01:09 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics.

llvm-svn: 198387

10 years agoAnother formatting fix
Tobias Grosser [Fri, 3 Jan 2014 00:56:20 +0000 (00:56 +0000)]
Another formatting fix

llvm-svn: 198386

10 years agoReverting r193835 due to weirdness with Go...
David Blaikie [Fri, 3 Jan 2014 00:48:38 +0000 (00:48 +0000)]
Reverting r193835 due to weirdness with Go...

Apologies for the noise - we're seeing some Go failures with cgo
interacting with Clang's debug info due to this change.

llvm-svn: 198385

10 years agoFix formatting issues
Tobias Grosser [Fri, 3 Jan 2014 00:44:43 +0000 (00:44 +0000)]
Fix formatting issues

llvm-svn: 198384

10 years agoRemove unused variable to fix clang warning
Reid Kleckner [Fri, 3 Jan 2014 00:36:32 +0000 (00:36 +0000)]
Remove unused variable to fix clang warning

llvm-svn: 198382

10 years ago[ms-cxxabi] Move VBTableBuilder from CodeGen over to AST/VTableBuilder.cpp
Reid Kleckner [Fri, 3 Jan 2014 00:14:35 +0000 (00:14 +0000)]
[ms-cxxabi] Move VBTableBuilder from CodeGen over to AST/VTableBuilder.cpp

Summary:
No functionality change.

This code should live here long-term because we should be able to use it
to compute correct vftable names.

It turns out that the most natural way to implement the naming algorithm
is to use a caching layer similar to what we already have for virtual
table info in VTableContext.  Subsequent changes will take advantage of
this to fix PR17748, where we have a vbtable name collision.

Reviewers: majnemer

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

llvm-svn: 198380

10 years agoFix break introduced in r198377 due to using a local type as a template parameter.
David Blaikie [Fri, 3 Jan 2014 00:00:41 +0000 (00:00 +0000)]
Fix break introduced in r198377 due to using a local type as a template parameter.

llvm-svn: 198379

10 years agoTest coverage for non-default-constructible elements in a StringMap
David Blaikie [Thu, 2 Jan 2014 23:57:28 +0000 (23:57 +0000)]
Test coverage for non-default-constructible elements in a StringMap

This functionality was enabled by r198374. Here's a test to ensure it
works and we don't regress it.

Based on a patch by Maciej Piechotka.

llvm-svn: 198377

10 years agoIntroduce -polly-canonicalize pass
Tobias Grosser [Thu, 2 Jan 2014 23:39:18 +0000 (23:39 +0000)]
Introduce -polly-canonicalize pass

This ModulePass schedules the set of Polly canonicalization passes. It is a
debugging tool that can be used to preoptimize .ll files for Polly processing.

llvm-svn: 198376

10 years agoRemoved an unnecessary %select from the alignas diagnostics. The attribute already...
Aaron Ballman [Thu, 2 Jan 2014 23:39:11 +0000 (23:39 +0000)]
Removed an unnecessary %select from the alignas diagnostics. The attribute already knows how it was spelled.

llvm-svn: 198375

10 years agoRemove StringMapEntryInitializer support.
David Blaikie [Thu, 2 Jan 2014 23:28:39 +0000 (23:28 +0000)]
Remove StringMapEntryInitializer support.

It was never specialized so let's just remove that unused
configurability and always do the default.

llvm-svn: 198374

10 years agoThis diagnostic should not have had the manual quotation marks. Its only usage passed...
Aaron Ballman [Thu, 2 Jan 2014 23:22:40 +0000 (23:22 +0000)]
This diagnostic should not have had the manual quotation marks. Its only usage passed in an Attr object, which was already quoted when printing the diagnostic. However, there was no test case that caught this bug -- one has been added.

llvm-svn: 198373

10 years agoRemoving some more unnecessary manual quotes from attribute diagnostics. Updated...
Aaron Ballman [Thu, 2 Jan 2014 23:15:58 +0000 (23:15 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics. Updated the associated testcase because QualType pretty printing was an improvement.

llvm-svn: 198372

10 years agoRemoving some more unnecessary manual quotes from attribute diagnostics.
Aaron Ballman [Thu, 2 Jan 2014 23:02:01 +0000 (23:02 +0000)]
Removing some more unnecessary manual quotes from attribute diagnostics.

llvm-svn: 198371

10 years agoRegisterPasses: Do not claim we schedule canonicalization passes at -O0
Tobias Grosser [Thu, 2 Jan 2014 22:48:50 +0000 (22:48 +0000)]
RegisterPasses: Do not claim we schedule canonicalization passes at -O0

Also the code makes the impression this was happening, shouldEnablePolly()
always returns false for optlevel equal to zero. This was previously different,
but was accidentally changed by a commit a couple of months ago. As this
behavior was mainly a debugging tool and adding this to clang never really made
sense, we just remove the last traces.

llvm-svn: 198370

10 years ago[RegAlloc] Make tryInstructionSplit less aggressive.
Quentin Colombet [Thu, 2 Jan 2014 22:47:22 +0000 (22:47 +0000)]
[RegAlloc] Make tryInstructionSplit less aggressive.

The greedy register allocator tries to split a live-range around each
instruction where it is used or defined to relax the constraints on the entire
live-range (this is a last chance split before falling back to spill).
The goal is to have a big live-range that is unconstrained (i.e., that can use
the largest legal register class) and several small local live-range that carry
the constraints implied by each instruction.
E.g.,
Let csti be the constraints on operation i.

V1=
op1 V1(cst1)
op2 V1(cst2)

V1 live-range is constrained on the intersection of cst1 and cst2.

tryInstructionSplit relaxes those constraints by aggressively splitting each
def/use point:
V1=
V2 = V1
V3 = V2
op1 V3(cst1)
V4 = V2
op2 V4(cst2)

Because of how the coalescer infrastructure works, each new variable (V3, V4)
that is alive at the same time as V1 (or its copy, here V2) interfere with V1.
Thus, we end up with an uncoalescable copy for each split point.

To make tryInstructionSplit less aggressive, we check if the split point
actually relaxes the constraints on the whole live-range. If it does not, we do
not insert it.
Indeed, it will not help the global allocation problem:
- V1 will have the same constraints.
- V1 will have the same interference + possibly the newly added split variable
  VS.
- VS will produce an uncoalesceable copy if alive at the same time as V1.

<rdar://problem/15570057>

llvm-svn: 198369

10 years agoReworded the NSObject attribute diagnostics to be more consistent with other attribut...
Aaron Ballman [Thu, 2 Jan 2014 22:45:33 +0000 (22:45 +0000)]
Reworded the NSObject attribute diagnostics to be more consistent with other attribute diagnostics. Also updated the associated test case.

llvm-svn: 198368

10 years agoObjectiveC. Remove false positive warning for missing property
Fariborz Jahanian [Thu, 2 Jan 2014 22:42:09 +0000 (22:42 +0000)]
ObjectiveC. Remove false positive warning for missing property
backing ivar by not issuing this warning if ivar is referenced
somewhere and accessor makes method calls. // rdar://15727325

llvm-svn: 198367

10 years agoRemoving some manual quotes from this diagnostic, since the AST diagnostics engine...
Aaron Ballman [Thu, 2 Jan 2014 22:29:41 +0000 (22:29 +0000)]
Removing some manual quotes from this diagnostic, since the AST diagnostics engine knows how to handle NamedDecl objects.

llvm-svn: 198365

10 years agoScopInfo: Ensure the RegionInfo analysis is always available
Tobias Grosser [Thu, 2 Jan 2014 22:28:53 +0000 (22:28 +0000)]
ScopInfo: Ensure the RegionInfo analysis is always available

This fixes a crash that appeared when generating dotty graphs for functions
without loops (for which we do not calculate polyhedral information).

llvm-svn: 198364

10 years ago[PPC] Fix comment to match function name
Hal Finkel [Thu, 2 Jan 2014 22:09:39 +0000 (22:09 +0000)]
[PPC] Fix comment to match function name

llvm-svn: 198362

10 years agoRemove comments on CU skeleton construction, they're probably
Eric Christopher [Thu, 2 Jan 2014 22:04:47 +0000 (22:04 +0000)]
Remove comments on CU skeleton construction, they're probably
obvious.

llvm-svn: 198361

10 years ago[PPC] Fix the scheduling of CR logicals on the P7
Hal Finkel [Thu, 2 Jan 2014 21:38:26 +0000 (21:38 +0000)]
[PPC] Fix the scheduling of CR logicals on the P7

CR logicals (crand, crxor, etc.) on the P7 need to be in the first slot of each
dispatch group. The old itinerary entry was just wrong (but has not mattered
because we don't generate these instructions).

This will matter when, in an upcoming commit, we start generating these
instructions.

llvm-svn: 198359

10 years agoElaborate on comment for skeleton CU construction.
Eric Christopher [Thu, 2 Jan 2014 21:38:18 +0000 (21:38 +0000)]
Elaborate on comment for skeleton CU construction.

llvm-svn: 198358

10 years agoRevert seemingly unnecessary section sym for the data section.
Eric Christopher [Thu, 2 Jan 2014 21:38:13 +0000 (21:38 +0000)]
Revert seemingly unnecessary section sym for the data section.

llvm-svn: 198357

10 years ago[PPC] Use the correct immediate operands on 64-bit instructions
Hal Finkel [Thu, 2 Jan 2014 21:26:59 +0000 (21:26 +0000)]
[PPC] Use the correct immediate operands on 64-bit instructions

Several of the 64-bit fixed-point instructions with immediate operands were
using the 32-bit (i32) operand nodes instead of the corresponding 64-bit (i64)
operand definitions (u16imm instead of u16imm64, for example).

This error has had no effect so far, but would have caused type-checking
violations with an upcoming change.

llvm-svn: 198356

10 years agoUpdated the wording of two attribute-related diagnostics so that they print the offen...
Aaron Ballman [Thu, 2 Jan 2014 21:26:14 +0000 (21:26 +0000)]
Updated the wording of two attribute-related diagnostics so that they print the offending attribute name. Also updates the associated test cases.

llvm-svn: 198355

10 years agoDisable compare sinking in CodeGenPrepare when multiple condition registers are available
Hal Finkel [Thu, 2 Jan 2014 21:13:43 +0000 (21:13 +0000)]
Disable compare sinking in CodeGenPrepare when multiple condition registers are available

As noted in the comment above CodeGenPrepare::OptimizeInst, which aggressively
sinks compares to reduce pressure on the condition register(s), for targets
such as PowerPC with multiple condition registers, this may not be the right
thing to do. This adds an HasMultipleConditionRegisters boolean to TLI, and
CodeGenPrepare::OptimizeInst is skipped when HasMultipleConditionRegisters is
true.

This functionality will be used by the PowerPC backend in an upcoming commit.
Especially when the PowerPC backend starts tracking individual condition
register bits as separate allocatable entities (which will happen in this
upcoming commit), this sinking from CodeGenPrepare::OptimizeInst is
significantly suboptimial.

llvm-svn: 198354

10 years agoindvars: cleanup the IV visitor. It does more than gather sext/zext info.
Andrew Trick [Thu, 2 Jan 2014 21:12:11 +0000 (21:12 +0000)]
indvars: cleanup the IV visitor. It does more than gather sext/zext info.

llvm-svn: 198353

10 years agoFix all the verifier tests I added for address spaces.
Matt Arsenault [Thu, 2 Jan 2014 21:09:05 +0000 (21:09 +0000)]
Fix all the verifier tests I added for address spaces.

I originally had these using opt -verify, and I never removed the
-verify when converting them to use llvm-as instead, so these were
failing because of using the -verify argument which llvm-as doesn't have
instead of what it's actually supposed to be testing.

llvm-svn: 198352

10 years agoFix up a couple of review comments:
Eric Christopher [Thu, 2 Jan 2014 21:03:28 +0000 (21:03 +0000)]
Fix up a couple of review comments:

Use an if statement instead of a pair of ternary operators checking
the same condition.
Use a cheap method call rather than returning the local symbol.

llvm-svn: 198351

10 years agoSimplify conditional.
Eric Christopher [Thu, 2 Jan 2014 21:03:22 +0000 (21:03 +0000)]
Simplify conditional.

llvm-svn: 198350

10 years agoAllow addrspacecast in global aliases
Matt Arsenault [Thu, 2 Jan 2014 20:55:01 +0000 (20:55 +0000)]
Allow addrspacecast in global aliases

llvm-svn: 198349

10 years ago[TableGen] Correctly generate implicit anonymous prototype defs in multiclasses
Hal Finkel [Thu, 2 Jan 2014 20:47:09 +0000 (20:47 +0000)]
[TableGen] Correctly generate implicit anonymous prototype defs in multiclasses

Even within a multiclass, we had been generating concrete implicit anonymous
defs when parsing values (generally in value lists). This behavior was
incorrect, and led to errors when multiclass parameters were used in the
parameter list of the implicit anonymous def.

If we had some multiclass:

multiclass mc<string n> {

 ... : SomeClass<SomeOtherClass<n> >

The capture of the multiclass parameter 'n' would not work correctly, and
depending on how the implicit SomeOtherClass was used, either TableGen would
ignore something it shouldn't, or would crash.

To fix this problem, when inside a multiclass, we generate prototype anonymous
defs for implicit anonymous defs (just as we do for explicit anonymous defs).
Within the multiclass, the current record prototype is populated with a node
that is essentially: !cast<SomeOtherClass>(!strconcat(NAME, anon_value_name)).
This is then resolved to the correct concrete anonymous def, in the usual way,
when NAME is resolved during multiclass instantiation.

llvm-svn: 198348

10 years ago[TableGen] Handle ValueType in CodeGenDAGPatterns GetNumNodeResults
Hal Finkel [Thu, 2 Jan 2014 20:47:05 +0000 (20:47 +0000)]
[TableGen] Handle ValueType in CodeGenDAGPatterns GetNumNodeResults

A ValueType in a pattern dag is a type cast, and GetNumNodeResults should
handle it (the type cast has only one result).

This comes up, for example, during the type checking of pattern fragments, for
example, AArch64's Neon_combine_2d fragment is:
  dag Operands = (ops node:$Rm, node:$Rn);
  dag Fragment = (v2f64 (concat_vectors (v1f64 node:$Rm), (v1f64 node:$Rn)));

llvm-svn: 198347

10 years agoDelete unread globals through addrspacecast
Matt Arsenault [Thu, 2 Jan 2014 20:01:43 +0000 (20:01 +0000)]
Delete unread globals through addrspacecast

llvm-svn: 198346

10 years agoFix addrspacecast with metadata globals
Matt Arsenault [Thu, 2 Jan 2014 19:53:49 +0000 (19:53 +0000)]
Fix addrspacecast with metadata globals

llvm-svn: 198345

10 years ago[CMake] Add missing set_output_directory after Takumi's change in r198205.
Jordan Rose [Thu, 2 Jan 2014 19:47:45 +0000 (19:47 +0000)]
[CMake] Add missing set_output_directory after Takumi's change in r198205.

Plugins need to go in build/Debug/lib as well (rather than build/lib/Debug).

Also, fix the SHLIBDIR path for Xcode, which by default includes Xcode build
settings rather than a simple %(build_mode)s parameter.

llvm-svn: 198344

10 years agoObjective-C ARC++: Prefer references to __strong/__weak over __unsafe_unretained.
Douglas Gregor [Thu, 2 Jan 2014 19:42:02 +0000 (19:42 +0000)]
Objective-C ARC++: Prefer references to __strong/__weak over __unsafe_unretained.

Fixes <rdar://problem/15713945>.

llvm-svn: 198343

10 years agoRemove redundant fold call introduced in r195944. Thanks very much to Juergen
Lang Hames [Thu, 2 Jan 2014 19:38:41 +0000 (19:38 +0000)]
Remove redundant fold call introduced in r195944. Thanks very much to Juergen
for pointing this out.

llvm-svn: 198341

10 years ago[TableGen] Use the same anonymous name as the prefix on all multiclass defs
Hal Finkel [Thu, 2 Jan 2014 19:35:33 +0000 (19:35 +0000)]
[TableGen] Use the same anonymous name as the prefix on all multiclass defs

TableGen had been generating a different name for an anonymous multiclass's
NAME for every def in the multiclass. This had an unfortunate side effect: it
was impossible to reference one def within the multiclass from another (in the
parameter list, for example). By making sure we only generate an anonymous name
once per multiclass (which, as it turns out, requires only changing the name
parameter to reference type), we can now concatenate NAME within the multiclass
with a def name in order to generate a reference to that def.

This does not matter so much, in and of itself, but is necessary for a
follow-up commit that will fix variable capturing in implicit anonymous
multiclass defs (and that is important).

llvm-svn: 198340

10 years agoNo else after return.
Joerg Sonnenberger [Thu, 2 Jan 2014 19:30:56 +0000 (19:30 +0000)]
No else after return.

llvm-svn: 198339

10 years agoindvars: insert truncate at loop boundary to avoid redundant IVs.
Andrew Trick [Thu, 2 Jan 2014 19:29:38 +0000 (19:29 +0000)]
indvars: insert truncate at loop boundary to avoid redundant IVs.

When widening an IV to remove s/zext, we generally try to eliminate
the original narrow IV. However, LCSSA phi nodes outside the loop were
still using the original IV. Clean this up more aggressively to avoid
redundancy in generated code.

llvm-svn: 198338

10 years agoAdd default search path if -nostdlib is not provided.
Joerg Sonnenberger [Thu, 2 Jan 2014 19:18:36 +0000 (19:18 +0000)]
Add default search path if -nostdlib is not provided.
Add basic emulation mapping for NetBSD/amd64, so that clang -m32 works
as expected.

llvm-svn: 198337

10 years agoMark REX64_PREFIX as In64BitMode, remove hack from X86RecognizableInstr.
Craig Topper [Thu, 2 Jan 2014 19:12:10 +0000 (19:12 +0000)]
Mark REX64_PREFIX as In64BitMode, remove hack from X86RecognizableInstr.

llvm-svn: 198336

10 years agoCMake separate projects: use correct name for LIBRARY_OUTPUT_DIRECTORY_${suffix}.
Douglas Gregor [Thu, 2 Jan 2014 19:07:19 +0000 (19:07 +0000)]
CMake separate projects: use correct name for LIBRARY_OUTPUT_DIRECTORY_${suffix}.

llvm-svn: 198335

10 years agoMake llvm::Regex non-copyable but movable.
David Blaikie [Thu, 2 Jan 2014 19:04:59 +0000 (19:04 +0000)]
Make llvm::Regex non-copyable but movable.

Based on a patch by Maciej Piechotka.

llvm-svn: 198334

10 years agoRevert "Debug info: Add enumerators to the __apple_names accelerator table."
Adrian Prantl [Thu, 2 Jan 2014 18:48:24 +0000 (18:48 +0000)]
Revert "Debug info: Add enumerators to the __apple_names accelerator table."

This reverts r197927 until the discussion on llvm-commits comes to a
conclusion.

llvm-svn: 198333

10 years agoRemove unused HasFROperands field from disassembler.
Craig Topper [Thu, 2 Jan 2014 18:44:21 +0000 (18:44 +0000)]
Remove unused HasFROperands field from disassembler.

llvm-svn: 198332

10 years agoCMake separate projects: finish output-directory changes.
Douglas Gregor [Thu, 2 Jan 2014 18:37:47 +0000 (18:37 +0000)]
CMake separate projects: finish output-directory changes.

Make sure clang-tblgen, clang++, and clang-cl get created in the Clang
binary build directory.

llvm-svn: 198331

10 years agoUse LLVM_STATIC_ASSERT rather than a hand-rolled implementation.
David Blaikie [Thu, 2 Jan 2014 18:29:40 +0000 (18:29 +0000)]
Use LLVM_STATIC_ASSERT rather than a hand-rolled implementation.

llvm-svn: 198330

10 years ago[CMake] Add missing set_output_directory after Takumi's change in r198205.
Jordan Rose [Thu, 2 Jan 2014 18:28:32 +0000 (18:28 +0000)]
[CMake] Add missing set_output_directory after Takumi's change in r198205.

In a standalone build, Clang binaries should end up in Clang's build folder,
not LLVM's.

Xcode still has a few issues finding auxiliary tools and libraries in the
build folders. I'll fix those next.

llvm-svn: 198328

10 years agoMark PUSHFS64/PUSHGS64/POPFS64/POPGS64 as In64BitMode and remove the hack from the...
Craig Topper [Thu, 2 Jan 2014 18:20:48 +0000 (18:20 +0000)]
Mark PUSHFS64/PUSHGS64/POPFS64/POPGS64 as In64BitMode and remove the hack from the disassembler table builder.

llvm-svn: 198327

10 years agoUsing the quoted version of an attribute name for consistency with other attribute...
Aaron Ballman [Thu, 2 Jan 2014 18:10:17 +0000 (18:10 +0000)]
Using the quoted version of an attribute name for consistency with other attribute diagnostics.

llvm-svn: 198326

10 years agoRemove unnecessary stirng comparison from disassembler.
Craig Topper [Thu, 2 Jan 2014 17:41:40 +0000 (17:41 +0000)]
Remove unnecessary stirng comparison from disassembler.

llvm-svn: 198325

10 years agoMark all x86 Int_ and _Int patterns as isCodeGenOnly so the disassembler table builde...
Craig Topper [Thu, 2 Jan 2014 17:28:14 +0000 (17:28 +0000)]
Mark all x86 Int_ and _Int patterns as isCodeGenOnly so the disassembler table builder doesn't need to string match them to exclude them.

llvm-svn: 198323

10 years agoObjectiveC. Class methods must be ignored when looking for
Fariborz Jahanian [Thu, 2 Jan 2014 17:24:32 +0000 (17:24 +0000)]
ObjectiveC. Class methods must be ignored when looking for
property accessor's missing backing ivar. This eliminates
the bogus warning being issued. // rdar://15728901

llvm-svn: 198322

10 years agoAdd test for r198311.
Roman Divacky [Thu, 2 Jan 2014 17:18:03 +0000 (17:18 +0000)]
Add test for r198311.

llvm-svn: 198321

10 years agoCMake: Unbreak separated LLVM/Clang project builds for Xcode.
Douglas Gregor [Thu, 2 Jan 2014 17:11:02 +0000 (17:11 +0000)]
CMake: Unbreak separated LLVM/Clang project builds for Xcode.

The separate Xcode project generated for Clang is putting the clang
executables into the same location where the LLVM executables are
going. This is wrong, and breaks the Clang build because we try to
create clang++ and clang-cl symlinks in the wrong place and to the
wrong place.

As a stop-gap to get these builds working again, teach the symlink
generation to point into the LLVM executable directory instead.

llvm-svn: 198319

10 years agoRemove CMake-Xcode hack that symlinked llvm-config into a common place.
Douglas Gregor [Thu, 2 Jan 2014 16:30:55 +0000 (16:30 +0000)]
Remove CMake-Xcode hack that symlinked llvm-config into a common place.

When building Clang separately from LLVM with CMake, one should set
the path of llvm-config via the cache variable LLVM_CONFIG.

llvm-svn: 198316

10 years ago[arm] Add softvfp to supported FPU names.
Logan Chien [Thu, 2 Jan 2014 15:50:02 +0000 (15:50 +0000)]
[arm] Add softvfp to supported FPU names.

llvm-svn: 198313

10 years agoRemove a tab that snuck in.
Roman Divacky [Thu, 2 Jan 2014 15:34:59 +0000 (15:34 +0000)]
Remove a tab that snuck in.

llvm-svn: 198312

10 years agoIn the FreeBSD assembler driver, inform the sparc assembler that we're producing
Roman Divacky [Thu, 2 Jan 2014 15:13:18 +0000 (15:13 +0000)]
In the FreeBSD assembler driver, inform the sparc assembler that we're producing
PIC code.

llvm-svn: 198311