platform/upstream/llvm.git
11 years agoFix a regression I introduced when I expanded the complex pseudos in
Reed Kotler [Sun, 9 Jun 2013 23:23:46 +0000 (23:23 +0000)]
Fix a regression I introduced when I expanded the complex pseudos in
the Mips16 port. A few of the psuedos could either take signed
or unsigned arguments and I did not distinguish the case and improperly
rejected some valid cases that the assembler had previously accepted
when they were pure pseudos that expanded as assembly instructions.

llvm-svn: 183633

11 years ago[CodeGen] Make CGCleanup.h include what it now uses
Reid Kleckner [Sun, 9 Jun 2013 16:56:53 +0000 (16:56 +0000)]
[CodeGen] Make CGCleanup.h include what it now uses

Also move CGCleanup.h to the top of CGCleanup.cpp to verify that
CGCleanup.h really includes what it needs.

llvm-svn: 183632

11 years ago[CodeGen] Move EHScopeStack to CGCleanup.h from CodeGenFunction.h
Reid Kleckner [Sun, 9 Jun 2013 16:45:02 +0000 (16:45 +0000)]
[CodeGen] Move EHScopeStack to CGCleanup.h from CodeGenFunction.h

No functionality change.  CGCleanup.cpp provides the implementation for
EHScopeStack, so it seems more consistent to place the class definition
in CGCleanup.h.

This should also help solve a header ordering problem that I have.

llvm-svn: 183631

11 years agotblgen: always lookup values from the original vector as it could be grown under...
Benjamin Kramer [Sun, 9 Jun 2013 15:20:23 +0000 (15:20 +0000)]
tblgen: always lookup values from the original vector as it could be grown under our feet.

PR16281.

llvm-svn: 183630

11 years agoAdd a const version of findNearestCommonDominator to PostDom for convenience.
Benjamin Kramer [Sun, 9 Jun 2013 15:09:30 +0000 (15:09 +0000)]
Add a const version of findNearestCommonDominator to PostDom for convenience.

PR16283.

llvm-svn: 183629

11 years agoRefine the ARM EHABI test cases.
Logan Chien [Sun, 9 Jun 2013 12:36:57 +0000 (12:36 +0000)]
Refine the ARM EHABI test cases.

Since we have ARM unwind directive parser and assembler, we
can check the correctness in two stages:

1. From LLVM assembly (.ll) to ARM assembly (.s)
2. From ARM assembly (.s) to ELF object file (.o)

We already have several "*.s to *.o" test cases.  This CL adds
some "*.ll to *.s" test cases and removes the redundant "*.ll to *.o"
test cases.

New test cases to check "*.ll to *.s" code generator:

- ehabi.ll: Check the correctness of the generated unwind directives.
- section-name.ll: Check the section name of functions.

Removed test cases:

- ehabi-mc-cantunwind.ll
  (Covered by ehabi-cantunwind.ll, and eh-directive-cantunwind.s)
- ehabi-mc-compact-pr0.ll
  (Covered by ehabi.ll, eh-compact-pr0.s, eh-directive-save.s, and
   eh-directive-setfp.s)
- ehabi-mc-compact-pr1.ll
  (Covered by ehabi.ll, eh-compact-pr1.s, eh-directive-save.s, and
   eh-directive-setfp.s)
- ehabi-mc.ll
  (Covered by ehabi.ll, and eh-directive-integrated-test.s)
- ehabi-mc-section-group.ll
  (Covered by section-name.ll, and eh-directive-section-comdat.s)
- ehabi-mc-section.ll
  (Covered by section-name.ll, and eh-directive-section.s)
- ehabi-mc-sh_link.ll
  (Covered by eh-directive-text-section.s, and eh-directive-section.s)

llvm-svn: 183628

11 years agoFix ARM unwind opcode assembler in several cases.
Logan Chien [Sun, 9 Jun 2013 12:22:30 +0000 (12:22 +0000)]
Fix ARM unwind opcode assembler in several cases.

Changes to ARM unwind opcode assembler:

* Fix multiple .save or .vsave directives.  Besides, the
  order is preserved now.

* For the directives which will generate multiple opcodes,
  such as ".save {r0-r11}", the order of the unwind opcode
  is fixed now, i.e. the registers with less encoding value
  are popped first.

* Fix the $sp offset calculation.  Now, we can use the
  .setfp, .pad, .save, and .vsave directives at any order.

Changes to test cases:

* Add test cases to check the order of multiple opcodes
  for the .save directive.

* Fix the incorrect $sp offset in the test case.  The
  stack pointer offset specified in the test case was
  incorrect.  (Changed test cases: ehabi-mc-section.ll and
  ehabi-mc.ll)

* The opcode to restore $sp are slightly reordered.  The
  behavior are not changed, and the new output is same
  as the output of GNU as.  (Changed test cases:
  eh-directive-pad.s and eh-directive-setfp.s)

