platform/upstream/llvm.git
11 years agoLoads and stores without an explicit alignment use the abi alignment not the
Duncan Sands [Mon, 29 Oct 2012 14:12:44 +0000 (14:12 +0000)]
Loads and stores without an explicit alignment use the abi alignment not the
preferred alignment.  Correct the documentation.

llvm-svn: 166925

11 years agoHandle '*' and '#' asm constraint modifiers.
Ulrich Weigand [Mon, 29 Oct 2012 12:20:54 +0000 (12:20 +0000)]
Handle '*' and '#' asm constraint modifiers.

llvm-svn: 166924

11 years agoRather than duplicating the getPointerSize code just call getPointerSize.
Duncan Sands [Mon, 29 Oct 2012 12:19:04 +0000 (12:19 +0000)]
Rather than duplicating the getPointerSize code just call getPointerSize.

llvm-svn: 166923

11 years agoSilence a GCC warning about comparing signed and unsigned types.
Duncan Sands [Mon, 29 Oct 2012 11:29:53 +0000 (11:29 +0000)]
Silence a GCC warning about comparing signed and unsigned types.

llvm-svn: 166922

11 years agoFix ASTMatchersTests to not create an overloaded-virtual warning.
Daniel Jasper [Mon, 29 Oct 2012 10:48:25 +0000 (10:48 +0000)]
Fix ASTMatchersTests to not create an overloaded-virtual warning.

llvm-svn: 166921

11 years agoAlign the data section correctly when loading an ELF file.
Tim Northover [Mon, 29 Oct 2012 10:47:07 +0000 (10:47 +0000)]
Align the data section correctly when loading an ELF file.

Patch by Amara Emerson.

llvm-svn: 166920

11 years agoMake use of common-symbol alignment info in ELF loader.
Tim Northover [Mon, 29 Oct 2012 10:47:04 +0000 (10:47 +0000)]
Make use of common-symbol alignment info in ELF loader.

Patch by Amara Emerson.

llvm-svn: 166919

11 years agoAdd interface for querying object files for symbol values.
Tim Northover [Mon, 29 Oct 2012 10:47:00 +0000 (10:47 +0000)]
Add interface for querying object files for symbol values.

Currently only implemented for ELF.

Patch by Amara Emerson.

llvm-svn: 166918

11 years agoImplement has(), hasDescendant(), forEach() and forEachDescendant() for
Daniel Jasper [Mon, 29 Oct 2012 10:14:44 +0000 (10:14 +0000)]
Implement has(), hasDescendant(), forEach() and forEachDescendant() for
Types, QualTypes and TypeLocs.

Review: http://llvm-reviews.chandlerc.com/D83
llvm-svn: 166917

11 years agova_start, va_end, va_copy: InstrinsicInst subclasses and InstVisitor support.
Evgeniy Stepanov [Mon, 29 Oct 2012 09:39:03 +0000 (09:39 +0000)]
va_start, va_end, va_copy: InstrinsicInst subclasses and InstVisitor support.

llvm-svn: 166916

11 years agoRemove spurious mode marker from .cpp file.
Nick Lewycky [Mon, 29 Oct 2012 06:05:01 +0000 (06:05 +0000)]
Remove spurious mode marker from .cpp file.

llvm-svn: 166915

11 years agoAdd missing emacs major mode marker.
Nick Lewycky [Mon, 29 Oct 2012 06:03:58 +0000 (06:03 +0000)]
Add missing emacs major mode marker.

llvm-svn: 166914

11 years agoFix name of this file.
Nick Lewycky [Mon, 29 Oct 2012 06:03:40 +0000 (06:03 +0000)]
Fix name of this file.

llvm-svn: 166913

11 years agoAdd missing emacs major mode marker.
Nick Lewycky [Mon, 29 Oct 2012 06:02:59 +0000 (06:02 +0000)]
Add missing emacs major mode marker.

llvm-svn: 166912

11 years agoCalling TLI->getNumRegisters creates a circular dependency when building LLVM using...
Nadav Rotem [Mon, 29 Oct 2012 05:28:35 +0000 (05:28 +0000)]
Calling TLI->getNumRegisters creates a circular dependency when building LLVM using cmake.

Get the number of registers by calling getTypeLegalizationCost.

PR14199.

llvm-svn: 166911

