platform/upstream/llvm.git
10 years agoAdded std::string as a built-in type for mapping.
John Thompson [Thu, 24 Oct 2013 13:36:58 +0000 (13:36 +0000)]
Added std::string as a built-in type for mapping.

llvm-svn: 193344

10 years ago[msan] Unpoison errno in common interceptors.
Evgeniy Stepanov [Thu, 24 Oct 2013 13:20:34 +0000 (13:20 +0000)]
[msan] Unpoison errno in common interceptors.

llvm-svn: 193343

10 years agoARM: add a couple more NEON predicates.
Tim Northover [Thu, 24 Oct 2013 12:48:05 +0000 (12:48 +0000)]
ARM: add a couple more NEON predicates.

The fused multiply instructions were added in VFPv4 but are still NEON
instructions, in particular they shouldn't be available on a Cortex-M4 not
matter how floaty it is.

llvm-svn: 193342

10 years agoARM: mark various aliases with their architecture requirements.
Tim Northover [Thu, 24 Oct 2013 12:22:58 +0000 (12:22 +0000)]
ARM: mark various aliases with their architecture requirements.

If an alias inherits directly from InstAlias then it doesn't get any default
"Requires" values, so llvm-mc will allow it even on architectures that don't
support the underlying instruction.

This tidies up the obvious VFP and NEON cases I found.

llvm-svn: 193340

10 years ago[msan] Fix invalid origin copying.
Evgeniy Stepanov [Thu, 24 Oct 2013 11:56:03 +0000 (11:56 +0000)]
[msan] Fix invalid origin copying.

Origin copying may destroy valid origin info. This is caused by
__msan_copy_origin widening the address range to the nearest 4-byte aligned
addresses both on the left and on the right. If the target buffer is
uninitialized and the source is fully initialized, this will result in
overriding valid origin of target buffer with stale (possibly 0) origin of the
source buffer.

With this change the widened origin is copied only if corresponding shadow
values are non zero.

llvm-svn: 193338

10 years ago[msan] Change wording in the invalid origin message.
Evgeniy Stepanov [Thu, 24 Oct 2013 11:52:48 +0000 (11:52 +0000)]
[msan] Change wording in the invalid origin message.

llvm-svn: 193335

10 years agoAdded tests for microMIPS relocations 1.
Zoran Jovanovic [Thu, 24 Oct 2013 10:55:00 +0000 (10:55 +0000)]
Added tests for microMIPS relocations 1.

llvm-svn: 193332

10 years agoARM-Darwin: Use the *-*-darwin-eabi triple for v6m & v7m archs
Tim Northover [Thu, 24 Oct 2013 10:48:50 +0000 (10:48 +0000)]
ARM-Darwin: Use the *-*-darwin-eabi triple for v6m & v7m archs

These arch arguments are used for embedded targets (obviously) which need a
different calling convention to iOS.

llvm-svn: 193328

10 years agoARM: Use non-VFP softcalls on embedded Darwinish targets
Tim Northover [Thu, 24 Oct 2013 10:37:09 +0000 (10:37 +0000)]
ARM: Use non-VFP softcalls on embedded Darwinish targets

The compiler-rt functions __adddf3vfp and so on exist purely to allow Thumb1
code to make use of VFP instructions by switching back to ARM mode, they make
no sense for M-class processors which don't even have an ARM mode.

Given that justification, in practice this is a platform ABI decision so the
actual check is based on that rather than CPU features.

rdar://problem/15302004

llvm-svn: 193327

10 years agoclang-format: Cleanup array initializer and dict initializer formatting.
Daniel Jasper [Thu, 24 Oct 2013 10:31:50 +0000 (10:31 +0000)]
clang-format: Cleanup array initializer and dict initializer formatting.

Significant changes:
- Also recognize these literals with missing "@" for robustness.
- Reorganize tests.

llvm-svn: 193325

10 years agoReplaced non-ASCII character.
Yaron Keren [Thu, 24 Oct 2013 10:04:47 +0000 (10:04 +0000)]
Replaced non-ASCII character.

llvm-svn: 193324

