platform/upstream/llvm.git
11 years agoClarify comment for extension().
Rui Ueyama [Fri, 19 Jul 2013 00:51:17 +0000 (00:51 +0000)]
Clarify comment for extension().

llvm-svn: 186636

11 years agoMI Sched: test case fix for previous checkin.
Andrew Trick [Fri, 19 Jul 2013 00:31:31 +0000 (00:31 +0000)]
MI Sched: test case fix for previous checkin.

llvm-svn: 186635

11 years agoDebug Info: enable verifying by default and disable testing cases that fail.
Manman Ren [Fri, 19 Jul 2013 00:31:03 +0000 (00:31 +0000)]
Debug Info: enable verifying by default and disable testing cases that fail.

1> Use DebugInfoFinder to find debug info MDNodes.
2> Add disable-debug-info-verifier to disable verifying debug info.
3> Disable verifying for testing cases that fail (will update the testing cases
   later on).
4> MDNodes generated by clang can have empty filename for TAG_inheritance and
   TAG_friend, so DIType::Verify is modified accordingly.

Note that DebugInfoFinder does not list all debug info MDNode.
For example, clang can generate:
metadata !{i32 786468}, which will fail to verify.
This MDNode is used by debug info but not included in DebugInfoFinder.
This MDNode is generated as a temporary node in DIBuilder::createFunction
  Value *TElts[] = { GetTagConstant(VMContext, DW_TAG_base_type) };
  MDNode::getTemporary(VMContext, TElts)

llvm-svn: 186634

11 years agoelf-core: handle core with a single NT_PRPSINFO (not one per thread)
Ed Maste [Fri, 19 Jul 2013 00:25:02 +0000 (00:25 +0000)]
elf-core: handle core with a single NT_PRPSINFO (not one per thread)

On FreeBSD we have only one NT_PRPSINFO in a core file, regardless of the
number of threads.  Consider a new thread to start whenever we see another
instance of either NT_PRPSINFO or NT_PRSTATUS.

Thanks to Samuel Jacob for testing this patch on Linux cores.

llvm-svn: 186633

11 years agoMI Sched: Update the way resources are tracked so the current heuristics make more...
Andrew Trick [Fri, 19 Jul 2013 00:20:07 +0000 (00:20 +0000)]
MI Sched: Update the way resources are tracked so the current heuristics make more sense.

llvm-svn: 186632

11 years agoFix crash-on-invalid with inheriting constructor.
Eli Friedman [Thu, 18 Jul 2013 23:59:50 +0000 (23:59 +0000)]
Fix crash-on-invalid with inheriting constructor.

Fixes PR16656.

llvm-svn: 186631

11 years agoCheck the return value from parse()
Nick Kledzik [Thu, 18 Jul 2013 23:47:22 +0000 (23:47 +0000)]
Check the return value from parse()

llvm-svn: 186630

11 years agoClean up diagnostics for inheriting constructors.
Eli Friedman [Thu, 18 Jul 2013 23:29:14 +0000 (23:29 +0000)]
Clean up diagnostics for inheriting constructors.

No new diagnostics, just better wording and notes pointing at more
relevant locations.

llvm-svn: 186629

11 years agoFix FileCheck CHECK-LABEL documentation wording slightly; also mention that it allows...
Stephen Lin [Thu, 18 Jul 2013 23:26:58 +0000 (23:26 +0000)]
Fix FileCheck CHECK-LABEL documentation wording slightly; also mention that it allows error recovery.

llvm-svn: 186628

11 years agoRevert "COFFDumper: Dump data directory entries."
Rui Ueyama [Thu, 18 Jul 2013 23:15:50 +0000 (23:15 +0000)]
Revert "COFFDumper: Dump data directory entries."

Because it broke s390x and ppc64-linux buildbots. This reverts commit r186623.

llvm-svn: 186627

11 years agoAdd support for -all_load. Enhance DarwinLdDriverTest unit test test cases to test...
Nick Kledzik [Thu, 18 Jul 2013 23:13:13 +0000 (23:13 +0000)]
Add support for -all_load. Enhance DarwinLdDriverTest unit test test cases to test all options parsed so far

llvm-svn: 186626

11 years agoAdded -lines X:Y option to specify line range to process. This is a more human-friend...
Alexander Kornienko [Thu, 18 Jul 2013 22:54:56 +0000 (22:54 +0000)]
Added -lines X:Y option to specify line range to process. This is a more human-friendly alternative to -offset and -length.

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

llvm-svn: 186625

11 years agoUpdate to more CodeGen tests to use CHECK-LABEL for labels corresponding to function...
Stephen Lin [Thu, 18 Jul 2013 22:47:09 +0000 (22:47 +0000)]
Update to more CodeGen tests to use CHECK-LABEL for labels corresponding to function definitions for more informative error  messages. No functionality change.