11 years agoRemove unused typedef.
Lang Hames [Mon, 29 Oct 2012 04:57:52 +0000 (04:57 +0000)]
Remove unused typedef.

llvm-svn: 166910

11 years agoAdd -alias and -ralias options to match what we have for functions and
Rafael Espindola [Mon, 29 Oct 2012 02:23:07 +0000 (02:23 +0000)]
Add -alias and -ralias options to match what we have for functions and
globals.

llvm-svn: 166909

11 years agollvm-extract changes linkages so that functions on both sides of the
Rafael Espindola [Mon, 29 Oct 2012 01:59:03 +0000 (01:59 +0000)]
llvm-extract changes linkages so that functions on both sides of the
split module can see each other. If it is keeping a symbol that already has
a non local linkage, it doesn't need to change it.

llvm-svn: 166908

11 years agollvm-extract was unable to handle aliases. It would leave a copy on the
Rafael Espindola [Mon, 29 Oct 2012 00:27:55 +0000 (00:27 +0000)]
llvm-extract was unable to handle aliases. It would leave a copy on the
output of both

llvm-extract foo.ll -func=bar
and
llvm-extract foo.ll -func=bar -delete

so the two new files could not be linked together anymore. With this change
alias are handled almost like functions and global variables. Almost because
with alias we cannot just clear the initializer/body, we have to create a new
declaration and replace the alias with it.

The net result is that now the output of the above commands can be linked
even if foo.ll has aliases.

llvm-svn: 166907

11 years agoImplement brind operator for mips16.
Reed Kotler [Sun, 28 Oct 2012 23:08:07 +0000 (23:08 +0000)]
Implement brind operator for mips16.

llvm-svn: 166903

11 years agoRemove TargetELFWriterInfo.
Rafael Espindola [Sun, 28 Oct 2012 21:34:43 +0000 (21:34 +0000)]
Remove TargetELFWriterInfo.
All the credit goes to Jan Voung for noticing it was dead!

llvm-svn: 166902

11 years agoimprove highlighting of invalid string encodings
Seth Cantrell [Sun, 28 Oct 2012 18:24:46 +0000 (18:24 +0000)]
improve highlighting of invalid string encodings

limit highlight to exactly the bad encoding, and highlight every
bad encoding in a string.

llvm-svn: 166900

11 years agoRevert functional part of r166896 and just suppress -Wunneeded-internal-declaration...
Richard Smith [Sun, 28 Oct 2012 07:39:29 +0000 (07:39 +0000)]
Revert functional part of r166896 and just suppress -Wunneeded-internal-declaration for reference types for now. This needs more work; the cases we currently miss are a bit random.

llvm-svn: 166899

11 years agoWhen determining whether to try evaluating the initializer of a variable, check
Richard Smith [Sun, 28 Oct 2012 06:18:02 +0000 (06:18 +0000)]
When determining whether to try evaluating the initializer of a variable, check
whether the initializer is value-dependent rather than whether we are in a
dependent context. This allows us to detect some errors sooner, and fixes a
crash-on-invalid if a dependent type leaks out to a non-dependent context in
error recovery.

llvm-svn: 166898

11 years agoThis patch is for the implementation of mips16 complex pattern addr16.
Reed Kotler [Sun, 28 Oct 2012 06:02:37 +0000 (06:02 +0000)]
This patch is for the implementation of mips16 complex pattern addr16.
Previously mips16 was sharing the pattern addr which is used for mips32
and mips64. This had a number of problems:
1) Storing and loading byte and halfword quantities for mips16 has particular
problems due to the primarily non mips16 nature of SP. When we must
load/store byte/halfword stack objects in a function, we must create a mips16
alias register for SP. This functionality is tested in stchar.ll.
2) We need to have an FP register under certain conditions (such as
dynamically sized alloca). We use mips16 register S0 for this purpose.
In this case, we also use this register when accessing frame objects so this
issue also affects the complex pattern addr16. This functionality is
tested in alloca16.ll.

The Mips16InstrInfo.td has been updated to use addr16 instead of addr.

The complex pattern C++ function for addr has been copied to addr16 and
updated to reflect the above issues.

llvm-svn: 166897

11 years agoIn -Wunneeded-internal-declaration, suppress the warning for variables which
Richard Smith [Sun, 28 Oct 2012 04:47:21 +0000 (04:47 +0000)]
In -Wunneeded-internal-declaration, suppress the warning for variables which
might have been used in constant expressions, rather than suppressing it for
variables which are const. The important thing here is that such variables
can have their values used without actually being marked as 'used'.