10 years agoRevert part of r193291, restoring the deletion of loaded objects.
Chandler Carruth [Thu, 24 Oct 2013 09:52:56 +0000 (09:52 +0000)]
Revert part of r193291, restoring the deletion of loaded objects.
Without this, customers of the MCJIT were leaking memory like crazy.

It's not really clear what the *right* memory management is here, so I'm
not trying to add lots of tests or other logic, just trying to get us
back to a better baseline. I'll follow up on the original commit to
figure out the right path forward.

llvm-svn: 193323

10 years agoARM: fix assert on unpredictable POP instruction.
Tim Northover [Thu, 24 Oct 2013 09:37:18 +0000 (09:37 +0000)]
ARM: fix assert on unpredictable POP instruction.

POP instructions are aliased to the ARM LDM variants but have different syntax.
This caused two problems: we tried to access a non-existent operand to annotate
the '!', and the error message didn't make much sense.

With some vigorous hand-waving in the error message both problems can be
fixed.

llvm-svn: 193322

10 years agoAdded test for -elf configuration, to see that _alloca call is properly
Yaron Keren [Thu, 24 Oct 2013 09:36:08 +0000 (09:36 +0000)]
Added test for -elf configuration, to see that _alloca call is properly
generated. See:

http://llvm.org/viewvc/llvm-project?view=revision&revision=193289

llvm-svn: 193321

10 years agoMake sure SP is always aligned on a 2 byte boundary
Job Noorman [Thu, 24 Oct 2013 09:32:31 +0000 (09:32 +0000)]
Make sure SP is always aligned on a 2 byte boundary

llvm-svn: 193320

10 years agoTeach Clang to accept and ignore -f[no-]implicit-templates.
Chandler Carruth [Thu, 24 Oct 2013 09:21:37 +0000 (09:21 +0000)]
Teach Clang to accept and ignore -f[no-]implicit-templates.

This GCC flag is useful when you want to control whether implicit
template instantiation occurs at the commandline level. Clang doesn't
currently support such controls, but technically *always* implicitly
instantiating (what Clang does, and what every other compiler still in
use does by default) is valid behavior even under
-fno-implicit-templates, it just may be slow and very wasteful. If
people really want this, we can try to implement it, but I don't have an
actual use.

This should help fix the build of libstdc++ with Clang, its build system
uses this flag.

llvm-svn: 193319

10 years agoTeach Clang to recognize and ignore GCC's -fdiagnostics-show-location
Chandler Carruth [Thu, 24 Oct 2013 09:17:35 +0000 (09:17 +0000)]
Teach Clang to recognize and ignore GCC's -fdiagnostics-show-location
flag. We should probably wire at least some variants of this up to our
actual diagnostics engine, but I'm leaving that for someone else. This
fixes the builds of packages which hard code something here, at least
including libstdc++ itself.

llvm-svn: 193318

10 years agofix PR17635: false positive with packed structures
Nuno Lopes [Thu, 24 Oct 2013 09:17:24 +0000 (09:17 +0000)]
fix PR17635: false positive with packed structures
LLVM optimizers may widen accesses to packed structures that overflow the structure itself, but should be in bounds up to the alignment of the object

llvm-svn: 193317

10 years ago[AArch64] Fix NZCV reg live-in bug in F128CSEL codegen.
Amara Emerson [Thu, 24 Oct 2013 08:28:24 +0000 (08:28 +0000)]
[AArch64] Fix NZCV reg live-in bug in F128CSEL codegen.

When generating the IfTrue basic block during the F128CSEL pseudo-instruction
handling, the NZCV live-in for the newly created BB wasn't being added. This
caused a fault during MI-sched/live range calculation when the predecessor
for the fall-through BB didn't have a live-in for phys-reg as expected.

llvm-svn: 193316

10 years agoInclude missing Compiler.h for using LLVM_ENUM_INT_TYPE.
Zonr Chang [Thu, 24 Oct 2013 08:17:39 +0000 (08:17 +0000)]
Include missing Compiler.h for using LLVM_ENUM_INT_TYPE.

llvm-svn: 193315

