platform/upstream/llvm.git
10 years agoX86: Custom lower sext v16i8 to v16i16, and the corresponding truncate.
Benjamin Kramer [Wed, 23 Oct 2013 21:06:07 +0000 (21:06 +0000)]
X86: Custom lower sext v16i8 to v16i16, and the corresponding truncate.

Also update the cost model.

llvm-svn: 193270

10 years agoAST: Mangle fields in anonymous structs/unions
David Majnemer [Wed, 23 Oct 2013 20:52:43 +0000 (20:52 +0000)]
AST: Mangle fields in anonymous structs/unions

The Itanium mangler couldn't cope with mangling an IndirectFieldDecl.
Instead, mangle the field the IndirectFieldDecl refers to.

Further, give IndirectFieldDecl no linkage just like FieldDecl.

N.B. Decl.cpp:getLVForNamespaceScopeDecl tried to calculate linkage for
data members of anonymous structs/unions.  However, this seems
impossible so turn it into an assertion.

llvm-svn: 193269

10 years agoFixed comment typo in GCOVProfiling.cpp
Yuchen Wu [Wed, 23 Oct 2013 20:35:00 +0000 (20:35 +0000)]
Fixed comment typo in GCOVProfiling.cpp

llvm-svn: 193268

10 years agoIntrinsics: fix extract & insert when index is out of bound.
Manman Ren [Wed, 23 Oct 2013 20:33:14 +0000 (20:33 +0000)]
Intrinsics: fix extract & insert when index is out of bound.

Now, all extract & insert intrinsics should have the correct and operation
to ignore higher bits.

rdar://15250497

llvm-svn: 193267

10 years agoRemove unused variable.
Rui Ueyama [Wed, 23 Oct 2013 20:31:55 +0000 (20:31 +0000)]
Remove unused variable.

llvm-svn: 193266

10 years ago[analyzer] Generate a LazyCompoundVal when loading from a union-typed region.
Jordan Rose [Wed, 23 Oct 2013 20:08:55 +0000 (20:08 +0000)]
[analyzer] Generate a LazyCompoundVal when loading from a union-typed region.

This ensures that variables accessible through a union are invalidated when
the union value is passed to a function. We still don't fully handle union
values, but this should at least quiet some false positives.

PR16596

llvm-svn: 193265

10 years agoUse a map instead of vector to store line counts.
Yuchen Wu [Wed, 23 Oct 2013 19:45:03 +0000 (19:45 +0000)]
Use a map instead of vector to store line counts.

There are a few motivations for this:
- Using a map allows for checking if line is in map. This differentiates
  unexecutable lines (such as comments) from unexecuted logical lines of
  code. "#####" is now outputted in this case, in line with gcov.
- Source files are no longer read in twice: once when storing the line
  counts, and once when outputting the data.
- Greatly simplifies the function FileInfo::addLineCount().

llvm-svn: 193264

10 years agoCalling _chkstk is required on ELF as well as COFF on Windows.
Yaron Keren [Wed, 23 Oct 2013 19:40:07 +0000 (19:40 +0000)]
Calling _chkstk is required on ELF as well as COFF on Windows.
Without _chkstk functions requiring large stack crash in
initialization code. Previous code tested for COFF format but
not Mach-O and this patch modifies the code to test for Windows.

Credits to Andrew MacPherson.

llvm-svn: 193263

10 years agoX86: Custom lower zext v16i8 to v16i16.
Benjamin Kramer [Wed, 23 Oct 2013 19:19:04 +0000 (19:19 +0000)]
X86: Custom lower zext v16i8 to v16i16.

On sandy bridge (PR17654) we now get
vpxor %xmm1, %xmm1, %xmm1
vpunpckhbw %xmm1, %xmm0, %xmm2
vpunpcklbw %xmm1, %xmm0, %xmm0
vinsertf128 $1, %xmm2, %ymm0, %ymm0

On haswell it's a simple
vpmovzxbw %xmm0, %ymm0

There is a maze of duplicated and dead transforms and patterns in this
area. Remove the dead custom lowering of zext v8i16 to v8i32, that's
already handled by LowerAVXExtend.

llvm-svn: 193262

10 years agoFix PR17631
Michael Liao [Wed, 23 Oct 2013 18:32:43 +0000 (18:32 +0000)]
Fix PR17631