llvm-svn: 166896

11 years agoFix invalid jump scopes again. This time without trying to find out if an
Rafael Espindola [Sun, 28 Oct 2012 02:44:03 +0000 (02:44 +0000)]
Fix invalid jump scopes again. This time without trying to find out if an
incomplete type has a destructor or not.

llvm-svn: 166895

11 years agoAdd a testcase from the previous bootstrap problem.
Rafael Espindola [Sun, 28 Oct 2012 02:25:27 +0000 (02:25 +0000)]
Add a testcase from the previous bootstrap problem.

llvm-svn: 166894

11 years agoFix crash on missing namespace name in namespace alias definition -- PR14085.
Nico Weber [Sat, 27 Oct 2012 23:44:27 +0000 (23:44 +0000)]
Fix crash on missing namespace name in namespace alias definition -- PR14085.

Patch from Brian Brooks <brooks.brian@gmail.com>!

llvm-svn: 166893

11 years agoobjective-C arc/mrr: Patch for the new block variable layout meta-data.
Fariborz Jahanian [Sat, 27 Oct 2012 21:10:38 +0000 (21:10 +0000)]
objective-C arc/mrr: Patch for the new block variable layout meta-data.
It is currently off (so no tests). This is wip.

llvm-svn: 166892

11 years agoCurrently the initial value of Tok is dependent an the stack contents
Chris Lattner [Sat, 27 Oct 2012 19:49:20 +0000 (19:49 +0000)]
Currently the initial value of Tok is dependent an the stack contents
and could cause the Parser to crash on the first ConsumeToken().

Patcy by Bas van den Berg!

llvm-svn: 166891

11 years agoNever attempt to join an early-clobber def with a regular kill.
Jakob Stoklund Olesen [Sat, 27 Oct 2012 17:41:27 +0000 (17:41 +0000)]
Never attempt to join an early-clobber def with a regular kill.

This fixes PR14194.

llvm-svn: 166880

11 years agoRevert 166876 while I debug a bootstrap problem.
Rafael Espindola [Sat, 27 Oct 2012 16:49:47 +0000 (16:49 +0000)]
Revert 166876 while I debug a bootstrap problem.

llvm-svn: 166878

11 years agoLoopIdiom: Add checks to avoid turning memmove into an infinite loop.
Benjamin Kramer [Sat, 27 Oct 2012 15:18:28 +0000 (15:18 +0000)]
LoopIdiom: Add checks to avoid turning memmove into an infinite loop.

I don't think this is possible with the current implementation but that may change eventually.

llvm-svn: 166877

11 years agoReapply 166855 with an early exit on null QualTypes.
Rafael Espindola [Sat, 27 Oct 2012 14:56:08 +0000 (14:56 +0000)]
Reapply 166855 with an early exit on null QualTypes.

llvm-svn: 166876

11 years agoLoopIdiom: Recognize memmove loops.
Benjamin Kramer [Sat, 27 Oct 2012 14:25:51 +0000 (14:25 +0000)]
LoopIdiom: Recognize memmove loops.

This turns loops like
  for (unsigned i = 0; i != n; ++i)
    p[i] = p[i+1];
into memmove, which has a highly optimized implementation in most libcs.

This was really easy with the new DependenceAnalysis :)

llvm-svn: 166875

11 years agoLoopIdiom: Replace custom dependence analysis with DependenceAnalysis.
Benjamin Kramer [Sat, 27 Oct 2012 14:25:44 +0000 (14:25 +0000)]
LoopIdiom: Replace custom dependence analysis with DependenceAnalysis.

Requires a lot less code and complexity on loop-idiom's side and the more
precise analysis can catch more cases, like the one I included as a test case.
This also fixes the edge-case miscompilation from PR9481.

Compile time performance seems to be slightly worse, but this is mostly due
to an extra LCSSA run scheduled by the PassManager and should be fixed there.

llvm-svn: 166874

11 years agoSCEV validator: Ignore CouldNotCompute/undef on both sides. This is mostly noise...
Benjamin Kramer [Sat, 27 Oct 2012 11:36:07 +0000 (11:36 +0000)]
SCEV validator: Ignore CouldNotCompute/undef on both sides. This is mostly noise and blocks finding more severe bugs.