llvm-svn: 183627

11 years agoRemoved PackedDouble domain from scalar instructions. Added more formats for the...
Elena Demikhovsky [Sun, 9 Jun 2013 07:37:10 +0000 (07:37 +0000)]
Removed PackedDouble domain from scalar instructions. Added more formats for the scalar stuff.

llvm-svn: 183626

11 years agoMake DeadArgumentElimination more conservative on variadic functions
Tim Northover [Sun, 9 Jun 2013 02:17:27 +0000 (02:17 +0000)]
Make DeadArgumentElimination more conservative on variadic functions

Variadic functions are particularly fragile in the face of ABI changes, so this
limits how much the pass changes them

llvm-svn: 183625

11 years agoARM FastISel fix load register classes
JF Bastien [Sun, 9 Jun 2013 00:20:24 +0000 (00:20 +0000)]
ARM FastISel fix load register classes

The register classes when emitting loads weren't quite restricting enough, leading to MI verification failure on the result register.

These are new failures that weren't there the first time I tried enabling ARM FastISel for new targets.

llvm-svn: 183624

11 years agoTargetLowering: Clean up method description comments
David Majnemer [Sat, 8 Jun 2013 23:51:45 +0000 (23:51 +0000)]
TargetLowering: Clean up method description comments

llvm-svn: 183623

11 years ago[PECOFF][Driver] Add -heap command line option.
Rui Ueyama [Sat, 8 Jun 2013 22:59:10 +0000 (22:59 +0000)]
[PECOFF][Driver] Add -heap command line option.

llvm-svn: 183622

11 years agosys::process::get_id() now returns the process ID instead of a process handle on...
Aaron Ballman [Sat, 8 Jun 2013 20:29:03 +0000 (20:29 +0000)]
sys::process::get_id() now returns the process ID instead of a process handle on Windows.  Patch thanks to Kim Gräsman!

llvm-svn: 183621

11 years agoFix the parser's updating of the template depth when parsing local templates and...
Faisal Vali [Sat, 8 Jun 2013 19:47:52 +0000 (19:47 +0000)]
Fix the parser's updating of the template depth when parsing local templates and late-parsed templates.
This is a slight tweak of r180708; It avoids incrementing depth when non-template local classes nested within member templates of local classes are encountered.
This patch was LGTM'd by Doug http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130506/079656.html and passed the regression tests that normally pass (i.e. excluding many Module and Index tests on Windows that fail regardless)

llvm-svn: 183620