- Skip instructions added in prolog. For specific targets, prolog may
  insert helper function calls (e.g. _chkstk will be called when
  there're more than 4K bytes allocated on stack). However, these
  helpers don't use/def YMM/XMM registers.

llvm-svn: 193261

10 years agoFixed format strings as they still must specicy a '%' prior to using PRI*64 macros.
Greg Clayton [Wed, 23 Oct 2013 18:24:30 +0000 (18:24 +0000)]
Fixed format strings as they still must specicy a '%' prior to using PRI*64 macros.

llvm-svn: 193260

10 years agoDisable layout-transitivity test on FreeBSD for now.
Rui Ueyama [Wed, 23 Oct 2013 18:22:26 +0000 (18:22 +0000)]
Disable layout-transitivity test on FreeBSD for now.

llvm-svn: 193259

10 years agoAdd llvm-c-test to check-llvm.
NAKAMURA Takumi [Wed, 23 Oct 2013 17:57:04 +0000 (17:57 +0000)]
Add llvm-c-test to check-llvm.

llvm-svn: 193258

10 years agollvm/tools/llvm-c-test should be built also on msvc.
NAKAMURA Takumi [Wed, 23 Oct 2013 17:56:59 +0000 (17:56 +0000)]
llvm/tools/llvm-c-test should be built also on msvc.

llvm-svn: 193257

10 years agollvm-c/Target.h: Tweak "inline" for msvc to use __inline instead.
NAKAMURA Takumi [Wed, 23 Oct 2013 17:56:52 +0000 (17:56 +0000)]
llvm-c/Target.h: Tweak "inline" for msvc to use __inline instead.

FIXME: I don't think it'd be smart.
llvm-svn: 193256

10 years agollvm-c/lto.h: Avoid use of bool.
NAKAMURA Takumi [Wed, 23 Oct 2013 17:56:46 +0000 (17:56 +0000)]
llvm-c/lto.h: Avoid use of bool.

llvm-svn: 193255

10 years agollvm-c-test: Make them C89-compliant.
NAKAMURA Takumi [Wed, 23 Oct 2013 17:56:37 +0000 (17:56 +0000)]
llvm-c-test: Make them C89-compliant.

llvm-svn: 193254

10 years agoinclude/llvm-c: Whitespace.
NAKAMURA Takumi [Wed, 23 Oct 2013 17:56:29 +0000 (17:56 +0000)]
include/llvm-c: Whitespace.

llvm-svn: 193253

10 years agoX86: Make concat_vectors combine a bit more conservative.
Jim Grosbach [Wed, 23 Oct 2013 17:37:40 +0000 (17:37 +0000)]
X86: Make concat_vectors combine a bit more conservative.

Per Nadav's review comments for r192866.

llvm-svn: 193252

10 years agoUse address-taken to disambiguate global variable and indirect memops.
Shuxin Yang [Wed, 23 Oct 2013 17:28:19 +0000 (17:28 +0000)]
Use address-taken to disambiguate global variable and indirect memops.

 Major steps include:
 1). introduces a not-addr-taken bit-field in GlobalVariable
 2). GlobalOpt pass sets "not-address-taken" if it proves a global varirable
    dosen't have its address taken.
 3). AA use this info for disambiguation.

llvm-svn: 193251

10 years ago64-Bit DWARF support for .debug_aranges and .debug_pubnames
Ed Maste [Wed, 23 Oct 2013 17:24:15 +0000 (17:24 +0000)]
64-Bit DWARF support for .debug_aranges and .debug_pubnames

llvm-svn: 193250

10 years agoMark zero-argument functions explicitly in C headers.
Benjamin Kramer [Wed, 23 Oct 2013 16:57:34 +0000 (16:57 +0000)]
Mark zero-argument functions explicitly in C headers.

Pacifies GCC's -Wstrict-prototypes.

llvm-svn: 193249

10 years agoA decl never becomes unused. Make that explicit in the API.
Rafael Espindola [Wed, 23 Oct 2013 16:46:34 +0000 (16:46 +0000)]
A decl never becomes unused. Make that explicit in the API.

llvm-svn: 193248

10 years agoSupport for microMIPS relocations 1.
Zoran Jovanovic [Wed, 23 Oct 2013 16:14:44 +0000 (16:14 +0000)]
Support for microMIPS relocations 1.

llvm-svn: 193247

10 years agoRefactor out the circular reference to LambdaExpr in CXXRecordDecl.
Faisal Vali [Wed, 23 Oct 2013 16:10:50 +0000 (16:10 +0000)]
Refactor out the circular reference to LambdaExpr in CXXRecordDecl.

A prior commit of this patch was reverted because it was within the blamelist's purview of a failing test.  The failure of that test has been addressed here: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091546.html.  Therefore I am recommitting this patch (all tests pass on windows, except for the usual modules & index suspects that never pass on my box).

Some background: Both Doug and Richard had asked me in Chicago to remove the circular reference in CXXRecordDecl to LambdaExpr by factoring out and storing the needed information from LambdaExpr directly into CXXRecordDecl.