llvm-svn: 166873

11 years agoSCEV validator: Add workarounds for some common false positives due to the way it...
Benjamin Kramer [Sat, 27 Oct 2012 10:45:01 +0000 (10:45 +0000)]
SCEV validator: Add workarounds for some common false positives due to the way it handles strings.

llvm-svn: 166872

11 years agoReverted back the changes made in 166868 and in 166869
Mahesha S [Sat, 27 Oct 2012 10:44:42 +0000 (10:44 +0000)]
Reverted back the changes made in 166868 and in 166869

llvm-svn: 166871

11 years agoClarify that there is an option other than OAuth for Phabricator and
Chandler Carruth [Sat, 27 Oct 2012 09:47:33 +0000 (09:47 +0000)]
Clarify that there is an option other than OAuth for Phabricator and
offer up my email to the spam lords for it. Hopefully this will
eventually be more automatic, but we don't want people to think there is
only one option.

llvm-svn: 166870

11 years agoFeature:
Mahesha S [Sat, 27 Oct 2012 09:05:45 +0000 (09:05 +0000)]
Feature:
  OpenMP support.

Sub-Feature:
  Support for "#pragma omp ..." registration with
  Preprocessor.

Files Changed/Added:
  * include/clang/Basic/DiagnosticGroups.td (C)
  * include/clang/Basic/DiagnosticParseKinds.td (C)
  * include/clang/Basic/TokenKinds.def (C)
  * include/clang/Parse/Parser.h (C)
  * lib/Parse/Parser.cpp (C)

Test Cases Changed/Added:
  * test/Preprocessor/pragma_omp.c (A)
  * test/Preprocessor/pragma_omp_ignored_warning.c (A)

llvm-svn: 166869

11 years ago-------------------------------------------------
Mahesha S [Sat, 27 Oct 2012 07:47:56 +0000 (07:47 +0000)]
-------------------------------------------------
Feature:
  OpenMP support in CLANG:

Sub-Feature:
  Support for option -fopenmp

Files Changed/Added:
  * include/clang/Driver/Options.td (C)
  * include/clang/Basic/LangOptions.def (C)
  * lib/Driver/Tools.cpp (C)
  * lib/Frontend/CompilerInvocation.cpp (C)

Test Cases Changed/Added:
  * test/Driver/clang_fopenmp_opt.c (A)
-------------------------------------------------

llvm-svn: 166868

11 years agoRemoved an extra blank line.
Mahesha S [Sat, 27 Oct 2012 07:23:58 +0000 (07:23 +0000)]
Removed an extra blank line.

llvm-svn: 166867

11 years agoAdd a reduced testcase of the last bootstrap failure.
Rafael Espindola [Sat, 27 Oct 2012 04:54:49 +0000 (04:54 +0000)]
Add a reduced testcase of the last bootstrap failure.

llvm-svn: 166866

11 years agoUpdate BBVectorize to use the new VTTI instr. cost interfaces.
Hal Finkel [Sat, 27 Oct 2012 04:33:48 +0000 (04:33 +0000)]
Update BBVectorize to use the new VTTI instr. cost interfaces.

The monolithic interface for instruction costs has been split into
several functions. This is the corresponding change. No functionality
change is intended.

llvm-svn: 166865

11 years ago1. Fix a bug in getTypeConversion. When a *simple* type is split, we need to return...
Nadav Rotem [Sat, 27 Oct 2012 04:11:32 +0000 (04:11 +0000)]
1. Fix a bug in getTypeConversion. When a *simple* type is split, we need to return the type of the split result.
2. Change the maximum vectorization width from 4 to 8.
3. A test for both.

llvm-svn: 166864

11 years agoRevert r166855. I can reproduce the bootstrap failure and have a testcase
Rafael Espindola [Sat, 27 Oct 2012 03:06:02 +0000 (03:06 +0000)]
Revert r166855. I can reproduce the bootstrap failure and have a testcase
to reduce.

llvm-svn: 166863

11 years agoThis is the first phase of supporting the DW_AT_object_pointer tag. I expanded the...
Jim Ingham [Sat, 27 Oct 2012 02:54:13 +0000 (02:54 +0000)]
This is the first phase of supporting the DW_AT_object_pointer tag.  I expanded the decl metadata
so it could hold this information, and then used it to look up unfound names in the object pointer
if it exists.  This gets "frame var" to work for unqualified references to ivars captured in blocks.
But the expression parser is ignoring this information still.