11 years agoRevert r183618.
Faisal Vali [Sat, 8 Jun 2013 19:39:00 +0000 (19:39 +0000)]
Revert r183618.
I ran clang-format on my patch but it seemed to have wreaked havoc with new lines  - might have to do with using it on windows :( will resubmit once i've cleaned this issue up. sorry.

llvm-svn: 183619

11 years agoFix the parser's updating of the template depth when parsing local templates and...
Faisal Vali [Sat, 8 Jun 2013 19:33:09 +0000 (19:33 +0000)]
Fix the parser's updating of the template depth when parsing local templates and late-parsed templates. This is a slight tweak of r180708; It avoids incrementing depth when non-template local classes nested within member templates of local classes are encountered.
This patch was LGTM'd by Doug http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130506/079656.html and passed the regression tests that normally pass (i.e. excluding many Module and Index tests on Windows that fail regardless)

llvm-svn: 183618

11 years agoAdd a test case for blocks taking an array typedef
Reid Kleckner [Sat, 8 Jun 2013 18:51:21 +0000 (18:51 +0000)]
Add a test case for blocks taking an array typedef

r183614 was failing because va_list on some platforms is defined in a
similar manner.  This test fails on Windows with r183614 applied.

llvm-svn: 183617

11 years agoRevert "[Sema] Make FunctionType's TSI use unadjusted argument types"
Reid Kleckner [Sat, 8 Jun 2013 18:19:52 +0000 (18:19 +0000)]
Revert "[Sema] Make FunctionType's TSI use unadjusted argument types"

This reverts commit r183614.

It broke test/Sema/block-printf-attribute-1.c on non-Windows platforms,
and the fix is not trivial.

llvm-svn: 183616

11 years ago[Sema] Make FunctionType's TSI use unadjusted argument types
Reid Kleckner [Sat, 8 Jun 2013 17:28:56 +0000 (17:28 +0000)]
[Sema] Make FunctionType's TSI use unadjusted argument types

This helps preserve the type-as-written in the AST, which we need for
MSVC mangling.  In particular, we need to preserve the types of array
parameters in function pointer types.

The essence of this change is:
-  QualType ArgTy = Param->getType();
+  QualType ArgTy = Param->getTypeSourceInfo()->getType();

... followed by the adjustment in ActOnFunctionDeclarator().

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

llvm-svn: 183614

11 years ago[Sparc] Delete FPMover Pass and remove Fp* Pseudo-instructions from Sparc backend.
Venkatraman Govindaraju [Sat, 8 Jun 2013 15:32:59 +0000 (15:32 +0000)]
[Sparc] Delete FPMover Pass and remove Fp* Pseudo-instructions from Sparc backend.

llvm-svn: 183613

11 years agoARM: fix VMOVvnf32 decoding when ambiguous with VCVT
Amaury de la Vieuville [Sat, 8 Jun 2013 13:54:05 +0000 (13:54 +0000)]
ARM: fix VMOVvnf32 decoding when ambiguous with VCVT

Enforce Table A7-15 (op=1, cmode=0b111) -> UNDEF

llvm-svn: 183612

11 years agoARM: enforce SRS decoding constraints
Amaury de la Vieuville [Sat, 8 Jun 2013 13:43:59 +0000 (13:43 +0000)]
ARM: enforce SRS decoding constraints

llvm-svn: 183611

11 years agoARM: fix CPS decoding when ambiguous with QADD
Amaury de la Vieuville [Sat, 8 Jun 2013 13:38:52 +0000 (13:38 +0000)]
ARM: fix CPS decoding when ambiguous with QADD

Handle the case when the disassembler table can't tell
the difference between some encodings of QADD and CPS.

Add some necessary safe guards in CPS decoding as well.

llvm-svn: 183610

11 years agoRecognition of empty structures and unions is moved to semantic stage
Serge Pavlov [Sat, 8 Jun 2013 13:29:58 +0000 (13:29 +0000)]
Recognition of empty structures and unions is moved to semantic stage

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

llvm-svn: 183609

11 years agoARM: fix VCVT decoding
Amaury de la Vieuville [Sat, 8 Jun 2013 13:29:11 +0000 (13:29 +0000)]
ARM: fix VCVT decoding

UNPRED was reported instead of UNDEF

llvm-svn: 183608

11 years agoUpdate code listings in LLVM tutorial.
Logan Chien [Sat, 8 Jun 2013 09:03:03 +0000 (09:03 +0000)]
Update code listings in LLVM tutorial.

Several LLVM headers are moved.  The code listings in
LLVM tutorial are not updated yet.

This CL removes the code replica in the .rst, and replace
them with a literalinclude directive, so that sphinx can
include the latest code automatically.

llvm-svn: 183607

11 years ago Fix a potential bug in r183584.
Shuxin Yang [Sat, 8 Jun 2013 04:56:05 +0000 (04:56 +0000)]
  Fix a potential bug in r183584.

  r183584 tries to derive some info from the code *AFTER* a call and apply
these derived info to the code *BEFORE* the call, which is not always safe
as the call in question may never return, and in this case, the derived
info is invalid.

  Thank Duncan for pointing out this potential bug.

rdar://14073661

llvm-svn: 183606

11 years agoDon't artifically restrict input object size.
Sean Silva [Sat, 8 Jun 2013 04:32:59 +0000 (04:32 +0000)]
Don't artifically restrict input object size.

sys::IdentifyFileType is already conscious of the length, and
object_error::invalid_file_type is returned below anyway if
sys::IdentifyFileType doesn't recognize the file.

llvm-svn: 183605

11 years ago[PECOFF][Driver] Add -stack command line option.
Rui Ueyama [Sat, 8 Jun 2013 03:59:00 +0000 (03:59 +0000)]
[PECOFF][Driver] Add -stack command line option.

llvm-svn: 183604

11 years ago[WinLink] Fix use-after-return.
Rui Ueyama [Sat, 8 Jun 2013 03:39:35 +0000 (03:39 +0000)]
[WinLink] Fix use-after-return.

llvm-svn: 183603

11 years agoAdded a type checking which handle the case of an ext vector and integral scalar
Jin-Gu Kang [Sat, 8 Jun 2013 02:15:36 +0000 (02:15 +0000)]
Added a type checking which handle the case of an ext vector and integral scalar

llvm-svn: 183602

11 years agoFix unused variable warning from my previous patch.
JF Bastien [Sat, 8 Jun 2013 00:51:51 +0000 (00:51 +0000)]
Fix unused variable warning from my previous patch.

llvm-svn: 183601

11 years ago[analyzer] Minor fixups to r183062
Anna Zaks [Sat, 8 Jun 2013 00:29:29 +0000 (00:29 +0000)]
[analyzer] Minor fixups to r183062

Based on feedback from Jordan.

llvm-svn: 183600

11 years ago[analyzer; alternate edges] Fix the edge locations in presence of macros.
Anna Zaks [Sat, 8 Jun 2013 00:29:24 +0000 (00:29 +0000)]
[analyzer; alternate edges] Fix the edge locations in presence of macros.

We drew the diagnostic edges to wrong statements in cases the note was on a macro.
The fix is simple, but seems to work just fine for a whole bunch of test cases (plist-macros.cpp).

Also, removes an unnecessary edge in edges-new.mm, when function signature starts with a macro.

llvm-svn: 183599

11 years agoFixed comment typo.
Michael Gottesman [Sat, 8 Jun 2013 00:27:19 +0000 (00:27 +0000)]
Fixed comment typo.

llvm-svn: 183598

11 years agoDebug info: An if condition now creates a lexical scope of its own.
Adrian Prantl [Sat, 8 Jun 2013 00:16:55 +0000 (00:16 +0000)]
Debug info: An if condition now creates a lexical scope of its own.
Two variables with the same name declared in two if conditions in the same
scope are no longer coalesced into one.

rdar://problem/14024005

llvm-svn: 183597

11 years ago[mips] Use a helper function which compares the size of the source and
Akira Hatanaka [Sat, 8 Jun 2013 00:14:54 +0000 (00:14 +0000)]
[mips] Use a helper function which compares the size of the source and
destination operands of an instruction.

No functionality changes.

llvm-svn: 183596

11 years agoReapply r183552. This time, use a standard type for the option to avoid template
Quentin Colombet [Sat, 8 Jun 2013 00:07:54 +0000 (00:07 +0000)]
Reapply r183552. This time, use a standard type for the option to avoid template
instantiation issue with non-standard type.

Add a backend option to warn on a given stack size limit.
Option: -mllvm -warn-stack-size=<limit>
Output (if limit is exceeded):
warning: Stack size limit exceeded (<actual size>) in <functionName>.

The longer term plan is to hook that to a clang warning.
PR:4072
<rdar://problem/13987214>.

llvm-svn: 183595

11 years agoRecursively lifetime-extend into array temporaries. These can get implicitly
Richard Smith [Sat, 8 Jun 2013 00:02:08 +0000 (00:02 +0000)]
Recursively lifetime-extend into array temporaries. These can get implicitly
created through binding a reference-to-array to an initializer list.

llvm-svn: 183594

11 years agoR600: Use a refined heuristic to choose when switching clause
Vincent Lejeune [Fri, 7 Jun 2013 23:30:34 +0000 (23:30 +0000)]
R600: Use a refined heuristic to choose when switching clause

This is using a hint from AMD APP OpenCL Programming Guide with
empirically tweaked parameters.
I used Unigine Heaven 3.0 to determine best parameters on my system
(i7 2600/Radeon 6950/Kernel 3.9.4) the benchmark :
it went from 38.8 average fps to 39.6, which is ~3% gain.
(Lightmark 2008.2 gain is much more marginal: from 537 to 539)

There is no lit test provided as the parameter were determined
empirically and it it would be nearly impossiblet to find a test
program that check for optimal behavior.

llvm-svn: 183593

11 years agoR600: Anti dep better handled in tex clause
Vincent Lejeune [Fri, 7 Jun 2013 23:30:26 +0000 (23:30 +0000)]
R600: Anti dep better handled in tex clause

llvm-svn: 183592

11 years agoWhen we're compiling with -pg make sure to link with gcrt1.o on linux. Be
Eric Christopher [Fri, 7 Jun 2013 23:25:01 +0000 (23:25 +0000)]
When we're compiling with -pg make sure to link with gcrt1.o on linux. Be
sure to do this always, this matches the behavior for the gcc driver.

Fixes PR16251.

Based on a patch by Qiao Yang.

llvm-svn: 183591

11 years agoFix va_arg on x86-64 for a struct containing a single int128_t. PR16248
Eli Friedman [Fri, 7 Jun 2013 23:20:55 +0000 (23:20 +0000)]
Fix va_arg on x86-64 for a struct containing a single int128_t.  PR16248

llvm-svn: 183590

11 years agoRemember the anyext patterns.
Jakob Stoklund Olesen [Fri, 7 Jun 2013 22:59:29 +0000 (22:59 +0000)]
Remember the anyext patterns.

llvm-svn: 183589

11 years agoLoosen r178109 even further, to assume that all redefined macros in system headers...
Douglas Gregor [Fri, 7 Jun 2013 22:56:11 +0000 (22:56 +0000)]
Loosen r178109 even further, to assume that all redefined macros in system headers and system modules are equivalent.

Fixes <rdar://problem/14025673>.

llvm-svn: 183588

11 years agoAdd missing zextloadi1 to i64 patterns. PR16721.
Jakob Stoklund Olesen [Fri, 7 Jun 2013 22:55:05 +0000 (22:55 +0000)]
Add missing zextloadi1 to i64 patterns. PR16721.

llvm-svn: 183587

11 years ago80-column fixup after recent change to getOrCreateType.
Eric Christopher [Fri, 7 Jun 2013 22:54:39 +0000 (22:54 +0000)]
80-column fixup after recent change to getOrCreateType.

llvm-svn: 183586

11 years agoEven in a modules world, people will depend on the weird xmmintrin.h -> emmintrin...
Douglas Gregor [Fri, 7 Jun 2013 22:49:44 +0000 (22:49 +0000)]
Even in a modules world, people will depend on the weird xmmintrin.h -> emmintrin.h forwarding.

llvm-svn: 183585

11 years ago Fix an assertion in MemCpyOpt pass.
Shuxin Yang [Fri, 7 Jun 2013 22:45:21 +0000 (22:45 +0000)]
  Fix an assertion in MemCpyOpt pass.

  The MemCpyOpt pass is capable of optimizing:
      callee(&S); copy N bytes from S to D.
    into:
      callee(&D);
subject to some legality constraints.

  Assertion is triggered when the compiler tries to evalute "sizeof(typeof(D))",
while D is an opaque-typed, 'sret' formal argument of function being compiled.
i.e. the signature of the func being compiled is something like this:
  T caller(...,%opaque* noalias nocapture sret %D, ...)

  The fix is that when come across such situation, instead of calling some
utility functions to get the size of D's type (which will crash), we simply
assume D has at least N bytes as implified by the copy-instruction.

rdar://14073661

llvm-svn: 183584

11 years agoFix line endings.
Eli Friedman [Fri, 7 Jun 2013 22:42:22 +0000 (22:42 +0000)]
Fix line endings.

llvm-svn: 183583

11 years agoaddress some comments on r183474:
Adrian Prantl [Fri, 7 Jun 2013 22:29:12 +0000 (22:29 +0000)]
address some comments on r183474:
- factor the name construction part out from constructSetterName
- rename constructSetterName to the more appropriate constructSetterSelector

no functionality change intended.
rdar://problem/14035789

llvm-svn: 183582

11 years agoDisallow i64 div/rem in PPC32 counter loops
Hal Finkel [Fri, 7 Jun 2013 22:16:19 +0000 (22:16 +0000)]
Disallow i64 div/rem in PPC32 counter loops

On PPC32, [su]div,rem on i64 types are transformed into runtime library
function calls. As a result, they are not allowed in counter-based loops (the
counter-loops verification pass caught this error; this change fixes PR16169).

llvm-svn: 183581

11 years agoUpdating convenience register attach test
Andrew Kaylor [Fri, 7 Jun 2013 22:16:14 +0000 (22:16 +0000)]
Updating convenience register attach test

llvm-svn: 183580

11 years agoRevert commits related to stack warning.
Quentin Colombet [Fri, 7 Jun 2013 22:14:50 +0000 (22:14 +0000)]
Revert commits related to stack warning.

llvm-svn: 183579

11 years agoDon't set stdin to devnull for forked processes
Andrew Kaylor [Fri, 7 Jun 2013 22:12:54 +0000 (22:12 +0000)]
Don't set stdin to devnull for forked processes

llvm-svn: 183578

11 years agoDon't retry the Connect when starting up debugserver if the reason for the previous...
Jim Ingham [Fri, 7 Jun 2013 22:09:53 +0000 (22:09 +0000)]
Don't retry the Connect when starting up debugserver if the reason for the previous failure was
EINTR.  That means the user was trying to interrupt us, and we should just stop instead.

<rdar://problem/13184758>

llvm-svn: 183577

11 years agoWe've got the type right, which has broken these tests - but now we need to get the...
David Blaikie [Fri, 7 Jun 2013 22:09:23 +0000 (22:09 +0000)]
We've got the type right, which has broken these tests - but now we need to get the location information correct that the type was papering over

llvm-svn: 183576

11 years agoRevert "Properly consider the range of enum for range comparisons in C mode"
David Majnemer [Fri, 7 Jun 2013 22:07:20 +0000 (22:07 +0000)]
Revert "Properly consider the range of enum for range comparisons in C mode"

The approach r183084 took was wrong, back it out.

llvm-svn: 183575

11 years agoExplicit triple in warn stack size test cases to not depend on OS.
Quentin Colombet [Fri, 7 Jun 2013 21:09:42 +0000 (21:09 +0000)]
Explicit triple in warn stack size test cases to not depend on OS.

llvm-svn: 183574

11 years agoFix handling of files without a symbol table.
Rafael Espindola [Fri, 7 Jun 2013 21:08:19 +0000 (21:08 +0000)]
Fix handling of files without a symbol table.

This fixes a recent regression (r183338). Stripped elf files (like installed
crtn.o for example), are not required to have a symbol table. Handle that
correctly.

llvm-svn: 183573

11 years agoDon't cache the instruction and register info from the TargetMachine, because
Bill Wendling [Fri, 7 Jun 2013 21:04:35 +0000 (21:04 +0000)]
Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

No functionality change intended.

llvm-svn: 183572

11 years agoDon't cache the instruction and register info from the TargetMachine, because
Bill Wendling [Fri, 7 Jun 2013 21:00:34 +0000 (21:00 +0000)]
Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

No functionality change intended.

llvm-svn: 183571

11 years agoRemove unused c'tor.
Bill Wendling [Fri, 7 Jun 2013 20:59:31 +0000 (20:59 +0000)]
Remove unused c'tor.

llvm-svn: 183570

11 years agoRevert r183281, adds a comment about how to reproduce the hang.
Ashok Thirumurthi [Fri, 7 Jun 2013 20:58:47 +0000 (20:58 +0000)]
Revert r183281, adds a comment about how to reproduce the hang.

llvm-svn: 183569

11 years agoR600: Fix calculation of stack offset in AMDGPUFrameLowering
Tom Stellard [Fri, 7 Jun 2013 20:52:05 +0000 (20:52 +0000)]
R600: Fix calculation of stack offset in AMDGPUFrameLowering

We weren't computing structure size correctly and we were relying on
the original alloca instruction to compute the offset, which isn't
always reliable.

Reviewed-by: Vincent Lejeune <vljn@ovi.com>
llvm-svn: 183568

11 years agoDon't cache the instruction and register info from the TargetMachine, because
Bill Wendling [Fri, 7 Jun 2013 20:42:15 +0000 (20:42 +0000)]
Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

No functionality change intended.

llvm-svn: 183567

11 years agoR600: Rework subtarget info and remove AMDILDevice classes
Tom Stellard [Fri, 7 Jun 2013 20:37:48 +0000 (20:37 +0000)]
R600: Rework subtarget info and remove AMDILDevice classes

This should simplify the subtarget definitions and make it easier to
add new ones.

Reviewed-by: Vincent Lejeune <vljn@ovi.com>
llvm-svn: 183566

11 years agoDon't cache the instruction and register info from the TargetMachine, because
Bill Wendling [Fri, 7 Jun 2013 20:35:25 +0000 (20:35 +0000)]
Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

No functionality change intended.

llvm-svn: 183565

11 years agoAdd missing file from r183563 (the recommit of 183466).
Eli Friedman [Fri, 7 Jun 2013 20:33:10 +0000 (20:33 +0000)]
Add missing file from r183563 (the recommit of 183466).

llvm-svn: 183564

11 years agoRe-commit r183466 with a fix to make the TypeLoc casting machinery work
Eli Friedman [Fri, 7 Jun 2013 20:31:48 +0000 (20:31 +0000)]
Re-commit r183466 with a fix to make the TypeLoc casting machinery work
correctly in the presence of qualified types.

(I had to change the unittest because it was trying to cast a
QualifiedTypeLoc to TemplateSpecializationTypeLoc.)

llvm-svn: 183563

11 years ago[docs] Add link to Microsoft PE/COFF Spec.
Rui Ueyama [Fri, 7 Jun 2013 20:30:27 +0000 (20:30 +0000)]
[docs] Add link to Microsoft PE/COFF Spec.

llvm-svn: 183562

11 years agoDon't cache the instruction and register info from the TargetMachine, because
Bill Wendling [Fri, 7 Jun 2013 20:28:55 +0000 (20:28 +0000)]
Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.

No functionality change intended.

llvm-svn: 183561

11 years agoR600: Fix the fetch limits for R600 generation GPUs
Tom Stellard [Fri, 7 Jun 2013 20:28:55 +0000 (20:28 +0000)]
R600: Fix the fetch limits for R600 generation GPUs

Reviewed-by: Vincent Lejeune <vljn@ovi.com>
https://bugs.freedesktop.org/show_bug.cgi?id=64257

llvm-svn: 183560

11 years agoR600: Move Subtarget feature definitions into AMDGPU.td
Tom Stellard [Fri, 7 Jun 2013 20:28:49 +0000 (20:28 +0000)]
R600: Move Subtarget feature definitions into AMDGPU.td

This is the convention used by the other targets.

Reviewed-by: Vincent Lejeune <vljn@ovi.com>
llvm-svn: 183559

11 years agoR600: Remove unnecessary include
Tom Stellard [Fri, 7 Jun 2013 20:28:43 +0000 (20:28 +0000)]
R600: Remove unnecessary include

Reviewed-by: Vincent Lejeune <vljn@ovi.com>
llvm-svn: 183558

11 years agoReverting r183529:
Bill Wendling [Fri, 7 Jun 2013 20:28:29 +0000 (20:28 +0000)]
Reverting r183529:

This is causing the following error on Darwin:

/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:282:1: error: 'assertion_failed__282' declared as an array with a negative size
CHECK_TYPE_SIZE(ifconf);
^~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:223:3: note: expanded from macro 'CHECK_TYPE_SIZE'
  COMPILER_CHECK(sizeof(__sanitizer_##TYPE) == sizeof(TYPE))
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:239:30: note: expanded from macro 'COMPILER_CHECK'
#define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:245:57: note: expanded from macro 'IMPL_COMPILER_ASSERT'
    typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
                                                        ^~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:284:1: error: 'assertion_failed__284' declared as an array with a negative size
CHECK_SIZE_AND_OFFSET(ifconf, ifc_ifcu);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:228:3: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
  COMPILER_CHECK(offsetof(__sanitizer_##CLASS, MEMBER) ==          \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:239:30: note: expanded from macro 'COMPILER_CHECK'
#define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Volumes/Sandbox/llvm-clean.src/projects/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:245:57: note: expanded from macro 'IMPL_COMPILER_ASSERT'
    typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
                                                        ^~~~~~~~~~~~~~~

llvm-svn: 183557

11 years agoObjective-C: Another case of issuing warning about misusing
Fariborz Jahanian [Fri, 7 Jun 2013 20:26:51 +0000 (20:26 +0000)]
Objective-C: Another case of issuing warning about misusing
property auto-synthesis before knowingit it is to be
auto-synthesized. // rdar://14094682

llvm-svn: 183556

11 years agoAdd more explicit link targets to headers in LangRef.rst
Eli Bendersky [Fri, 7 Jun 2013 20:24:43 +0000 (20:24 +0000)]
Add more explicit link targets to headers in LangRef.rst

llvm-svn: 183555

11 years ago[LayoutPass] Add a method to check the followon graph structure.
Rui Ueyama [Fri, 7 Jun 2013 20:18:39 +0000 (20:18 +0000)]
[LayoutPass] Add a method to check the followon graph structure.

Found that having a method to check the strucutre of the followon graph makes
it easy to debug file readers. The method checks if there's no wrong edge in
followOnNexts and followOnRoots. It is called only when debuggging is enabled
for LayoutPass.

Reviewers: shankarke

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

llvm-svn: 183553

11 years agoAdd a backend option to warn on a given stack size limit.
Quentin Colombet [Fri, 7 Jun 2013 20:18:12 +0000 (20:18 +0000)]
Add a backend option to warn on a given stack size limit.
Option: -mllvm -warn-stack-size=<limit>
Output (if limit is exceeded):
warning: Stack size limit exceeded (<actual size>) in <functionName>.

The longer term plan is to hook that to a clang warning.
PR:4072
<rdar://problem/13987214>

llvm-svn: 183552

11 years agoARM FastISel integer sext/zext improvements
JF Bastien [Fri, 7 Jun 2013 20:10:37 +0000 (20:10 +0000)]
ARM FastISel integer sext/zext improvements

My recent ARM FastISel patch exposed this bug:
  http://llvm.org/bugs/show_bug.cgi?id=16178
The root cause is that it can't select integer sext/zext pre-ARMv6 and
asserts out.

The current integer sext/zext code doesn't handle other cases gracefully
either, so this patch makes it handle all sext and zext from i1/i8/i16
to i8/i16/i32, with and without ARMv6, both in Thumb and ARM mode. This
should fix the bug as well as make FastISel faster because it bails to
SelectionDAG less often. See fastisel-ext.patch for this.

fastisel-ext-tests.patch changes current tests to always use reg-imm AND
for 8-bit zext instead of UXTB. This simplifies code since it is
supported on ARMv4t and later, and at least on A15 both should perform
exactly the same (both have exec 1 uop 1, type I).

2013-05-31-char-shift-crash.ll is a bitcode version of the above bug
16178 repro.

fast-isel-ext.ll tests all sext/zext combinations that ARM FastISel
should now handle.

Note that my ARM FastISel enabling patch was reverted due to a separate
failure when dealing with MCJIT, I'll fix this second failure and then
turn FastISel on again for non-iOS ARM targets.

I've tested "make check-all" on my x86 box, and "lnt test-suite" on A15
hardware.

llvm-svn: 183551

11 years agoPR16273: Weaken a bogus assertion.
Richard Smith [Fri, 7 Jun 2013 20:03:01 +0000 (20:03 +0000)]
PR16273: Weaken a bogus assertion.

llvm-svn: 183550

11 years agoR600: Don't compare iterators of different maps.
Benjamin Kramer [Fri, 7 Jun 2013 19:59:34 +0000 (19:59 +0000)]
R600: Don't compare iterators of different maps.

Found be libstdc's debug mode.

llvm-svn: 183549

11 years agoAdd explicit link targets to some headers in LangRef.rst
Eli Bendersky [Fri, 7 Jun 2013 19:40:08 +0000 (19:40 +0000)]
Add explicit link targets to some headers in LangRef.rst

llvm-svn: 183548

11 years agoUpdated the LLDB status page to reflect the recent addition of multi-threaded support.
Ashok Thirumurthi [Fri, 7 Jun 2013 19:21:45 +0000 (19:21 +0000)]
Updated the LLDB status page to reflect the recent addition of multi-threaded support.

Reworked the download information on lldb.llvm.org:
- svn copy of download.html to source.html with information on source-code access
- new download.html with links to download nightly builds and Debian releases
- updated the sidebar to reflect these changes

llvm-svn: 183547

11 years agoNo functionality change.
Manman Ren [Fri, 7 Jun 2013 18:53:29 +0000 (18:53 +0000)]
No functionality change.

Constify a few member functions.

llvm-svn: 183546

11 years agoDefine id to the correct type.
Rafael Espindola [Fri, 7 Jun 2013 18:41:01 +0000 (18:41 +0000)]
Define id to the correct type.

Found this while working on pr16247. The fix for that bug will cause clang to
reject this.

llvm-svn: 183545

11 years agoTeach AsmPrinter how to print odd constants.
Quentin Colombet [Fri, 7 Jun 2013 18:36:03 +0000 (18:36 +0000)]
Teach AsmPrinter how to print odd constants.

Fix an assertion when the compiler encounters big constants whose bit width is
not a multiple of 64-bits.
Although clang would never generate something like this, the backend should be
able to handle any legal IR.

<rdar://problem/13363576>

llvm-svn: 183544

11 years agoDIBuilder: No functionality change.
Manman Ren [Fri, 7 Jun 2013 18:35:53 +0000 (18:35 +0000)]
DIBuilder: No functionality change.

Use the correct DIType when creating types in DIBuilder.

llvm-svn: 183543

11 years agoObjective-C: Removes a bogus warning about auto-synthesis
Fariborz Jahanian [Fri, 7 Jun 2013 18:32:55 +0000 (18:32 +0000)]
Objective-C: Removes a bogus warning about auto-synthesis
of properties. Fixes // rdar://14085456

llvm-svn: 183542

11 years agoVincent says the element is at most once in the vector, so we don't need a full std...
Benjamin Kramer [Fri, 7 Jun 2013 18:18:12 +0000 (18:18 +0000)]
Vincent says the element is at most once in the vector, so we don't need a full std::remove.

llvm-svn: 183541

11 years agoUse isxdigit.
Rafael Espindola [Fri, 7 Jun 2013 18:05:03 +0000 (18:05 +0000)]
Use isxdigit.

Thanks to Benjamin Kramer for the suggestion.

llvm-svn: 183540

11 years agoMake operator== non-member for greater symmetry.
Rafael Espindola [Fri, 7 Jun 2013 18:00:04 +0000 (18:00 +0000)]
Make operator== non-member for greater symmetry.

Thanks to David Blaikie for the suggestion.

llvm-svn: 183539

11 years agoThread the 'Invalid' out parameter through SourceManager::getSLocEntry() and callees...
Argyrios Kyrtzidis [Fri, 7 Jun 2013 17:57:59 +0000 (17:57 +0000)]
Thread the 'Invalid' out parameter through SourceManager::getSLocEntry() and callees of SourceManager::getSLocEntryByID().

Also add an 'Invalid' check in SourceManager::computeMacroArgsCache().

llvm-svn: 183538

11 years agoFix a typo in asm string of BP* family of instructions. With this fix
Roman Divacky [Fri, 7 Jun 2013 17:46:57 +0000 (17:46 +0000)]
Fix a typo in asm string of BP* family of instructions. With this fix
I am able to compile/assemble/link/run /bin/echo from FreeBSD.

llvm-svn: 183537

11 years agoImproved handling of escaped newlines at the token start.
Alexander Kornienko [Fri, 7 Jun 2013 17:45:07 +0000 (17:45 +0000)]
Improved handling of escaped newlines at the token start.

Summary: Remove them from the TokenText as well.

Reviewers: klimek

Reviewed By: klimek

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

llvm-svn: 183536

11 years agoHandle Unicode characters in fix-it replacement strings.
Jordan Rose [Fri, 7 Jun 2013 17:16:01 +0000 (17:16 +0000)]
Handle Unicode characters in fix-it replacement strings.

Patch by Sukolsak Sakshuwong!

llvm-svn: 183535

11 years ago[Object/COFF] BaseOfData field should be absent in PE32+.
Rui Ueyama [Fri, 7 Jun 2013 16:58:30 +0000 (16:58 +0000)]
[Object/COFF] BaseOfData field should be absent in PE32+.

llvm-svn: 183534

11 years agoSupport OpenBSD's native frame protection conventions.
Rafael Espindola [Fri, 7 Jun 2013 16:35:57 +0000 (16:35 +0000)]
Support OpenBSD's native frame protection conventions.

OpenBSD's stack smashing protection differs slightly from other
platforms:

  1. The smash handler function is "__stack_smash_handler(const char
     *funcname)" instead of "__stack_chk_fail(void)".

  2. There's a hidden "long __guard_local" object that gets linked
     into each executable and DSO.

Patch by Matthew Dempsky.

llvm-svn: 183533

11 years agoR600: Fix a potential iterator invalidation issue.
Benjamin Kramer [Fri, 7 Jun 2013 16:13:49 +0000 (16:13 +0000)]
R600: Fix a potential iterator invalidation issue.

As a bonus this reduces the loop from O(n^2) to O(n).

llvm-svn: 183532