In addition, I have added an IsGenericLambda flag - this makes life a little easier when we implement capturing, and are Sema-analyzing the body of a lambda (and the calloperator hasn't been wired to the closure class yet). Any inner lambdas can have potential captures that could require walking up the scope chain and checking if any generic lambdas are capture-ready. This 'bit' makes some of that checking easier.

No change in functionality.

This patch was approved by Doug with minor modifications (comments were cleaned up, and all data members were converted from bool/enum to unsigned, as requested):
http://llvm-reviews.chandlerc.com/D1856

Thanks!

llvm-svn: 193246

10 years ago[ASan] ASan can be combined with LSan and UBSan, so export symbol from them as well.
Alexey Samsonov [Wed, 23 Oct 2013 15:36:22 +0000 (15:36 +0000)]
[ASan] ASan can be combined with LSan and UBSan, so export symbol from them as well.

llvm-svn: 193245

10 years ago[sanitizer] Fix OSX build.
Evgeniy Stepanov [Wed, 23 Oct 2013 15:21:10 +0000 (15:21 +0000)]
[sanitizer] Fix OSX build.

llvm-svn: 193244

10 years agoFix cmake dependency on llvm-c-test in test
Anders Waldenborg [Wed, 23 Oct 2013 15:01:23 +0000 (15:01 +0000)]
Fix cmake dependency on llvm-c-test in test

llvm-svn: 193243

10 years agoInitial DWARF64 support for .debug_line
Ed Maste [Wed, 23 Oct 2013 14:18:41 +0000 (14:18 +0000)]
Initial DWARF64 support for .debug_line

Some versions of the GNU MIPS toolchain generate 64-Bit DWARF (even though
it isn't really necessary).  This change adds support for the 64-Bit DWARF
format, but is not actually tested with >4GB of debug data.

Similar changes are in progress for llvm's version of DWARFDebugLine, in
review D1988.

llvm-svn: 193242

10 years ago[sanitizer] Intercept ether_* functions.
Evgeniy Stepanov [Wed, 23 Oct 2013 13:57:47 +0000 (13:57 +0000)]
[sanitizer] Intercept ether_* functions.

llvm-svn: 193241

10 years ago[mips][msa] Direct Object Emission support for the LSA instruction.
Matheus Almeida [Wed, 23 Oct 2013 13:20:07 +0000 (13:20 +0000)]
[mips][msa] Direct Object Emission support for the LSA instruction.

llvm-svn: 193240

10 years ago[mips][msa] Added support for matching fexp2 from normal IR (i.e. not intrinsics)
Daniel Sanders [Wed, 23 Oct 2013 10:36:52 +0000 (10:36 +0000)]
[mips][msa] Added support for matching fexp2 from normal IR (i.e. not intrinsics)

llvm-svn: 193239

10 years agoMake ARM hint ranges consistent, and add tests for these ranges
Artyom Skrobov [Wed, 23 Oct 2013 10:14:40 +0000 (10:14 +0000)]
Make ARM hint ranges consistent, and add tests for these ranges

llvm-svn: 193238

10 years ago[mips][msa] Add intrinsics that map to pseudo-instructions.
Daniel Sanders [Wed, 23 Oct 2013 10:12:44 +0000 (10:12 +0000)]
[mips][msa] Add intrinsics that map to pseudo-instructions.

Unlike the previously added intrinsics, these do not map to a single instruction
on MIPS32. They are provided for regularity (to round out the .[bhw] variants
of the same operation) and compatibility with GCC.

Includes:
  copy_[us].d, fill.d, insert.d, insve.d

llvm-svn: 193237

10 years agotsan: parse symbolize/external_symbolizer_path common flags
Dmitry Vyukov [Wed, 23 Oct 2013 09:00:49 +0000 (09:00 +0000)]
tsan: parse symbolize/external_symbolizer_path common flags

llvm-svn: 193236

10 years agoFix check for supported targets in llvm-c lit.local.cfg
Anders Waldenborg [Wed, 23 Oct 2013 08:47:52 +0000 (08:47 +0000)]
Fix check for supported targets in llvm-c lit.local.cfg

llvm-svn: 193235

10 years agotsan: fix linux syscall hooks
Dmitry Vyukov [Wed, 23 Oct 2013 08:40:19 +0000 (08:40 +0000)]
tsan: fix linux syscall hooks
the file references non-existent arguments and breaks build

llvm-svn: 193234

10 years agoAdd llvm-c-test tool for testing llvm-c
Anders Waldenborg [Wed, 23 Oct 2013 08:10:20 +0000 (08:10 +0000)]
Add llvm-c-test tool for testing llvm-c

This provides rudimentary testing of the llvm-c api.

The following commands are implemented:

  * --module-dump
    Read bytecode from stdin - print ir

  * --module-list-functions
    Read bytecode from stdin - list summary of functions

  * --module-list-globals
    Read bytecode from stdin - list summary of globals

  * --targets-list
    List available targets

  * --object-list-sections
    Read object file from stdin - list sections

  * --object-list-symbols
    Read object file from stdin - list symbols (like nm)

  * --disassemble
    Read lines of triple, hex ascii machine code from stdin - print disassembly

  * --calc
    Read lines of name, rpn from stdin - print generated module ir

Differential-Revision: http://llvm-reviews.chandlerc.com/D1776
llvm-svn: 193233

10 years agoContinue to keep 'SUMMARY: ' prefix in lsan. Whoops!
Nick Lewycky [Wed, 23 Oct 2013 07:58:11 +0000 (07:58 +0000)]
Continue to keep 'SUMMARY: ' prefix in lsan. Whoops!

llvm-svn: 193232

10 years agoHoist the addition of the prefix "SUMMARY: " from
Nick Lewycky [Wed, 23 Oct 2013 07:45:53 +0000 (07:45 +0000)]
Hoist the addition of the prefix "SUMMARY: " from
__sanitizer_report_error_summary to ReportErrorSummary.

llvm-svn: 193231

10 years agoAnd Again: Teach TreeTransform how to transform nested generic lambdas.
Faisal Vali [Wed, 23 Oct 2013 06:44:28 +0000 (06:44 +0000)]
And Again: Teach TreeTransform how to transform nested generic lambdas.

A previous attempt http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130930/090049.html resulted in PR 17476, and was reverted,

The original TransformLambdaExpr (pre generic-lambdas) transformed the TypeSourceInfo of the Call operator in its own instantiation scope via TransformType.  This resulted in the parameters of the call operator being mapped to their transformed counterparts in an instantiation scope that would get popped off.
Then a call to TransformFunctionParameters would add the parameters and their transformed mappings (but newly created ones!) to the current instantiation scope. This would result in a disconnect between the new call operator's TSI parameters and those used to construct the call operator declaration. This was ok in the non-generic lambda world - but would cause issues with nested transformations (when non-generic and generics were interleaved) in the generic lambda world - that I somewhat kludged around initially - but this resulted in PR17476.

The new approach seems cleaner. We only do the transformation of the TypeSourceInfo - but we make sure to do it in the current instantiation scope so we don't lose the untransformed to transformed mappings of the ParmVarDecls when they get created.

Another attempt caused a test to fail (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091533.html) and also had to be reverted - my apologies - in my haste, i did not run all the tests - argh!

Now all the tests seem to pass - but a Fixme has been added - since I suspect Richard will find the fix a little inelegant ;) I shall try and work on a more elegant fix once I have had a chance to discuss with Richard or Doug at a later date.

Hopefully the third time;s a charm *fingers crossed*

This does not yet include capturing.

Please see test file for examples.

This patch was LGTM'd by Doug:
http://llvm-reviews.chandlerc.com/D1784

llvm-svn: 193230

10 years agoMake sure ASan always emits an error summary if it reports an error.
Nick Lewycky [Wed, 23 Oct 2013 06:19:04 +0000 (06:19 +0000)]
Make sure ASan always emits an error summary if it reports an error.

llvm-svn: 193229

10 years agoUpdate status of issues
Marshall Clow [Wed, 23 Oct 2013 05:59:18 +0000 (05:59 +0000)]
Update status of issues

llvm-svn: 193228

10 years agoMark seed_seq default constructor and size() as noexcept. This is implied, but not...
Marshall Clow [Wed, 23 Oct 2013 05:56:47 +0000 (05:56 +0000)]
Mark seed_seq default constructor and size() as noexcept. This is implied, but not required by LWG issue 2180

llvm-svn: 193227

10 years agoRevert r193223 and r193216.
Rafael Espindola [Wed, 23 Oct 2013 04:12:23 +0000 (04:12 +0000)]
Revert r193223 and r193216.

They were causing CodeGenCXX/mangle-exprs.cpp to fail.

Revert "Remove the circular reference to LambdaExpr in CXXRecordDecl."

Revert "Again: Teach TreeTransform and family how to transform generic lambdas nested within templates and themselves."

llvm-svn: 193226

10 years agoR600/SI: Replace ffs(x) - 1 with countTrailingZeros(x)
Tom Stellard [Wed, 23 Oct 2013 03:50:25 +0000 (03:50 +0000)]
R600/SI: Replace ffs(x) - 1 with countTrailingZeros(x)

ffs(x) broke the mingw buildbot.

llvm-svn: 193225

10 years agoTest commit. Added whitespace in GCOV.cpp.
Yuchen Wu [Wed, 23 Oct 2013 03:41:03 +0000 (03:41 +0000)]
Test commit. Added whitespace in GCOV.cpp.

llvm-svn: 193224

10 years agoRemove the circular reference to LambdaExpr in CXXRecordDecl.
Faisal Vali [Wed, 23 Oct 2013 02:59:27 +0000 (02:59 +0000)]
Remove the circular reference to LambdaExpr in CXXRecordDecl.

Both Doug and Richard had asked me to remove the circular reference in CXXRecordDecl to LambdaExpr by factoring out and storing the needed information from LambdaExpr directly into CXXRecordDecl.

No change in functionality.

In addition, I have added an IsGenericLambda flag - this makes life a little easier when we implement capturing, and are Sema-analyzing the body of a lambda (and the calloperator hasn't been wired to the closure class yet). Any inner lambdas can have potential captures that could require walking up the scope chain and checking if any generic lambdas are capture-ready. This 'bit' makes some of that checking easier.

This patch was approved by Doug with minor modifications (comments were cleaned up, and all data members were converted from bool/enum to unsigned, as requested):
http://llvm-reviews.chandlerc.com/D1856

Thanks!

llvm-svn: 193223

10 years agoR600/SI: fix MIMG writemask adjustement
Tom Stellard [Wed, 23 Oct 2013 02:53:47 +0000 (02:53 +0000)]
R600/SI: fix MIMG writemask adjustement

This fixes piglit:
- shaders/glsl-fs-texture2d-masked
- shaders/glsl-fs-texture2d-masked-4

Patch by: Marek Olšák

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 193222

10 years agoClean-up dependency files
Tom Stellard [Wed, 23 Oct 2013 02:49:33 +0000 (02:49 +0000)]
Clean-up dependency files

Patch by: Jeroen Ketema

llvm-svn: 193221

10 years agoMake C++ compiler configurable
Tom Stellard [Wed, 23 Oct 2013 02:49:27 +0000 (02:49 +0000)]
Make C++ compiler configurable

The C++ compiler used to build prepare-builtins
may differ from the llvm/clang for which we are
building libclc.

Use 'clang++' as the default compiler.

Patch by: Jeroen Ketema

llvm-svn: 193220

10 years agoMake UsingShadowDecls redeclarable. This fixes some visibility problems with
Richard Smith [Wed, 23 Oct 2013 02:17:46 +0000 (02:17 +0000)]
Make UsingShadowDecls redeclarable. This fixes some visibility problems with
modules.

With this fixed, I no longer see any test regressions in the libc++ test suite
when enabling a single-module module.map for libc++ (other than issues with my
system headers).

llvm-svn: 193219

10 years agoOne should actually not do one-line printing of nested aggregates even if they are...
Enrico Granata [Wed, 23 Oct 2013 01:34:31 +0000 (01:34 +0000)]
One should actually not do one-line printing of nested aggregates even if they are not the base class
This check was overly strict. Relax it.
While one could conceivably want nested one-lining:
(Foo) aFoo = (x = 1, y = (t = 3, q = â€œHello), z = 3.14)
the spirit of this feature is mostly to make *SMALL LINEAR* structs come out more compact.
Aggregates with children and no summary for now just disable the one-lining. Define a one-liner summary to override :)

llvm-svn: 193218

10 years agoLUI: Fix some issues causing crashes in the source view
Wei Pan [Wed, 23 Oct 2013 01:18:21 +0000 (01:18 +0000)]
LUI: Fix some issues causing crashes in the source view

llvm-svn: 193217

10 years agoAgain: Teach TreeTransform and family how to transform generic
Faisal Vali [Wed, 23 Oct 2013 00:51:58 +0000 (00:51 +0000)]
Again: Teach TreeTransform and family how to transform generic
lambdas nested within templates and themselves.

A previous attempt http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130930/090049.html resulted in PR 17476, and was reverted,

The original TransformLambdaExpr (pre generic-lambdas) transformed the TypeSourceInfo of the Call operator in its own instantiation scope via TransformType.  This resulted in the parameters of the call operator being mapped to their transformed counterparts in an instantiation scope that would get popped off.
Then a call to TransformFunctionParameters would add the parameters and their transformed mappings (but newly created ones!) to the current instantiation scope. This would result in a disconnect between the new call operator's TSI parameters and those used to construct the call operator declaration. This was ok in the non-generic lambda world - but would cause issues with nested transformations (when non-generic and generics were interleaved) in the generic lambda world - that I somewhat kludged around initially - but this resulted in PR17476.

The new approach seems cleaner. We only do the transformation of the TypeSourceInfo - but we make sure to do it in the current instantiation scope so we don't lose the untransformed to transformed mappings of the ParmVarDecls when they get created.

This does not yet include capturing.

Please see test file for examples.

This patch was LGTM'd by Doug:
http://llvm-reviews.chandlerc.com/D1784

llvm-svn: 193216

10 years agoR600: Fix handling of vector kernel arguments
Tom Stellard [Wed, 23 Oct 2013 00:44:32 +0000 (00:44 +0000)]
R600: Fix handling of vector kernel arguments

The SelectionDAGBuilder was promoting vector kernel arguments to legal
types, but this won't work for R600 and SI since kernel arguments are
stored in memory and can't be promoted.  In order to handle vector
arguments correctly we need to look at the original types from the LLVM IR
function.

llvm-svn: 193215

10 years agoSelectionDAG: Pass along the original argument/element type in ISD::InputArg
Tom Stellard [Wed, 23 Oct 2013 00:44:24 +0000 (00:44 +0000)]
SelectionDAG: Pass along the original argument/element type in ISD::InputArg

For some targets, it is useful to be able to look at the original
type of an argument without having to dig through the original IR.

This also fixes a bug in SelectionDAGBuilder where InputArg.PartOffset
was not taking into account the offset of structure elements.

Patch by: Justin Holewinski

Tom Stellard:
  - Changed the type of ArgVT to EVT, so it can store non-simple types
    like v3i32.

llvm-svn: 193214

10 years agoR600/SI: Add support for i64 bitwise or
Tom Stellard [Wed, 23 Oct 2013 00:44:19 +0000 (00:44 +0000)]
R600/SI: Add support for i64 bitwise or

llvm-svn: 193213

10 years agoR600/SI: Use S_LOAD_DWORD instructions for v8i32 and v16i32
Tom Stellard [Wed, 23 Oct 2013 00:44:12 +0000 (00:44 +0000)]
R600/SI: Use S_LOAD_DWORD instructions for v8i32 and v16i32

llvm-svn: 193212

10 years ago[PECOFF] Resource file extension is .res, not .rc.
Rui Ueyama [Tue, 22 Oct 2013 23:58:38 +0000 (23:58 +0000)]
[PECOFF] Resource file extension is .res, not .rc.

This patch won't change LLD's behavior because it's a temporary file and
LLD does not use the file extension to determine file type. But using the
correct file extension is a good thing.

llvm-svn: 193211

10 years agoTeach AST dumper to dump the containing module and hidden flag for declarations.
Richard Smith [Tue, 22 Oct 2013 23:50:38 +0000 (23:50 +0000)]
Teach AST dumper to dump the containing module and hidden flag for declarations.

llvm-svn: 193210

10 years agoMC: Support multiple sections with the same name in the same comdat group
David Blaikie [Tue, 22 Oct 2013 23:41:52 +0000 (23:41 +0000)]
MC: Support multiple sections with the same name in the same comdat group

Code review by Eric Christopher and Rafael Espindola.

llvm-svn: 193209

10 years agoCFG: Properly print delegating initializer CFG elements.
Jordan Rose [Tue, 22 Oct 2013 23:19:47 +0000 (23:19 +0000)]
CFG: Properly print delegating initializer CFG elements.

...rather than segfaulting.

Patch by Enrico P!

llvm-svn: 193208

10 years ago[PECOFF] Emit the side-by-side manifest file.
Rui Ueyama [Tue, 22 Oct 2013 22:58:07 +0000 (22:58 +0000)]
[PECOFF] Emit the side-by-side manifest file.

llvm-svn: 193207

10 years agoRetain previous language linkage of friend function declarations
Alp Toker [Tue, 22 Oct 2013 22:53:01 +0000 (22:53 +0000)]
Retain previous language linkage of friend function declarations

With this extension, friend function declarations will retain the language
linkage specified for previous declarations instead of emitting an error
diagnostic.

The feature is known to be compatible with GCC and MSVC and permits a
language to be specified indirectly where it cannot otherwise be written
directly in class scope.

Work is ongoing to improve linkage spec diagnostics.

Fixes PR17337.

Reviewed by Richard Smith.

llvm-svn: 193206

10 years agoSplit -fsanitize=bounds to -fsanitize=array-bounds (for the frontend-inserted
Richard Smith [Tue, 22 Oct 2013 22:51:04 +0000 (22:51 +0000)]
Split -fsanitize=bounds to -fsanitize=array-bounds (for the frontend-inserted
check using the ubsan runtime) and -fsanitize=local-bounds (for the middle-end
check which inserts traps).

Remove -fsanitize=local-bounds from -fsanitize=undefined. It does not produce
useful diagnostics and has false positives (PR17635), and is not a good
compromise position between UBSan's checks and ASan's checks.

Map -fbounds-checking to -fsanitize=local-bounds to restore Clang's historical
behavior for that flag.

llvm-svn: 193205

10 years agoImprovements to the ValueObjectPrinter to behave correctly in more dynamic value...
Enrico Granata [Tue, 22 Oct 2013 22:42:14 +0000 (22:42 +0000)]
Improvements to the ValueObjectPrinter to behave correctly in more dynamic value cases

llvm-svn: 193204

10 years agoSema: Allow IndirectFieldDecl to appear in a non-type template argument
David Majnemer [Tue, 22 Oct 2013 21:56:38 +0000 (21:56 +0000)]
Sema: Allow IndirectFieldDecl to appear in a non-type template argument

We would not identify pointer-to-member construction in a non-type
template argument if it was either a FieldDecl or a CXXMethodDecl.
However, this would incorrectly reject declarations that were injected
via an IndirectFieldDecl (e.g. a field inside of an anonymous union).

This fixes PR17657.

llvm-svn: 193203

10 years agoConsider hidden decls for isUsed checks.
Rafael Espindola [Tue, 22 Oct 2013 21:56:29 +0000 (21:56 +0000)]
Consider hidden decls for isUsed checks.

This fixes pr17624.

A FIXME from Richard Smith:

It seems to me that the root cause is that a per-Decl 'used' flag doesn't
really make much sense in the way we use it now. I think we should either track
whether that particular declaration is used (with isUsed scanning the entire
redecl chain), or we should only have one flag for the entire redeclaration
chain (perhaps by always looking at the flag on either the most recent decl or
the canonical decl). Modeling it as "is this declaration or any previous
declaration used" is weird, and requires contortions like the loop at the end
of Sema::MarkFunctionReferenced.

llvm-svn: 193202

10 years ago[PECOFF] Add /manifestdependency command line option.
Rui Ueyama [Tue, 22 Oct 2013 21:39:04 +0000 (21:39 +0000)]
[PECOFF] Add /manifestdependency command line option.

llvm-svn: 193201

10 years agoTreat aliases as definitions.
Rafael Espindola [Tue, 22 Oct 2013 21:39:03 +0000 (21:39 +0000)]
Treat aliases as definitions.

This fixes pr17639.

Before this patch clang would consider

void foo(void) __attribute((alias("__foo")));

a declaration. It now correctly handles it as a definition.

Initial patch by Alp Toker. I added support for variables.

llvm-svn: 193200

10 years ago[X86][FastISel] Add a comment to help understanding changes made in r192636.
Quentin Colombet [Tue, 22 Oct 2013 21:29:08 +0000 (21:29 +0000)]
[X86][FastISel] Add a comment to help understanding changes made in r192636.

<rdar://problem/15192473>

llvm-svn: 193199

10 years agoR600/SI: Don't assert on SCC usage
Matt Arsenault [Tue, 22 Oct 2013 21:11:31 +0000 (21:11 +0000)]
R600/SI: Don't assert on SCC usage

llvm-svn: 193198

10 years agoDebug Info: code clean up.
Manman Ren [Tue, 22 Oct 2013 20:59:19 +0000 (20:59 +0000)]
Debug Info: code clean up.

Remove unnecessary creation of LexicalScope in collectDeadVariables.
The created LexicialScope was only used to get isAbstractScope, which
should be false from the creation:
"new LexicalScope(NULL, DIDescriptor(SP), NULL, false);".

We can also remove a DenseMap that holds the created LexicalScopes.

llvm-svn: 193196

10 years ago[PECOFF] Add /manifestfile command line option.
Rui Ueyama [Tue, 22 Oct 2013 20:53:07 +0000 (20:53 +0000)]
[PECOFF] Add /manifestfile command line option.

/manifestfile:<path> specifies an alternative manifest file output path.
Default is "<output-path>.manifest" where <output-path> is the executable's
path.

llvm-svn: 193195

10 years agoWhitespace
David Blaikie [Tue, 22 Oct 2013 20:34:30 +0000 (20:34 +0000)]
Whitespace

llvm-svn: 193194

10 years agoDIEHashing: Provide an assert for unreachable functionality regarding friends.
David Blaikie [Tue, 22 Oct 2013 20:28:55 +0000 (20:28 +0000)]
DIEHashing: Provide an assert for unreachable functionality regarding friends.

Since (as of r190716) Clang no longer emits debug info for C++ friend
declarations (and it seems GCC never has/does, which was the motivation
for the Clang change), there's no actual reachable case for implementing
the part of DWARF 4, Section 7.27 part 5 that pertains to friends.

Leave an assert here so that if/when we do have a client producing
friends and using type units, we can fill in the gap and add appropriate
(unit and feature) tests.

llvm-svn: 193193

10 years agollvm-cov: Use uint32_t for loop variables to be more consistent.
Bob Wilson [Tue, 22 Oct 2013 20:02:36 +0000 (20:02 +0000)]
llvm-cov: Use uint32_t for loop variables to be more consistent.

The loop bounds here are uint32_t variables, so it makes sense for the
loop variables to have the same type.

Patch by Yuchen Wu!

llvm-svn: 193192

10 years agoSimplified the code that materializes a variable,
Sean Callanan [Tue, 22 Oct 2013 20:01:17 +0000 (20:01 +0000)]
Simplified the code that materializes a variable,
obviating the need to create a new ValueObject.

llvm-svn: 193191

10 years agollvm-cov: fix a typo and rename a variable.
Bob Wilson [Tue, 22 Oct 2013 19:54:32 +0000 (19:54 +0000)]
llvm-cov: fix a typo and rename a variable.

Rename Size to EndPos, which makes more sense because the variable
stores the last location of the blocks.

Patch by Yuchen Wu!

llvm-svn: 193189

10 years agoNew fix for pr17535.
Rafael Espindola [Tue, 22 Oct 2013 19:26:13 +0000 (19:26 +0000)]
New fix for pr17535.

This is a fixed version of r193161. In order to handle

    void foo() __attribute__((alias("bar")));
    void bar() {}
    void zed() __attribute__((alias("foo")));

it is not enough to delay aliases to the end of the TU, we have to do two
passes over them to find if they are defined or not.

This can be implemented by producing alias as we go and just doing the second
pass at the end. This has the advantage that other parts of clang that were
expecting alias to be processed in order don't have to be changed.

This patch also handles cyclic aliases.

llvm-svn: 193188

10 years ago_mm_extract_epi16: use "& 7" when index is out of bound.
Manman Ren [Tue, 22 Oct 2013 19:24:42 +0000 (19:24 +0000)]
_mm_extract_epi16: use "& 7" when index is out of bound.

This is in line with implementation of _mm_extract_pi16.
rdar://15250497

llvm-svn: 193187

10 years agoFactor out into a separate function. No functionality change.
Rui Ueyama [Tue, 22 Oct 2013 19:01:47 +0000 (19:01 +0000)]
Factor out into a separate function. No functionality change.

llvm-svn: 193186

10 years agoARM: provide diagnostics on more writeback LDM/STM instructions
Tim Northover [Tue, 22 Oct 2013 19:00:39 +0000 (19:00 +0000)]
ARM: provide diagnostics on more writeback LDM/STM instructions

The set of circumstances where the writeback register is allowed to be in the
list of registers is rather baroque, but I think this implements them all on
the assembly parsing side.

For disassembly, we still warn about an ARM-mode LDM even if the architecture
revision is < v7 (the required architecture information isn't available). It's
a silly instruction anyway, so hopefully no-one will mind.

rdar://problem/15223374

llvm-svn: 193185

10 years ago[analyzer] scan-build: Handle -m* option wildcard after compiler/linker flags.
Jordan Rose [Tue, 22 Oct 2013 18:55:18 +0000 (18:55 +0000)]
[analyzer] scan-build: Handle -m* option wildcard after compiler/linker flags.

Some of the shared compiler/linker flags start with -m, so they've been
getting passed to the compiler only since r180073. Now, the -m* wildcard
is processed after the shared flags and the ignored flags.

Found by Laszlo Nagy!

llvm-svn: 193184

10 years agoR600/SI: Use llvm_unreachable() for an always false assert
Tom Stellard [Tue, 22 Oct 2013 18:42:03 +0000 (18:42 +0000)]
R600/SI: Use llvm_unreachable() for an always false assert

llvm-svn: 193183

10 years agoR600/SI: Fix warning on non-asserts build
Tom Stellard [Tue, 22 Oct 2013 18:31:45 +0000 (18:31 +0000)]
R600/SI: Fix warning on non-asserts build

llvm-svn: 193180

10 years agoR600: Simplify handling of private address space
Tom Stellard [Tue, 22 Oct 2013 18:19:10 +0000 (18:19 +0000)]
R600: Simplify handling of private address space

The AMDGPUIndirectAddressing pass was previously responsible for
lowering private loads and stores to indirect addressing instructions.
However, this pass was buggy and way too complicated.  The only
advantage it had over the new simplified code was that it saved one
instruction per direct write to private memory.  This optimization
likely has a minimal impact on performance, and we may be able
to duplicate it using some other transformation.

For the private address space, we now:
1. Lower private loads/store to Register(Load|Store) instructions
2. Reserve part of the register file as 'private memory'
3. After regalloc lower the Register(Load|Store) instructions to
   MOV instructions that use indirect addressing.

llvm-svn: 193179

10 years agoR600: Remove unused InstrInfo::getMovImmInstr() function
Tom Stellard [Tue, 22 Oct 2013 18:19:01 +0000 (18:19 +0000)]
R600: Remove unused InstrInfo::getMovImmInstr() function

llvm-svn: 193178

10 years agoSimplify testing case (Thanks Rafael for the testing case).
Manman Ren [Tue, 22 Oct 2013 18:15:50 +0000 (18:15 +0000)]
Simplify testing case (Thanks Rafael for the testing case).

llvm-svn: 193177

10 years agoUse GEPs correctly when adjusting this in MicrosoftCXXABI
Timur Iskhodzhanov [Tue, 22 Oct 2013 18:15:24 +0000 (18:15 +0000)]
Use GEPs correctly when adjusting this in MicrosoftCXXABI

Reviewed at http://llvm-reviews.chandlerc.com/D1977

llvm-svn: 193176

10 years agoDWARF type hashing: pointers to members
David Blaikie [Tue, 22 Oct 2013 18:14:41 +0000 (18:14 +0000)]
DWARF type hashing: pointers to members

Includes a test case/FIXME demonstrating a bug/limitation in pointer to
member hashing. To be honest I'm not sure why we don't just always use
summary hashing for referenced types... but perhaps I'm missing
something.

llvm-svn: 193175

10 years agoRevert r193073 and the attempt to fix it in r193170.
Chandler Carruth [Tue, 22 Oct 2013 18:07:04 +0000 (18:07 +0000)]
Revert r193073 and the attempt to fix it in r193170.

This patch wasn't reviewed, and isn't correctly preserving the behaviors
relied upon by QT. I don't have a direct example of fallout, but it
should go through the standard code review process. For example, it
should never have removed the QT test case that was added when fixing
those users.

llvm-svn: 193174

10 years ago[PECOFF] /manifestuac option is case insensitive.
Rui Ueyama [Tue, 22 Oct 2013 17:56:55 +0000 (17:56 +0000)]
[PECOFF] /manifestuac option is case insensitive.

llvm-svn: 193173

10 years agoFix llvm-cov counts to be 64-bit integers to avoid overflows.
Bob Wilson [Tue, 22 Oct 2013 17:43:47 +0000 (17:43 +0000)]
Fix llvm-cov counts to be 64-bit integers to avoid overflows.

Line counts in llvm-cov are read in as 64-bit integers but were being truncated
to 32-bit in collectLineCounts(), which caused overflow for large counts.
This patch fixes all counts to be uint64_t.

Patch by Yuchen Wu!

llvm-svn: 193172

10 years ago[PECOFF] Fix /manifestuac handling.
Rui Ueyama [Tue, 22 Oct 2013 17:42:42 +0000 (17:42 +0000)]
[PECOFF] Fix /manifestuac handling.

uiAccess argument's type is not really boolean. It's string.

llvm-svn: 193171

10 years agoReenable 'break' in 'for' specifier to allow compilation of QT macro 'foreach'
Serge Pavlov [Tue, 22 Oct 2013 17:14:47 +0000 (17:14 +0000)]
Reenable 'break' in 'for' specifier to allow compilation of QT macro 'foreach'

This is a fix to PR17649, caused by fix in r193073. QT uses 'break' statement
to implement their 'foreach' macro. To enable build of QT, this fix reenables
break but only in 'for' statement specifier and only in the third expression.

llvm-svn: 193170

10 years agoMove local Db type out to namespace scope.
Howard Hinnant [Tue, 22 Oct 2013 16:45:48 +0000 (16:45 +0000)]
Move local Db type out to namespace scope.

llvm-svn: 193169

10 years agoclang-format: Fix ObjC literal indentation in Google style.
Daniel Jasper [Tue, 22 Oct 2013 15:45:58 +0000 (15:45 +0000)]
clang-format: Fix ObjC literal indentation in Google style.

Style guide demands a two-space indent.

Before:
  NSArray *arguments = @[
      kind == kUserTicket ? @"--user-store" : @"--system-store",
      @"--print-tickets",
      @"--productid",
      @"com.google.Chrome"
  ];

After:
  NSArray *arguments = @[
    kind == kUserTicket ? @"--user-store" : @"--system-store",
    @"--print-tickets",
    @"--productid",
    @"com.google.Chrome"
  ];

llvm-svn: 193168

10 years agoclang-format: Improve formatting of ObjC array literals.
Daniel Jasper [Tue, 22 Oct 2013 15:30:28 +0000 (15:30 +0000)]
clang-format: Improve formatting of ObjC array literals.

Before:
  NSArray *arguments =
      @[ kind == kUserTicket ? @"--user-store" : @"--system-store",
         @"--print-tickets", @"--productid", @"com.google.Chrome" ];
After:
  NSArray *arguments = @[
      kind == kUserTicket ? @"--user-store" : @"--system-store",
      @"--print-tickets",
      @"--productid",
      @"com.google.Chrome"
  ];

This fixes llvm.org/PR15231.

llvm-svn: 193167