llvm-svn: 166860

11 years agoIf we got what looks like a single step exception but we weren't single stepping...
Jim Ingham [Sat, 27 Oct 2012 02:52:04 +0000 (02:52 +0000)]
If we got what looks like a single step exception but we weren't single stepping then just report
the raw exception.

llvm-svn: 166859

11 years agoAdd a test case for the stack overflow in rdar://12542261
Argyrios Kyrtzidis [Sat, 27 Oct 2012 02:13:28 +0000 (02:13 +0000)]
Add a test case for the stack overflow in rdar://12542261

llvm-svn: 166858

11 years agoMoving ValueObjectCast over to its own .h/.cpp files instead of sharing ValueObjectDy...
Enrico Granata [Sat, 27 Oct 2012 02:05:48 +0000 (02:05 +0000)]
Moving ValueObjectCast over to its own .h/.cpp files instead of sharing ValueObjectDynamic.h/.cpp
Removing the IsDynamic() and GetStaticValue() calls, so that they will default to the base class behavior:
 - non-dynamic
 - itself as the static value
This is in contrast with the previous behavior which could be confusing and could potentially cause issues when using those objects

llvm-svn: 166857

11 years agoFixes to the Objective-C V2 runtime:
Sean Callanan [Sat, 27 Oct 2012 01:51:44 +0000 (01:51 +0000)]
Fixes to the Objective-C V2 runtime:

- Only read the statically-defined isa table in the
  shared cache once.  Only the dynamically-constructed
  isa table can change.

- Ignore the statically-defined isa table if its
  version isn't what we expect.

llvm-svn: 166856

11 years agoFix cases where we were not producing an error when a computed goto could
Rafael Espindola [Sat, 27 Oct 2012 01:17:42 +0000 (01:17 +0000)]
Fix cases where we were not producing an error when a computed goto could
jump over destructor calls.
Fixes pr13812.

llvm-svn: 166855

11 years ago[code size][ARM] Emit regular call instructions instead of the move, branch sequence
Quentin Colombet [Sat, 27 Oct 2012 01:10:17 +0000 (01:10 +0000)]
[code size][ARM] Emit regular call instructions instead of the move, branch sequence

llvm-svn: 166854

11 years agoMove two helper functions to AST so that sema can use them.
Rafael Espindola [Sat, 27 Oct 2012 01:03:43 +0000 (01:03 +0000)]
Move two helper functions to AST so that sema can use them.

llvm-svn: 166853

11 years agoImplement MipsHi for mips16
Reed Kotler [Sat, 27 Oct 2012 00:57:14 +0000 (00:57 +0000)]
Implement MipsHi for mips16

llvm-svn: 166852

11 years ago[mips] Do not tail-call optimize vararg functions or functions with byval
Akira Hatanaka [Sat, 27 Oct 2012 00:56:56 +0000 (00:56 +0000)]
[mips] Do not tail-call optimize vararg functions or functions with byval
arguments.

This is rather conservative and should be fixed later to be more aggressive.

llvm-svn: 166851

11 years ago[mips] Make sure FuncArg doesn't advance when OrigArgIndex is the same as in the
Akira Hatanaka [Sat, 27 Oct 2012 00:44:39 +0000 (00:44 +0000)]
[mips] Make sure FuncArg doesn't advance when OrigArgIndex is the same as in the
previous iteration.

llvm-svn: 166850

11 years agoRefactor some code into a new findMaterializedTemporary function.
Rafael Espindola [Sat, 27 Oct 2012 00:43:14 +0000 (00:43 +0000)]
Refactor some code into a new findMaterializedTemporary function.

llvm-svn: 166849

11 years agoRefactor some code into a new skipRValueSubobjectAdjustments function.
Rafael Espindola [Sat, 27 Oct 2012 00:40:06 +0000 (00:40 +0000)]
Refactor some code into a new skipRValueSubobjectAdjustments function.

llvm-svn: 166848

11 years agoDelay codegen to after collecting all SubobjectAdjustment so that the collection
Rafael Espindola [Sat, 27 Oct 2012 00:36:38 +0000 (00:36 +0000)]
Delay codegen to after collecting all SubobjectAdjustment so that the collection
can be refactored and used in Sema.

llvm-svn: 166847