All changes were made by the following bash script:

  find test/CodeGen -name "*.ll" | \
  while read NAME; do
    echo "$NAME"
    grep -q "^; *RUN: *llc.*debug" $NAME && continue
    grep -q "^; *RUN:.*llvm-objdump" $NAME && continue
    grep -q "^; *RUN: *opt.*" $NAME && continue
    TEMP=`mktemp -t temp`
    cp $NAME $TEMP
    sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \
    while read FUNC; do
      sed -i '' "s/;\([A-Za-z0-9_-]*\)\([A-Za-z0-9_-]*\):\( *\)$FUNC[:]* *\$/;\1\2-LABEL:\3$FUNC:/g" $TEMP
    done
    sed -i '' "s/;\(.*\)-LABEL-LABEL:/;\1-LABEL:/" $TEMP
    sed -i '' "s/;\(.*\)-NEXT-LABEL:/;\1-NEXT:/" $TEMP
    sed -i '' "s/;\(.*\)-NOT-LABEL:/;\1-NOT:/" $TEMP
    sed -i '' "s/;\(.*\)-DAG-LABEL:/;\1-DAG:/" $TEMP
    mv $TEMP $NAME
  done

This script catches a superset of the cases caught by the script associated with commit r186280. It initially found some false positives due to unusual constructs in a minority of tests; all such cases were disambiguated first in commit r186621.

llvm-svn: 186624

11 years agoCOFFDumper: Dump data directory entries.
Rui Ueyama [Thu, 18 Jul 2013 22:44:20 +0000 (22:44 +0000)]
COFFDumper: Dump data directory entries.

Summary:
Dump optional data directory entries in the PE/COFF header, so that
we can test the output of LLD linker. This patch updates the test binary
file, but the source of the binary is the same. I just re-linked the file.
I don't know how the previous file was linked, but the previous file did
not have any data directory entries for some reason.

Reviewers: rafael

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

llvm-svn: 186623

11 years agoClean up some of this code a tiny bit, no functionality change.
Nick Lewycky [Thu, 18 Jul 2013 22:32:32 +0000 (22:32 +0000)]
Clean up some of this code a tiny bit, no functionality change.

llvm-svn: 186622