10 years agoUse the same SourceManager for ModuleMaps and compilations.
Manuel Klimek [Thu, 24 Oct 2013 07:51:24 +0000 (07:51 +0000)]
Use the same SourceManager for ModuleMaps and compilations.

This allows using virtual file mappings on the original SourceManager to
map in virtual module.map files. Without this patch, the ModuleMap
search will find a module.map file (as the FileEntry exists in the
FileManager), but will be unable to get the content from the
SourceManager (as ModuleMap previously created its own SourceManager).

Two problems needed to be fixed which this patch exposed:

1. Storing the inferred module map
When writing out a module, the ASTWriter stores the names of the files
in the main source manager; when loading the AST again, the ASTReader
errs out if such a file is found missing, unless it is overridden.
Previously CompilerInstance's compileModule method would store the
inferred module map to a temporary file; the problem with this approach
is that now that the module map is handled by the main source manager,
the ASTWriter stores the name of the temporary module map as source to
the compilation; later, when the module is loaded, the temporary file
has already been deleted, which leads to a compilation error. This patch
changes the inferred module map to instead inject a virtual file into
the source manager. This both saves some disk IO, and works with how the
ASTWriter/ASTReader handle overridden source files.

2. Changing test input in test/Modules/Inputs/*
Now that the module map file is handled by the main source manager, the
VerifyDiagnosticConsumer will not ignore diagnostics created while
parsing the module map file. The module test test/Modules/renamed.m uses
-I test/Modules/Inputs and triggers recursive loading of all module maps
in test/Modules/Inputs, some of which had conflicting names, thus
leading errors while parsing the module maps. Those diagnostics already
occur on trunk, but before this patch they would not break the test, as
they were ignored by the VerifyDiagnosticConsumer. This patch thus
changes the module maps that have been recently introduced which broke
the invariant of compatible modules maps in test/Modules/Inputs.

llvm-svn: 193314

10 years agoRemove dead recursive function.
Benjamin Kramer [Thu, 24 Oct 2013 07:39:30 +0000 (07:39 +0000)]
Remove dead recursive function.

llvm-svn: 193313

10 years agoAVX-512: added VCVTPH2PS, VCVTPS2PH with intrinsics
Elena Demikhovsky [Thu, 24 Oct 2013 07:16:35 +0000 (07:16 +0000)]
AVX-512: added VCVTPH2PS, VCVTPS2PH with intrinsics

llvm-svn: 193312

10 years agoReplace sse41/sse42 with sse4.1/sse4.2 in test command lines to fix bots.
Craig Topper [Thu, 24 Oct 2013 07:00:06 +0000 (07:00 +0000)]
Replace sse41/sse42 with sse4.1/sse4.2 in test command lines to fix bots.

llvm-svn: 193311

10 years agoAdd non-AVX tests for AES intrinsics.
Craig Topper [Thu, 24 Oct 2013 06:50:17 +0000 (06:50 +0000)]
Add non-AVX tests for AES intrinsics.

llvm-svn: 193310

10 years agoAdd tests for SSE intrinsics in non-avx mode by copying from the AVX test cases....
Craig Topper [Thu, 24 Oct 2013 06:45:13 +0000 (06:45 +0000)]
Add tests for SSE intrinsics in non-avx mode by copying from the AVX test cases. Some of these may have been tested by other tests, but most weren't. Patch by Cameron McInally.

llvm-svn: 193309

10 years agoIntroduce an operator new for LowLevelAllocator, and convert most users to it.
Peter Collingbourne [Thu, 24 Oct 2013 06:23:39 +0000 (06:23 +0000)]
Introduce an operator new for LowLevelAllocator, and convert most users to it.

llvm-svn: 193308

10 years agoFix a bug in LinearFunctionTestReplace that created invalid loop exit checks.
Juergen Ributzka [Thu, 24 Oct 2013 05:29:56 +0000 (05:29 +0000)]
Fix a bug in LinearFunctionTestReplace that created invalid loop exit checks.

Reviewed by Andy

llvm-svn: 193303

10 years agoFix Comments.
Shankar Easwaran [Thu, 24 Oct 2013 04:28:14 +0000 (04:28 +0000)]
Fix Comments.

llvm-svn: 193302

10 years ago[Driver] Change UniversalDriver to use TD file.
Shankar Easwaran [Thu, 24 Oct 2013 04:23:02 +0000 (04:23 +0000)]
[Driver] Change UniversalDriver to use TD file.

Easier to add new options such as -version, and easy to parse.

Now displays a help message with -help

llvm-svn: 193301

10 years ago[PassManager] add ReaderWriter{Native,YAML} to the Driver.
Shankar Easwaran [Thu, 24 Oct 2013 03:30:03 +0000 (03:30 +0000)]
[PassManager] add ReaderWriter{Native,YAML} to the Driver.

Disable tests to be run with REQUIRES: disable. Note disable is not added to the
config by the test runner Mkaefiles, so essentially disables the test.

Code changes would be required to fix these tests :-

test/darwin/hello-world.objtxt
test/elf/check.test
test/elf/phdr.test
test/elf/ppc.test
test/elf/undef-from-main-dso.test
test/elf/X86_64/note-sections-ro_plus_rw.test
test/pecoff/alignment.test
test/pecoff/base-reloc.test
test/pecoff/bss-section.test
test/pecoff/drectve.test
test/pecoff/dynamic.test
test/pecoff/dynamicbase.test
test/pecoff/entry.test
test/pecoff/hello.test
test/pecoff/imagebase.test
test/pecoff/importlib.test
test/pecoff/lib.test
test/pecoff/multi.test
test/pecoff/reloc.test
test/pecoff/weak-external.test

llvm-svn: 193300

10 years agoFixed llvm-cov to count edges instead of blocks.
Yuchen Wu [Thu, 24 Oct 2013 01:51:04 +0000 (01:51 +0000)]
Fixed llvm-cov to count edges instead of blocks.

This was a fundamental flaw in llvm-cov where it treated the values in
the GCDA files as block counts instead of edge counts. This created
incorrect line counts when branching was present. Instead, the edge
counts should be summed to obtain the correct block count.

The fix was tested using custom test files as well as single source
files from the test-suite directory. The behaviour can be verified by
reading the GCOV documentation that describes the GCDA spec ("ARC_COUNTS
gives the counter values for those arcs that are instrumented") and the
header description provided by GCOVProfiling.cpp ("instruments the code
that runs to records (sic) the edges between blocks that run and emit a
complementary "gcda" file on exit").

llvm-svn: 193299

10 years ago[PECOFF] Support embedding resource file into executable.
Rui Ueyama [Thu, 24 Oct 2013 01:39:43 +0000 (01:39 +0000)]
[PECOFF] Support embedding resource file into executable.

Instead of making the linker to create a manifest XML file in the same
directory as the resulting binary, you can embed the XML as a part of
resource into the executable.

In order to do that, the linker first creates a resource script file containing
the XML file, compile it into a binary resource file with RC.EXE, and then
convert it to a COFF file with CVTRES.EXE.

llvm-svn: 193298

10 years agoSupport GNU attributes in alias-declarations now that GCC has implemented them
Richard Smith [Thu, 24 Oct 2013 01:21:09 +0000 (01:21 +0000)]
Support GNU attributes in alias-declarations now that GCC has implemented them
and we know where they go.

llvm-svn: 193297

10 years agoFix a test file option from -emit-llvm -o to -emit-llvm-only.
Faisal Vali [Thu, 24 Oct 2013 01:11:55 +0000 (01:11 +0000)]
Fix a test file option from -emit-llvm -o to -emit-llvm-only.

As requested by Rafael Espindola here: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131021/091556.html

llvm-svn: 193296

10 years agoPR17666: Instead of allowing an initial identifier argument in any attribute
Richard Smith [Thu, 24 Oct 2013 01:07:54 +0000 (01:07 +0000)]
PR17666: Instead of allowing an initial identifier argument in any attribute
which we don't think can't have one, only allow it in the tiny number of
attributes which opts into this weird parse rule.

I've manually checked that the handlers for all these attributes can in fact
cope with an identifier as the argument. This is still somewhat terrible; we
should move more fully towards picking the parsing rules based on the
attribute, and make the Parse -> Sema interface more type-safe.

llvm-svn: 193295

10 years agoFix an instantiation bug with nested generic lambdas and conversion to fptrs.
Faisal Vali [Thu, 24 Oct 2013 01:05:22 +0000 (01:05 +0000)]
Fix an instantiation bug with nested generic lambdas and conversion to fptrs.

This patch fixes the typelocs of the conversion-operator and the conversion-operator-name and adds the parameters of the call operator to the FunctionProtoTypeLoc of the respective entities. Thus, when the template declarations (conversion operators) undergo deduction and instantiation/transformation/substitution - they add themselves to the local instantiation scope if needed.

This patch supports the following:

auto L = [](auto b) {
  return [](auto a) ->decltype(a) { return a; };
};
int (*fp)(int) = L(8);

Richard LGTM'd this patch: http://llvm-reviews.chandlerc.com/D1831

Thanks!

llvm-svn: 193294

10 years agoUndoing accidental change to docs/LanguageExtensions.rst in my previous
Warren Hunt [Thu, 24 Oct 2013 00:59:24 +0000 (00:59 +0000)]
Undoing accidental change to docs/LanguageExtensions.rst in my previous
patch.

llvm-svn: 193293

10 years agoClarify comments in genLoopLimit.
Andrew Trick [Thu, 24 Oct 2013 00:43:38 +0000 (00:43 +0000)]
Clarify comments in genLoopLimit.

llvm-svn: 193292

10 years agoOptimizing MCJIT module state tracking
Andrew Kaylor [Thu, 24 Oct 2013 00:19:14 +0000 (00:19 +0000)]
Optimizing MCJIT module state tracking

Patch co-developed with Yaron Keren.

llvm-svn: 193291

10 years agoImplements 64 bit microsoft record layout and adds lit tests to cover
Warren Hunt [Wed, 23 Oct 2013 23:53:07 +0000 (23:53 +0000)]
Implements 64 bit microsoft record layout and adds lit tests to cover
it.  Also removes all of the microsoft C++ ABI related code from the
itanium layout builder.

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

llvm-svn: 193290

10 years ago(this is a corrected patch)
Yaron Keren [Wed, 23 Oct 2013 23:37:01 +0000 (23:37 +0000)]
(this is a corrected patch)

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 OS (both Windows target and MingW target)
but not Mach-O object format: Looks like macho environment was used to
build some EFI code.

Credits to Andrew MacPherson.

llvm-svn: 193289

10 years agoMore wordsmithing on objc_requires_super documentation.
Ted Kremenek [Wed, 23 Oct 2013 23:30:08 +0000 (23:30 +0000)]
More wordsmithing on objc_requires_super documentation.

llvm-svn: 193288

10 years agoDebug Info: code clean up.
Manman Ren [Wed, 23 Oct 2013 23:05:28 +0000 (23:05 +0000)]
Debug Info: code clean up.

Since we never insert DIE for DITemplateTypeParameter to a map, there is no need
to call getDIE in getOrCreateTemplateTypeParameterDIE. It is also renamed to
constructTemplateTypeParameterDIE to match with other construct functions
in CompileUnit.

Same applies to getOrCreateTemplateValueParameterDIE.

llvm-svn: 193287

10 years agoDebug Info: code clean up.
Manman Ren [Wed, 23 Oct 2013 23:00:44 +0000 (23:00 +0000)]
Debug Info: code clean up.

Rename createMemberDIE to constructMemberDIE to match other construct functions
in CompileUnit.

llvm-svn: 193286

10 years agoDebug Info: code clean up.
Manman Ren [Wed, 23 Oct 2013 22:57:12 +0000 (22:57 +0000)]
Debug Info: code clean up.

Remove the unneeded return values from createMemberDIE, constructEnumTypeDIE,
getOrCreateTemplateTypeParameterDIE, and getOrCreateTemplateValueParameterDIE.

llvm-svn: 193285

10 years agoDebug Info: code clean up.
Manman Ren [Wed, 23 Oct 2013 22:52:22 +0000 (22:52 +0000)]
Debug Info: code clean up.

Unifying the argument ordering of private construct functions in CompileUnit to
follow constructTypeDIE(DIE &, DIBasicType),
constructTypeDIE(DIE &, DIDerivedType), constructTypeDIE(DIE &, DICompositeType),
constructSubrangeDIE and constructArrayTypeDIE.

llvm-svn: 193284

10 years agoWordsmith text of objc_requires_super.
Ted Kremenek [Wed, 23 Oct 2013 22:41:52 +0000 (22:41 +0000)]
Wordsmith text of objc_requires_super.

llvm-svn: 193283

10 years agoActually switch the default to use multiprocessing
Rafael Espindola [Wed, 23 Oct 2013 22:32:53 +0000 (22:32 +0000)]
Actually switch the default to use multiprocessing

llvm-svn: 193282

10 years agoFix typo.
Ted Kremenek [Wed, 23 Oct 2013 22:25:59 +0000 (22:25 +0000)]
Fix typo.

llvm-svn: 193281

10 years ago[lit] Stop hacking the GIL check interval.
Daniel Dunbar [Wed, 23 Oct 2013 22:19:32 +0000 (22:19 +0000)]
[lit] Stop hacking the GIL check interval.

 - This was never a big win, and is irrelevant now that we commonly use
   multiprocessing based parallelism.

llvm-svn: 193280

10 years ago[lit] Use multiprocessing based parallelism by default, on Unix.
Daniel Dunbar [Wed, 23 Oct 2013 22:19:07 +0000 (22:19 +0000)]
[lit] Use multiprocessing based parallelism by default, on Unix.

llvm-svn: 193279

10 years agoProvide documentation on attribute((objc_requires_super)).
Ted Kremenek [Wed, 23 Oct 2013 22:15:01 +0000 (22:15 +0000)]
Provide documentation on attribute((objc_requires_super)).

llvm-svn: 193278

10 years agoChange title of section to reflect the concept, and not the mechanism.
Ted Kremenek [Wed, 23 Oct 2013 22:14:59 +0000 (22:14 +0000)]
Change title of section to reflect the concept, and not the mechanism.

llvm-svn: 193277

10 years agoRemove {} from one-line block.
Manman Ren [Wed, 23 Oct 2013 22:12:26 +0000 (22:12 +0000)]
Remove {} from one-line block.

llvm-svn: 193276

10 years agoRevert "Calling _chkstk is required on ELF as well as COFF on Windows. Without _chkst...
Rafael Espindola [Wed, 23 Oct 2013 21:45:09 +0000 (21:45 +0000)]
Revert "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."

This reverts commit r193263.

It is causing CodeGen/X86/mingw-alloca.ll to fail.

llvm-svn: 193275

10 years agoParse: Disable delayed template parsing for constexpr functions
David Majnemer [Wed, 23 Oct 2013 21:31:20 +0000 (21:31 +0000)]
Parse: Disable delayed template parsing for constexpr functions

Commit r191484 treated constexpr function templates as normal function
templates with respect to delaying their parsing.  However, this is
unnecessarily restrictive because there is no compatibility concern with
constexpr, MSVC doesn't support it.

Instead, simply disable delayed template parsing for constexpr function
templates.  This largely reverts the changes made in r191484 but keeps
it's unit test.

This fixes PR17661.

llvm-svn: 193274

10 years agoFixed doxygen comment to match Module.cpp
Yuchen Wu [Wed, 23 Oct 2013 21:25:44 +0000 (21:25 +0000)]
Fixed doxygen comment to match Module.cpp

llvm-svn: 193273

10 years agoReduce casting and use a fully covered switch.
Rafael Espindola [Wed, 23 Oct 2013 21:24:34 +0000 (21:24 +0000)]
Reduce casting and use a fully covered switch.

llvm-svn: 193272

10 years agoRun layout-transitivity test only when debugging is enabled.
Rui Ueyama [Wed, 23 Oct 2013 21:15:48 +0000 (21:15 +0000)]
Run layout-transitivity test only when debugging is enabled.

Because it depends on "-mllvm -debug" flag, the test fails in Release build.

llvm-svn: 193271

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