11 years agoUse the methods and classes that were added to simplify LowerCall and
Akira Hatanaka [Sat, 27 Oct 2012 00:29:43 +0000 (00:29 +0000)]
Use the methods and classes that were added to simplify LowerCall and
LowerFormalArguments in MipsTargetLowering.

No functionality change intended.

llvm-svn: 166846

11 years agoAdd method MipsTargetLowering::writeVarArgRegs which copies argument registers
Akira Hatanaka [Sat, 27 Oct 2012 00:21:13 +0000 (00:21 +0000)]
Add method MipsTargetLowering::writeVarArgRegs which copies argument registers
of vararg functions back to the stack.

llvm-svn: 166844

11 years agoAdd method MipsTargetLowering::passByValArg.
Akira Hatanaka [Sat, 27 Oct 2012 00:16:36 +0000 (00:16 +0000)]
Add method MipsTargetLowering::passByValArg.

This method emits nodes for passing byval arguments in registers and stack.
This has the same functionality as existing functions PassByValArg64 and
WriteByValArg which will be deleted later.

llvm-svn: 166843

11 years agoAdd method MipsTargetLowering::copyByValRegs.
Akira Hatanaka [Sat, 27 Oct 2012 00:10:18 +0000 (00:10 +0000)]
Add method MipsTargetLowering::copyByValRegs.

This method copies byval arguments passed in registers onto the stack and has
the same functionality as existing functions CopyMips64ByValRegs and
ReadByValArg which will be deleted later.

llvm-svn: 166841

11 years agoAdd class MipsCC which provides methods used to analyze formal and call
Akira Hatanaka [Fri, 26 Oct 2012 23:56:38 +0000 (23:56 +0000)]
Add class MipsCC which provides methods used to analyze formal and call
arguments and inquire about calling convention information.

llvm-svn: 166840

11 years agoShow both lldb-168 and earlier "bt -c 5" as well as lldb-169 and later "bt 5" usage.
Jason Molenda [Fri, 26 Oct 2012 23:56:03 +0000 (23:56 +0000)]
Show both lldb-168 and earlier "bt -c 5" as well as lldb-169 and later "bt 5" usage.

llvm-svn: 166839

11 years agoDocument "bt <n>" for "thread backtrace -c <n>", note that it is available
Jason Molenda [Fri, 26 Oct 2012 23:52:49 +0000 (23:52 +0000)]
Document "bt <n>" for "thread backtrace -c <n>", note that it is available
in lldb-169 and later.

llvm-svn: 166838

11 years agoDelete MipsFunctionInfo::InArgFIRange.
Akira Hatanaka [Fri, 26 Oct 2012 23:49:51 +0000 (23:49 +0000)]
Delete MipsFunctionInfo::InArgFIRange.

llvm-svn: 166837

11 years agoRefactor the VectorTargetTransformInfo interface.
Nadav Rotem [Fri, 26 Oct 2012 23:49:28 +0000 (23:49 +0000)]
Refactor the VectorTargetTransformInfo interface.

Add getCostXXX calls for different families of opcodes, such as casts, arithmetic, cmp, etc.

Port the LoopVectorizer to the new API.

The LoopVectorizer now finds instructions which will remain uniform after vectorization. It uses this information when calculating the cost of these instructions.

llvm-svn: 166836

11 years agoRevert r163298 "Optimize codegen for VSETLNi{8,16,32} operating on Q registers."
Jakob Stoklund Olesen [Fri, 26 Oct 2012 23:39:46 +0000 (23:39 +0000)]
Revert r163298 "Optimize codegen for VSETLNi{8,16,32} operating on Q registers."

Keep the integer_insertelement test case, the new coalescer can handle
this kind of lane insertion without help from pseudo-instructions.

llvm-svn: 166835

11 years agoAvoid an unused-variable warning when asserts are disabled.
Kaelyn Uhrain [Fri, 26 Oct 2012 23:28:41 +0000 (23:28 +0000)]
Avoid an unused-variable warning when asserts are disabled.

llvm-svn: 166834

11 years agoFix typo.
Eli Friedman [Fri, 26 Oct 2012 23:25:42 +0000 (23:25 +0000)]
Fix typo.

llvm-svn: 166833

11 years agoAdd missing safety check to an optimization for do-while loops. PR14191.
Eli Friedman [Fri, 26 Oct 2012 23:23:35 +0000 (23:23 +0000)]
Add missing safety check to an optimization for do-while loops.  PR14191.