11 years agoDisambiguate function names in some CodeGen tests. (Some tests were using function...
Stephen Lin [Thu, 18 Jul 2013 22:29:15 +0000 (22:29 +0000)]
Disambiguate function names in some CodeGen tests. (Some tests were using function names that also were names of instructions and/or doing other unusual things that were making the test not amenable to otherwise scriptable pattern matching.) No functionality change.

llvm-svn: 186621

11 years agoARM: Make sure the instruction alias for PLI uses the right subtarget features.
Tilmann Scheller [Thu, 18 Jul 2013 22:19:59 +0000 (22:19 +0000)]
ARM: Make sure the instruction alias for PLI uses the right subtarget features.

PLI requires both the Thumb2 and the ARMv7 feature.

Related to <rdar://problem/14403733>.

llvm-svn: 186620

11 years agoObjectiveC migrator: Remove semicolon after the typedef
Fariborz Jahanian [Thu, 18 Jul 2013 22:17:33 +0000 (22:17 +0000)]
ObjectiveC migrator: Remove semicolon after the typedef
declaration when converting to NS_ENUM. This required
some code refactoring.

llvm-svn: 186619

11 years agoThis commit does two things. One, it converts the return value of the QueueThreadPlanXXX
Jim Ingham [Thu, 18 Jul 2013 21:48:26 +0000 (21:48 +0000)]
This commit does two things.  One, it converts the return value of the QueueThreadPlanXXX
plan providers from a "ThreadPlan *" to a "lldb::ThreadPlanSP".  That was needed to fix
a bug where the ThreadPlanStepInRange wasn't checking with its sub-plans to make sure they
succeed before trying to proceed further.  If the sub-plan failed and as a result didn't make
any progress, you could end up retrying the same failing algorithm in an infinite loop.

<rdar://problem/14043602>

llvm-svn: 186618

11 years agoAddress -Wreorder warning in Driver.cpp
Hans Wennborg [Thu, 18 Jul 2013 21:45:42 +0000 (21:45 +0000)]
Address -Wreorder warning in Driver.cpp

llvm-svn: 186617

11 years agoR600/SI: Fix crash with VSELECT
Tom Stellard [Thu, 18 Jul 2013 21:43:53 +0000 (21:43 +0000)]
R600/SI: Fix crash with VSELECT

https://bugs.freedesktop.org/show_bug.cgi?id=66175

llvm-svn: 186616

11 years agoR600/SI: Add support for v2f32 loads
Tom Stellard [Thu, 18 Jul 2013 21:43:48 +0000 (21:43 +0000)]
R600/SI: Add support for v2f32 loads

llvm-svn: 186615

11 years agoR600/SI: Add support for v2f32 stores
Tom Stellard [Thu, 18 Jul 2013 21:43:42 +0000 (21:43 +0000)]
R600/SI: Add support for v2f32 stores

llvm-svn: 186614

11 years agoR600: Expand VSELECT for all types
Tom Stellard [Thu, 18 Jul 2013 21:43:35 +0000 (21:43 +0000)]
R600: Expand VSELECT for all types

llvm-svn: 186613

11 years ago[PECOFF] Use replace_extension() instead of doing it myself.
Rui Ueyama [Thu, 18 Jul 2013 21:38:44 +0000 (21:38 +0000)]
[PECOFF] Use replace_extension() instead of doing it myself.

llvm-svn: 186612

11 years agotest/MC/AsmParser/secure_log_unique.s requires shell
Hans Wennborg [Thu, 18 Jul 2013 21:34:13 +0000 (21:34 +0000)]
test/MC/AsmParser/secure_log_unique.s requires shell

This should fix the chapuni bots.

llvm-svn: 186611

11 years agoFix build with LLVM 3.4
Aaron Watry [Thu, 18 Jul 2013 21:24:35 +0000 (21:24 +0000)]
Fix build with LLVM 3.4

F_Binary and friends were moved to include/Support/FileSystem.h

v2: Maintain compatibility with LLVM 3.3

Signed-off-by: Aaron Watry <awatry@gmail.com>
llvm-svn: 186610

11 years agoFix another instance of -ccc-cxx vs. --driver-mode=g++
Hans Wennborg [Thu, 18 Jul 2013 21:09:03 +0000 (21:09 +0000)]
Fix another instance of -ccc-cxx vs. --driver-mode=g++

llvm-svn: 186609

11 years agoFix -Wdocumentation warning
Hans Wennborg [Thu, 18 Jul 2013 21:00:12 +0000 (21:00 +0000)]
Fix -Wdocumentation warning

s/Tokenize/Tokenizer/ to make the comment correspond to the
parameter name

llvm-svn: 186608

11 years agoUse --driver-mode=g++ instead of -ccc-cxx; required after Clang r186605
Hans Wennborg [Thu, 18 Jul 2013 20:48:50 +0000 (20:48 +0000)]
Use --driver-mode=g++ instead of -ccc-cxx; required after Clang r186605

llvm-svn: 186607

11 years agoAdd a test for .secure_log_unique.
Rafael Espindola [Thu, 18 Jul 2013 20:34:26 +0000 (20:34 +0000)]
Add a test for .secure_log_unique.

It also doubles a test that F_Append works.

llvm-svn: 186606

11 years agoTurn Driver::CCCIsCXX and CCCIsCPP into a single Mode enum,
Hans Wennborg [Thu, 18 Jul 2013 20:29:38 +0000 (20:29 +0000)]
Turn Driver::CCCIsCXX and CCCIsCPP into a single Mode enum,
and add a new option --driver-mode= to control it explicitly.

The CCCIsCXX and CCCIsCPP flags were non-overlapping, i.e. there
are currently really three modes that Clang can run in: gcc, g++
or cpp, so it makes sense to represent them as an enum.

Having a command line flag to control it helps testing.

llvm-svn: 186605

11 years agoObjectiveC migration. migration to NS_ENUM/SN_OPTION
Fariborz Jahanian [Thu, 18 Jul 2013 20:11:45 +0000 (20:11 +0000)]
ObjectiveC migration. migration to NS_ENUM/SN_OPTION
- wip.

llvm-svn: 186604

11 years ago[Driver] Use LLVM's response file parser because it can read UTF-16
Reid Kleckner [Thu, 18 Jul 2013 20:00:53 +0000 (20:00 +0000)]
[Driver] Use LLVM's response file parser because it can read UTF-16

MSBuild writes response files as UTF-16 little endian with a byte order
mark.  With this change, clang will be able to read them, although we
still can't parse any of their flags.

Adds a UTF-16-LE response file with a BOM for testing.

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

llvm-svn: 186603

11 years agoSeparate the notion of 'context' when recursing down in the parser and actual errors.
Samuel Benzaquen [Thu, 18 Jul 2013 19:47:59 +0000 (19:47 +0000)]
Separate the notion of 'context' when recursing down in the parser and actual errors.

Summary:
Change how error messages are constructed and stored in Diagnostics.
Separate the notion of 'context' when recursing down in the parser and actual errors.
This will simplify adding some new features, like argument overloading and error recovery.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1168

llvm-svn: 186602

11 years agoRevert "Remove DIBuilder cache of variable TheCU and change the few"
Eric Christopher [Thu, 18 Jul 2013 19:13:06 +0000 (19:13 +0000)]
Revert "Remove DIBuilder cache of variable TheCU and change the few"

This reverts commit r186599 as I didn't want to commit this yet.

llvm-svn: 186601

11 years agoEqual means ==, not !=. Thanks to Benjamin for catching.
Eric Christopher [Thu, 18 Jul 2013 19:11:41 +0000 (19:11 +0000)]
Equal means ==, not !=. Thanks to Benjamin for catching.

llvm-svn: 186600

11 years agoRemove DIBuilder cache of variable TheCU and change the few
Eric Christopher [Thu, 18 Jul 2013 19:11:29 +0000 (19:11 +0000)]
Remove DIBuilder cache of variable TheCU and change the few
uses that wanted it. Also change the interface for createCompileUnit
to compensate. Fix comments that refer to TheCU as well.

llvm-svn: 186599

11 years agoChanged declarations from Attr to InheritableAttr as they are already being processed...
Aaron Ballman [Thu, 18 Jul 2013 19:11:29 +0000 (19:11 +0000)]
Changed declarations from Attr to InheritableAttr as they are already being processed that way semantically.

Patch thanks to Dean Sutherland!  Reviewed by Eli Friedman.

llvm-svn: 186598

11 years agoUse the correct call to close down the lockdown connection.
Jim Ingham [Thu, 18 Jul 2013 18:48:57 +0000 (18:48 +0000)]
Use the correct call to close down the lockdown connection.

<rdar://problem/14460024>

llvm-svn: 186597

11 years agoDidn't get the right version of these files in the checkin for r186132.
Jim Ingham [Thu, 18 Jul 2013 18:42:57 +0000 (18:42 +0000)]
Didn't get the right version of these files in the checkin for r186132.

llvm-svn: 186596

11 years agoSmall improvement to the use of GetFileType:
Rafael Espindola [Thu, 18 Jul 2013 18:42:52 +0000 (18:42 +0000)]
Small improvement to the use of GetFileType:

* assert that the return value is one of the documented values on msdn.
* on FILE_TYPE_UNKNOWN, check GetLastError.

Unfortunately I can't think of a way to get a FILE_TYPE_UNKNOWN on a test.

llvm-svn: 186595

11 years agoUpdate to CodeGen tests to use CHECK-LABEL for labels corresponding to function defin...
Stephen Lin [Thu, 18 Jul 2013 18:35:22 +0000 (18:35 +0000)]
Update to CodeGen tests to use CHECK-LABEL for labels corresponding to function definitions for more informative error messages. No functionality change.

llvm-svn: 186594

11 years agoHandle constants without going through SCEV.
Nadav Rotem [Thu, 18 Jul 2013 18:34:21 +0000 (18:34 +0000)]
Handle constants without going through SCEV.

llvm-svn: 186593

11 years agoSLPVectorizer: Speedup isConsecutive by manually checking GEPs with multiple indices.
Nadav Rotem [Thu, 18 Jul 2013 18:20:45 +0000 (18:20 +0000)]
SLPVectorizer: Speedup isConsecutive by manually checking GEPs with multiple indices.
This brings the compile time of the SLP-Vectorizer to about 2.5% of OPT for my testcase.

llvm-svn: 186592

11 years agoSwitching to use checkAttributeNumArgs for trivial cases. No functional changes...
Aaron Ballman [Thu, 18 Jul 2013 18:01:48 +0000 (18:01 +0000)]
Switching to use checkAttributeNumArgs for trivial cases.  No functional changes intended.

llvm-svn: 186591

11 years agoTest contents were somehow duplicated, resulting in any testcase that fails automatic...
Aaron Ballman [Thu, 18 Jul 2013 17:41:26 +0000 (17:41 +0000)]
Test contents were somehow duplicated, resulting in any testcase that fails automatically failing twice.  Removing the duplicates.

llvm-svn: 186590

11 years agoWindows/Path.inc: Introduce file_type::character_file and file_type::fifo_file in...
NAKAMURA Takumi [Thu, 18 Jul 2013 17:00:54 +0000 (17:00 +0000)]
Windows/Path.inc: Introduce file_type::character_file and file_type::fifo_file in sys::fs::getStatus(HANDLE).

It fixes llvm/test/Other/close-stderr.ll on msys.

FIXME: Provide unittests.
llvm-svn: 186588

11 years ago[Support] Beef up and expose the response file parsing in llvm::cl
Reid Kleckner [Thu, 18 Jul 2013 16:52:05 +0000 (16:52 +0000)]
[Support] Beef up and expose the response file parsing in llvm::cl

The plan is to use it for clang and lld.

Major behavior changes:
- We can now parse UTF-16 files that have a byte order mark.
- PR16209: Don't drop backslashes on the floor if they don't escape
  anything.

The actual parsing loop was based on code from Clang's driver.cpp,
although it's been rewritten to track its state with control flow rather
than state variables.

Reviewers: hans

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

llvm-svn: 186587

11 years agollvm/test/Other/close-stderr.ll: Mark this as XFAIL on msys, since r186560.
NAKAMURA Takumi [Thu, 18 Jul 2013 15:38:50 +0000 (15:38 +0000)]
llvm/test/Other/close-stderr.ll: Mark this as XFAIL on msys, since r186560.

sys::fs::status() doesn't work on pipes. Investigating.

llvm-svn: 186586

11 years agoFix the partial backtrace when using a combination of stripped function symbols
Ashok Thirumurthi [Thu, 18 Jul 2013 15:05:56 +0000 (15:05 +0000)]
Fix the partial backtrace when using a combination of stripped function symbols
and -fomit-frame-pointer.

- Parses eh_frame FDEs to determine the function address and size so that
the call frame parsing can continue.

Note: This code path is specific to ELF and PECOFF, because ObjectFileMachO
uses LCT_FunctionStarts to efficiently populate the symbol table.

Thanks to Jason Molenda for the review!

llvm-svn: 186585

11 years agoReplacing a morally duplicate diagnostic by adding it to an existing diagnostic's...
Aaron Ballman [Thu, 18 Jul 2013 14:56:42 +0000 (14:56 +0000)]
Replacing a morally duplicate diagnostic by adding it to an existing diagnostic's select list.  Updates the tests for the more consistent diagnostic.

llvm-svn: 186584

11 years agoclang-format: Fix bad line break with pointers to members.
Daniel Jasper [Thu, 18 Jul 2013 14:46:07 +0000 (14:46 +0000)]
clang-format: Fix bad line break with pointers to members.

Before:
  void f() {
    (a->*
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(aaaa,
                                           bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
  }

After:
  void f() {
    (a->*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(
        aaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
  }

Also add missing test case.

llvm-svn: 186583

11 years agoFix crash in libclang if code completion is used with unknown flags.
Manuel Klimek [Thu, 18 Jul 2013 14:23:12 +0000 (14:23 +0000)]
Fix crash in libclang if code completion is used with unknown flags.

Use CaptureDroppedDiagnostics to make sure that there is a diagnostic
client installed when warning flags are parsed.

llvm-svn: 186582

11 years ago[lsan] Add __lsan_do_leak_check() to the public interface.
Sergey Matveev [Thu, 18 Jul 2013 14:06:07 +0000 (14:06 +0000)]
[lsan] Add __lsan_do_leak_check() to the public interface.

Let users override the normal behavior to run leak checking earlier in
the process. Also fix a couple nits here and there.

llvm-svn: 186581

11 years agoForgot 'svn add' again, sorry!
Joey Gouly [Thu, 18 Jul 2013 13:17:26 +0000 (13:17 +0000)]
Forgot 'svn add' again, sorry!

Tests for r186574.

llvm-svn: 186580

11 years agotsan: treat SIGSYS as synchronous signal
Dmitry Vyukov [Thu, 18 Jul 2013 13:14:11 +0000 (13:14 +0000)]
tsan: treat SIGSYS as synchronous signal
It is required for chromium sandboxing code.
From the description it seems to be indeed synchronous -- called back on syscall with incorrect arguments,
but seems to be unused in practice. So this should be fine.

llvm-svn: 186579

11 years agoRemoved a parameter from handleAttrWithMessage to make it more consistent with other...
Aaron Ballman [Thu, 18 Jul 2013 13:13:52 +0000 (13:13 +0000)]
Removed a parameter from handleAttrWithMessage to make it more consistent with other attribute handlers, as well as other attribute error messages.  Added missing test cases for the unavailable attribute, and updated the deprecated test case.

llvm-svn: 186578

11 years ago[ASan] Fix leaks in ASan tests found by LSan
Alexey Samsonov [Thu, 18 Jul 2013 12:59:52 +0000 (12:59 +0000)]
[ASan] Fix leaks in ASan tests found by LSan

llvm-svn: 186577

11 years agoChange 'n' to 'N' to keep consistent with other instructions.
Joey Gouly [Thu, 18 Jul 2013 12:00:25 +0000 (12:00 +0000)]
Change 'n' to 'N' to keep consistent with other instructions.

llvm-svn: 186576

11 years agocpp11-migrate: Use test fixture in preparation for more tests
Edwin Vane [Thu, 18 Jul 2013 11:59:08 +0000 (11:59 +0000)]
cpp11-migrate: Use test fixture in preparation for more tests

Existing tests are not changed but the set-up work is moved into a fixture
to simplify forthcoming new tests.

llvm-svn: 186575

11 years ago[ARMv8] Add NEON instructions VCVT{A, N, P, M}.
Joey Gouly [Thu, 18 Jul 2013 11:53:22 +0000 (11:53 +0000)]
[ARMv8] Add NEON instructions VCVT{A, N, P, M}.

llvm-svn: 186574

11 years ago[SystemZ] Use RNSBG
Richard Sandiford [Thu, 18 Jul 2013 10:40:35 +0000 (10:40 +0000)]
[SystemZ] Use RNSBG

This should be the last of the R.SBG patches for now.

llvm-svn: 186573

11 years agoAdd Thumb tests for the ARMv8 FP instructions that I recently added.
Joey Gouly [Thu, 18 Jul 2013 10:20:25 +0000 (10:20 +0000)]
Add Thumb tests for the ARMv8 FP instructions that I recently added.

Also, fix the namespace for two instructions that I missed previously.

llvm-svn: 186572

11 years ago[SystemZ] Generalize RxSBG SRA case
Richard Sandiford [Thu, 18 Jul 2013 10:14:55 +0000 (10:14 +0000)]
[SystemZ] Generalize RxSBG SRA case

The original code only folded SRA into ROTATE ... SELECTED BITS
if there was no outer shift.  This patch splits out that check
and generalises it slightly.  The extra cases aren't really that
interesting, but this is paving the way for RNSBG support.

llvm-svn: 186571

11 years ago[SystemZ] Use RXSBG
Richard Sandiford [Thu, 18 Jul 2013 10:06:15 +0000 (10:06 +0000)]
[SystemZ] Use RXSBG

Extend the previous R.SBG patches to handle XORs.

llvm-svn: 186570

11 years ago[SystemZ] Rename and formatting fixes
Richard Sandiford [Thu, 18 Jul 2013 09:45:08 +0000 (09:45 +0000)]
[SystemZ] Rename and formatting fixes

In hindsight, using "RISBG" for something that can be any type of
R.SBG instruction was a bit confusing, so this renames it to RxSBG.
That might not be the best choice either, since there is an instruction
called RXSBG, but hopefully the lower-case letter stands out enough.

While there I fixed a couple of GNUisms that had crept in --
sorry about that!

llvm-svn: 186569

11 years agoRemove the extra leading 0 from VMAXNMND.
Joey Gouly [Thu, 18 Jul 2013 09:34:35 +0000 (09:34 +0000)]
Remove the extra leading 0 from VMAXNMND.
The N3VDIntnp pattern takes bits<5> and I gave it 6 bits.

Thanks to Jiangning Liu for spotting it!

llvm-svn: 186568

11 years agoThis patch extends mips register parsing methods to allow indexed register parsing...
Vladimir Medic [Thu, 18 Jul 2013 09:28:35 +0000 (09:28 +0000)]
This patch extends mips register parsing methods to allow indexed register parsing. The corresponding test cases are added to the patch.

llvm-svn: 186567

11 years agoFix copy and paste bug from r186491 to make v2f64 use MOVAPD/MOVUPD as it should.
Craig Topper [Thu, 18 Jul 2013 07:16:44 +0000 (07:16 +0000)]
Fix copy and paste bug from r186491 to make v2f64 use MOVAPD/MOVUPD as it should.

llvm-svn: 186566

11 years agoReapply r186316 with a fix for one bug where the code could walk off the
Chandler Carruth [Thu, 18 Jul 2013 07:15:00 +0000 (07:15 +0000)]
Reapply r186316 with a fix for one bug where the code could walk off the
end of a vector. This was found with ASan. I've had one other report of
a crasher, but thus far been unable to reproduce the crash. It may well
be fixed with this version, and if not I'd like to get more information
from the build bots about what is happening.

See r186316 for the full commit log for the new implementation of the
SROA algorithm.

llvm-svn: 186565

11 years agoFix volatile _Complex alignment test on platforms where 64-bit floating point isn...
JF Bastien [Thu, 18 Jul 2013 06:11:45 +0000 (06:11 +0000)]
Fix volatile _Complex alignment test on platforms where 64-bit floating point isn't 64-bit aligned

Add x86-64 triple, and check its datalayout. Also add some comments, and use the new CHECK-LABEL.

llvm-svn: 186564

11 years agoSLPVectorizer: Speedup isConsecutive (that checks if two addresses are consecutive...
Nadav Rotem [Thu, 18 Jul 2013 04:33:20 +0000 (04:33 +0000)]
SLPVectorizer: Speedup isConsecutive (that checks if two addresses are consecutive in memory) by checking for additional patterns that don't need to go through SCEV.

llvm-svn: 186563

11 years agoPPC: Support dynamic allocas with large alignment
Hal Finkel [Thu, 18 Jul 2013 04:28:21 +0000 (04:28 +0000)]
PPC: Support dynamic allocas with large alignment

Support for dynamic stack alignments in the PPC backend has been unfinished, in
part because it depends on dynamic stack realignment (which I only just
recently implemented fully). Now we can also support dynamic allocas with
higher than the default target stack alignment (16 bytes).

In order to round-up the requested size to the maximum requested alignment, we
need an additional register to hold the rounded-up size. We're already using one
scavenged register to hold the previous stack-pointer value (which needs to be
stored with the signal-safe stdux update), and so when we have dynamic allocas
and a large alignment, we allocate two emergency spill slots for the scavenger.

llvm-svn: 186562

11 years agoRemove dead code.
Rafael Espindola [Thu, 18 Jul 2013 03:29:51 +0000 (03:29 +0000)]
Remove dead code.

llvm-svn: 186561

11 years agoConvert two uses if fstat with sys::fs::status.
Rafael Espindola [Thu, 18 Jul 2013 03:04:20 +0000 (03:04 +0000)]
Convert two uses if fstat with sys::fs::status.

llvm-svn: 186560

11 years agoFix a regression I introduced back in r178147.
Rafael Espindola [Thu, 18 Jul 2013 02:42:40 +0000 (02:42 +0000)]
Fix a regression I introduced back in r178147.

We don't want cast and dyn_cast to work on temporaries. They don't extend
lifetime like a direct bind to a reference would, so they can introduce
hard to find bugs.

I added tests to make sure we don't regress this. Thanks to Eli Friedman for
noticing this and for his suggestions on how to test it.

llvm-svn: 186559

11 years agoGive 'hasPath' a longer but clearer name 'isPotentiallyReachable'. Also expand
Nick Lewycky [Thu, 18 Jul 2013 02:34:51 +0000 (02:34 +0000)]
Give 'hasPath' a longer but clearer name 'isPotentiallyReachable'. Also expand
the comment. No functionality change. This change broken out of
http://llvm-reviews.chandlerc.com/D996 .

llvm-svn: 186558

11 years agos/BuiltinLocation/ArtificialLocation/
Adrian Prantl [Thu, 18 Jul 2013 01:36:04 +0000 (01:36 +0000)]
s/BuiltinLocation/ArtificialLocation/

llvm-svn: 186557

11 years agoInstead of checking against some version of "isType()" go ahead and
Eric Christopher [Thu, 18 Jul 2013 00:52:50 +0000 (00:52 +0000)]
Instead of checking against some version of "isType()" go ahead and
use the conversion to bool to check if we've managed to get a type
that isn't default constructed - as we meant to in the first place.

llvm-svn: 186556

11 years agoFix a compile error caught by bb-chapuni.
Adrian Prantl [Thu, 18 Jul 2013 00:47:12 +0000 (00:47 +0000)]
Fix a compile error caught by bb-chapuni.

llvm-svn: 186555

11 years agoFix a compile error caught by bb-chapuni.
Adrian Prantl [Thu, 18 Jul 2013 00:43:29 +0000 (00:43 +0000)]
Fix a compile error caught by bb-chapuni.

llvm-svn: 186554

11 years agoDon't generate bogus line table entries for __copy_helper_block_ and
Adrian Prantl [Thu, 18 Jul 2013 00:28:05 +0000 (00:28 +0000)]
Don't generate bogus line table entries for __copy_helper_block_ and
__destroy_helper_block_, but do generate scope information.

llvm-svn: 186553

11 years agoReplace llvm::DIBuilder::DisableDebugLocations() with two RAII interfaces
Adrian Prantl [Thu, 18 Jul 2013 00:28:02 +0000 (00:28 +0000)]
Replace llvm::DIBuilder::DisableDebugLocations() with two RAII interfaces
inspired by CodegenFunction::LexicalScope.
- NoLocation temporarily turns off debug locations altogether.
  This is useful for emitting instructions that should be
  counted towards the function prologue.
- BuiltinLocation temporarily switches to an artificial debug location
  that has a valid scope, but no line information. This is useful when
  emitting compiler-generated helper functions that have no source
  location associated with them.

llvm-svn: 186552

11 years agoClarified documentation.
Adrian Prantl [Thu, 18 Jul 2013 00:27:59 +0000 (00:27 +0000)]
Clarified documentation.

llvm-svn: 186551

11 years agoSimplify logic by using the appropriate function.
Adrian Prantl [Thu, 18 Jul 2013 00:27:56 +0000 (00:27 +0000)]
Simplify logic by using the appropriate function.

llvm-svn: 186550

11 years agoGet rid of the Dis/EnableDebugLocations() API.
Adrian Prantl [Thu, 18 Jul 2013 00:27:46 +0000 (00:27 +0000)]
Get rid of the Dis/EnableDebugLocations() API.
I'm moving this functionality into clang instead.

llvm-svn: 186549

11 years agoUpdate comment slightly.
Eric Christopher [Thu, 18 Jul 2013 00:23:50 +0000 (00:23 +0000)]
Update comment slightly.

llvm-svn: 186548

11 years agoAdd condition expression result to if and elif callbacks.
John Thompson [Thu, 18 Jul 2013 00:00:36 +0000 (00:00 +0000)]
Add condition expression result to if and elif callbacks.

llvm-svn: 186547

11 years agoReinstate r186040, with additional fixes and more test coverage (reverted in
Richard Smith [Wed, 17 Jul 2013 23:53:16 +0000 (23:53 +0000)]
Reinstate r186040, with additional fixes and more test coverage (reverted in
r186331).

Original commit log:
  If we friend a declaration twice, that should not make it visible to
  name lookup in the surrounding context. Slightly rework how we handle
  friend declarations to inherit the visibility of the prior
  declaration, rather than setting a friend declaration to be visible
  whenever there was a prior declaration.

llvm-svn: 186546

11 years agoPPC: Add base-pointer support to builtin setjmp/longjmp
Hal Finkel [Wed, 17 Jul 2013 23:50:51 +0000 (23:50 +0000)]
PPC: Add base-pointer support to builtin setjmp/longjmp

First, this changes the base-pointer implementation to remove an unnecessary
complication (and one that is incompatible with how builtin SjLj is
implemented): instead of using r31 as the base pointer when it is not needed as
a frame pointer, now the base pointer will always be r30 when needed.

Second, we introduce another pseudo register, BP, which is used just like the FP
pseudo register to refer to the base register before we know for certain what
register it will be.

Third, we now save BP into the jmp_buf, and restore r30 from that slot in
longjmp.  If the function that called setjmp did not use a base pointer, then
r30 will be overwritten by the setjmp-calling-function's restore code. FP
restoration (which is restored into r31) works the same way.

llvm-svn: 186545

11 years agoAdd comparison operators for DIDescriptors to fix c++98 fallout
Eric Christopher [Wed, 17 Jul 2013 23:25:22 +0000 (23:25 +0000)]
Add comparison operators for DIDescriptors to fix c++98 fallout
of operator bool change.

Also convert a variable in DebugIR.

llvm-svn: 186544

11 years agoAdd an explicit operator bool conversion to DIDescriptor to make
Eric Christopher [Wed, 17 Jul 2013 22:53:05 +0000 (22:53 +0000)]
Add an explicit operator bool conversion to DIDescriptor to make
it clear what we want to do. Unfortunately the conversion to
pointer operator fires now instead and chasing down all of the
conversions and making them explicit and handled is a large task
so add a FIXME with it.

llvm-svn: 186543

11 years ago80-column fixes.
Eric Christopher [Wed, 17 Jul 2013 22:52:53 +0000 (22:52 +0000)]
80-column fixes.

llvm-svn: 186542

11 years agoFix a comment.
Nadav Rotem [Wed, 17 Jul 2013 22:41:16 +0000 (22:41 +0000)]
Fix a comment.

llvm-svn: 186541

11 years agoHandle '.' correctly in hex float literal parsing.
Eli Friedman [Wed, 17 Jul 2013 22:17:29 +0000 (22:17 +0000)]
Handle '.' correctly in hex float literal parsing.

There were a couple of different loops that were not handling
'.' correctly in APFloat::convertFromHexadecimalString; these mistakes
could lead to assertion failures and incorrect rounding for overlong
hex float literals.

Fixes PR16643.

llvm-svn: 186539

11 years agoAdd some uncovered attribute tests
Tobias Grosser [Wed, 17 Jul 2013 22:13:44 +0000 (22:13 +0000)]
Add some uncovered attribute tests

llvm-svn: 186538

11 years agoEven more code conformance.
Robert Wilhelm [Wed, 17 Jul 2013 21:14:35 +0000 (21:14 +0000)]
Even more code conformance.

llvm-svn: 186537

11 years agoMS wide bitfield error check in Sema
Reid Kleckner [Wed, 17 Jul 2013 20:46:03 +0000 (20:46 +0000)]
MS wide bitfield error check in Sema

cl.exe treats wide bitfields as an error. This patch causes them to be
an error if IsMsStruct is true, as it is in straight C.

Patch by Warren Hunt!

Reviewers: eli.friedman

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

llvm-svn: 186536

11 years agoclang-format: Add space in corner case.
Daniel Jasper [Wed, 17 Jul 2013 20:25:02 +0000 (20:25 +0000)]
clang-format: Add space in corner case.

Before:
  SomeType s __attribute__((unused))(InitValue);
After:
  SomeType s __attribute__((unused)) (InitValue);

llvm-svn: 186535