llvm-svn: 166832

11 years agoFix indentation.
Eli Friedman [Fri, 26 Oct 2012 23:05:34 +0000 (23:05 +0000)]
Fix indentation.

llvm-svn: 166830

11 years agoReduce indentation with early exit.
Jakob Stoklund Olesen [Fri, 26 Oct 2012 23:05:13 +0000 (23:05 +0000)]
Reduce indentation with early exit.

No functional change.

llvm-svn: 166829

11 years agoAlso make the current basic block a class member.
Jakob Stoklund Olesen [Fri, 26 Oct 2012 23:05:10 +0000 (23:05 +0000)]
Also make the current basic block a class member.

Don't pass it around everywhere as a function argument.

llvm-svn: 166828

11 years agoimplement mips16 tls global addr
Reed Kotler [Fri, 26 Oct 2012 22:57:32 +0000 (22:57 +0000)]
implement mips16 tls global addr

llvm-svn: 166827

11 years agoIn Parser::ParseDecltypeSpecifier, make sure the end location it returns
Argyrios Kyrtzidis [Fri, 26 Oct 2012 22:53:44 +0000 (22:53 +0000)]
In Parser::ParseDecltypeSpecifier, make sure the end location it returns
is at the end of parsed tokens when an error occurs, otherwise we'll hit
an assertion when trying to annotate the decltype tokens.

llvm-svn: 166826

11 years agoDon't crash synthesizing an ObjC property with an empty struct type. <rdar://problem...
Eli Friedman [Fri, 26 Oct 2012 22:38:05 +0000 (22:38 +0000)]
Don't crash synthesizing an ObjC property with an empty struct type.  <rdar://problem/12547611>.

llvm-svn: 166825

11 years agoWhen an externally-supplied record layout has a size that clearly
Douglas Gregor [Fri, 26 Oct 2012 22:31:14 +0000 (22:31 +0000)]
When an externally-supplied record layout has a size that clearly
doesn't include padding up to the alignment of the record, take this
as a cue that the alignment of the record should (conservatively) be
set to 1. This is similar to other the other cues we use to determine
that the record has a lower alignment, e.g., that the
externally-supplied layout places fields at lower offsets than we
would. Fixes <rdar://problem/12582052>; test case in LLDB.

llvm-svn: 166824

11 years agoAdd comment for my patch in r166809.
Fariborz Jahanian [Fri, 26 Oct 2012 22:20:25 +0000 (22:20 +0000)]
Add comment for my patch in r166809.

llvm-svn: 166823

11 years agoMCRegisterClass should be returned by const ref, not by value.
Lang Hames [Fri, 26 Oct 2012 22:14:10 +0000 (22:14 +0000)]
MCRegisterClass should be returned by const ref, not by value.

llvm-svn: 166822

11 years agoSuggest llvm_unreachable over assert(0).
Jordan Rose [Fri, 26 Oct 2012 22:08:46 +0000 (22:08 +0000)]
Suggest llvm_unreachable over assert(0).

llvm-svn: 166821

11 years agoMake the Processed set a class member.
Jakob Stoklund Olesen [Fri, 26 Oct 2012 22:06:00 +0000 (22:06 +0000)]
Make the Processed set a class member.

Don't pass it everywhere as an argument.

llvm-svn: 166820

11 years ago[ms-inline asm] Add a comment.
Chad Rosier [Fri, 26 Oct 2012 22:01:25 +0000 (22:01 +0000)]
[ms-inline asm] Add a comment.

llvm-svn: 166819

11 years ago80 col.
Jakob Stoklund Olesen [Fri, 26 Oct 2012 21:46:57 +0000 (21:46 +0000)]
80 col.

llvm-svn: 166818

11 years agoRemove ARMBaseRegisterInfo::isReservedReg().
Jakob Stoklund Olesen [Fri, 26 Oct 2012 21:43:05 +0000 (21:43 +0000)]
Remove ARMBaseRegisterInfo::isReservedReg().

It is just as easy to use MRI::isReserved() now.

llvm-svn: 166817

11 years agoAdd GPRPair Register class to ARM.
Jakob Stoklund Olesen [Fri, 26 Oct 2012 21:29:15 +0000 (21:29 +0000)]
Add GPRPair Register class to ARM.

Some instructions in ARM require 2 even-odd paired GPRs. This
patch adds support for such register class.

Patch by Weiming Zhao!

llvm-svn: 166816

11 years agoFix whitespace and function names to be coding standardy.
Jakob Stoklund Olesen [Fri, 26 Oct 2012 21:12:49 +0000 (21:12 +0000)]
Fix whitespace and function names to be coding standardy.

No functional change.

llvm-svn: 166814

11 years agoRemove the canCombineSubRegIndices() target hook.
Jakob Stoklund Olesen [Fri, 26 Oct 2012 20:38:19 +0000 (20:38 +0000)]
Remove the canCombineSubRegIndices() target hook.

The new coalescer can already do all of this, so there is no need to
duplicate the efforts.

llvm-svn: 166813

11 years agoThis patch is a follow-up to r166805. As suggested on-list, a check was
Bill Schmidt [Fri, 26 Oct 2012 20:34:52 +0000 (20:34 +0000)]
This patch is a follow-up to r166805.  As suggested on-list, a check was
added to ensure no extra alignment code is added in the future.

llvm-svn: 166812

11 years agoRemove BLOCK_BYREF_LAYOUT_BYREF flags from list of
Fariborz Jahanian [Fri, 26 Oct 2012 20:33:59 +0000 (20:33 +0000)]
Remove BLOCK_BYREF_LAYOUT_BYREF flags from list of
flags for __block variable meta-data.

llvm-svn: 166811

11 years agoRemove LoopDependenceAnalysis.
Benjamin Kramer [Fri, 26 Oct 2012 20:25:01 +0000 (20:25 +0000)]
Remove LoopDependenceAnalysis.

It was unmaintained and not much more than a stub. The new DependenceAnalysis
pass is both more general and complete.

llvm-svn: 166810

11 years agoobjective-C IRGen: for @implementation nested in
Fariborz Jahanian [Fri, 26 Oct 2012 20:22:11 +0000 (20:22 +0000)]
objective-C IRGen: for @implementation nested in
extern "C", its method definitions must be IRGen'ed
before meta-data for class is generated. Otherwise,
IRGen crashes (to say the least).
// rdar://12581683

llvm-svn: 166809

11 years ago[driver] Before applying the working directory check if the input path
Argyrios Kyrtzidis [Fri, 26 Oct 2012 20:09:24 +0000 (20:09 +0000)]
[driver] Before applying the working directory check if the input path
is absolute.

llvm-svn: 166808

11 years agoThis patch addresses a 64-bit PowerPC ELF ABI compatibility issue with
Bill Schmidt [Fri, 26 Oct 2012 19:59:03 +0000 (19:59 +0000)]
This patch addresses a 64-bit PowerPC ELF ABI compatibility issue with
varargs parameter passing.

A strict reading of the ABI indicates that any argument with alignment greater
than 8 may require skipping doublewords in the parameter save area to align
the argument, and hence require skipping GPRs.  In practice, this is not done
by GCC.  The alignment restriction is used for internal alignment of a
structure, but a structure with 16-byte alignment, for example, is not
itself 16-byte aligned in the parameter save area.  Although this is messy,
it has become the de facto standard used in building existing libraries.

My initial varargs support followed the ABI language, but not the de facto
standard.  Running the GCC compatibility test suite exposed this issue, and
indeed showed that LLVM didn't pass parameters self-consistently with my
original logic.  Removing the additional alignment logic allows the affected
tests to now pass.

I modified the ppc64-varargs-struct.c test case to remove the existing test
for generation of alignment code, which is no longer appropriate.

Built and tested on powerpc64-unknown-linux-gnu with no new regressions.

llvm-svn: 166805

11 years agoRemove the unneeded initializers.
Bill Wendling [Fri, 26 Oct 2012 19:52:54 +0000 (19:52 +0000)]
Remove the unneeded initializers.

llvm-svn: 166804

11 years agoStop APInt::shl from generating llvm.trap
Derek Schuff [Fri, 26 Oct 2012 19:52:27 +0000 (19:52 +0000)]
Stop APInt::shl from generating llvm.trap

APInt::shl generated llvm.trap to guard against shifts greater than bit-width.
This was already checked with an assert, and there was a special case for
shifts equal to bit-width. Modify this check to catch shifts greater than or
equal to bit-width, so llvm.trap isn't generated.

Patch contributed by JF Bastien

llvm-svn: 166803