Commit Graph

63692 Commits

Author SHA1 Message Date
Steven Wu 2c059a55e2 Change embed-bitcode linkage type
Embedded bitcode should have private linkage instead of appending or external.
Otherwise, it will cause link failure due to duplicated symbols.
Also add llvm.embedded.module and llvm.cmdline to llvm.compiler.used so they
don't get optimized out.

rdar://problem/21555860

llvm-svn: 269679
2016-05-16 18:54:58 +00:00
Nico Weber 379a1952b3 [ms] Reintroduce feature guards in intrinsic headers in Microsoft mode
Visual Studio's C++ standard library headers include intrin.h, so the intrinsic
headers get included a lot more often in Microsoft mode than elsewhere. The
AVX512 intrinsics are a lot of code (0.7 MB, causing 30% compile time overhead
for small programs including e.g. <string> and 6% compile time overhead for
larger projects like e.g. v8). Since multiversioning can't be relied on in
Microsoft mode (cl.exe doesn't support it), having faster compiles seems like
the much better tradeoff until we have a better intrinsic story going forward
(which we'll need for e.g. PR19898).

Actually using intrinsics on Windows already requires the right /arch:
settings, so this patch should have no big behavior change.

See also thread "The intrinsics headers (especially avx512) are too big. What
to do about it?" on cfe-dev.

http://reviews.llvm.org/D20291

llvm-svn: 269675
2016-05-16 18:14:07 +00:00
Paul Robinson 9d61361acb [PS4] Change the names of some "environmental" things to what our
licensees actually see in the toolchain we deliver to them.  This will
reduce the set of local patches we have to maintain.  The triple is
not changing.  (The term ORBIS is an internal code name for PS4.)

llvm-svn: 269671
2016-05-16 17:22:25 +00:00
Yaxun Liu 39cf40f6b4 [OpenCL] Add supported OpenCL extensions to target info.
Add supported OpenCL extensions to target info. It serves as default values to save the users of the burden setting each supported extensions and optional core features in command line.

Re-commit after fixing build error due to missing override attribute.

Differential Revision: http://reviews.llvm.org/D19484

llvm-svn: 269670
2016-05-16 17:06:34 +00:00
Aaron Ballman abdbbbc51f Add the hasDynamicExceptionSpec() AST matcher to match function declarations that have a dynamic exception specification.
Patch by Don Hinton.

llvm-svn: 269662
2016-05-16 16:49:01 +00:00
Bruno Cardoso Lopes b171a59bfd [Modules] Use vfs for (recursive) directory iteration
Clang performs directory walk while searching headers inside modules by
using the ::sys::fs instead of ::vfs. This prevents any code that uses
the VFS (e.g, reproducer scripts) to actually find such headers, since
the VFS will never be searched for those.

Change these places to use vfs::recursive_directory_iterator and
vfs::directory_iterator instead.

Differential Revision: http://reviews.llvm.org/D20266

rdar://problem/25880368

llvm-svn: 269661
2016-05-16 16:46:01 +00:00
Vasileios Kalintiris 44deb63ff2 [mips] Add test for the dynamic linker when using the mips64el-fedora-linux triple.
We should use the musl linker only when there's no environment specified and
the vendor is MTI. The new test verifies this behaviour and is a follow-up to
the r269411 commit that added the vendor field check.

llvm-svn: 269651
2016-05-16 11:53:51 +00:00
Michael Zuckerman cb85677471 [Clang][AVX512] completing missing intrinsics [vsqrt|vrsqrt|vrcp14 ].
Differential Revision: http://reviews.llvm.org/D20068

llvm-svn: 269649
2016-05-16 11:42:01 +00:00
Craig Topper 1aa231e3aa [X86] Add typecasts to remove most assumptions about what __m128i/__m256i is defined as. Add similar typecasts for the fp types as well.
llvm-svn: 269632
2016-05-16 06:38:42 +00:00
Craig Topper 9c6c85f1ad [AVX512] Add typecasts to some intrinsics to avoid doing operations on the __m512/__m512i/__m512d types.
llvm-svn: 269631
2016-05-16 06:38:36 +00:00
Saleem Abdulrasool 1e6c4060ad CodeGen: convert some const char * to StringRef
Convert some use of const char * to StringRef.  NFC.

llvm-svn: 269630
2016-05-16 05:06:49 +00:00
Nick Lewycky 0624b82260 Make this SourceLocation getter const LLVM_READONLY like others in the same file.
llvm-svn: 269625
2016-05-16 02:46:07 +00:00
Mike Spertus b27ebb8824 Simple visualization of expressions
While more could be done, showing the type is a lot better than what is there now.

llvm-svn: 269623
2016-05-16 01:36:09 +00:00
Craig Topper e5cc18054a [AVX512] Use correct types in test case.
llvm-svn: 269622
2016-05-16 01:09:19 +00:00
Craig Topper 91f23d900f [X86] Remove bad cast from the 'int' return type of __builtin_ia32_kortestchi to '__mask16' before return in an 'int' intrinsic.
llvm-svn: 269621
2016-05-16 01:09:16 +00:00
Craig Topper 7d00d2031d [AVX512] Fix bad typecasts on return value for 512-bit integer byte/word compare builtins.
llvm-svn: 269620
2016-05-16 00:51:06 +00:00
Craig Topper 0f7ea93541 [X86] Add immediate range checks for many of the builtins.
llvm-svn: 269619
2016-05-15 22:18:00 +00:00
Craig Topper 0ed182d1de [AVX512] Immediate argument for PALIGNR builtin should be an ICE./
llvm-svn: 269618
2016-05-15 22:17:57 +00:00
Craig Topper dca1f230ae [AVX512] Add intrinsics for 512-bit insertf32x8/insertf32x4/inserti32x4.
llvm-svn: 269617
2016-05-15 21:26:20 +00:00
Craig Topper 79d05c9b3d [AVX512] Mark some integer builtin arguments that go to immediates in final instructions as an ICE.
llvm-svn: 269613
2016-05-15 20:10:06 +00:00
Craig Topper 9864c59c89 [AVX512] Move unary negations to the left side of typecasts to specific vector type. The __m128/__m256/__m512 types should be treated more opaquely and not have any operations performed on them.
llvm-svn: 269612
2016-05-15 20:10:03 +00:00
Craig Topper f32e2fbe0e [AVX512] Use the correct mask type in an intrinsic.
llvm-svn: 269611
2016-05-15 20:10:00 +00:00
Craig Topper b81d430d3a [AVX512] Fix an intrinsic that was passing -2 as a mask instead of -1.
llvm-svn: 269610
2016-05-15 20:09:58 +00:00
Craig Topper bf8d85a0f3 [AVX512] Make the permd builtins take a 32-bit immediate to match the software spec.
llvm-svn: 269580
2016-05-14 21:13:31 +00:00
Oleksiy Vyalov 94854be9e1 Revert r269546 "Added support to the ASTImporter for C++ constructor initializers." as it breaks TestDataFormatterSynthVal.DataFormatterSynthValueTestCase.test_with_run_command_dwarf test - http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-cmake/builds/14699
llvm-svn: 269575
2016-05-14 19:07:13 +00:00
Nick Lewycky 2eeddfb1ef Warn when a reference is bound to an empty l-value (dereferenced null pointer).
llvm-svn: 269572
2016-05-14 17:44:14 +00:00
Craig Topper 77334aa996 [AVX512] Immediate for permd builtins should be an ICE.
llvm-svn: 269570
2016-05-14 15:27:13 +00:00
Daniel Sanders e160f83f71 [mips] Enable IAS by default for 32-bit MIPS targets (O32).
Summary:
The MIPS IAS can now pass 'ninja check-all', recurse, build a bootable linux
kernel, and pass a variety of LNT testing.

Unfortunately we can't enable it by default for 64-bit targets yet since the N32
ABI is still very buggy and this also means we can't enable it for N64 either
because we can't distinguish between N32 and N64 in the relevant code.

Reviewers: vkalintiris

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18759
Differential Revision: http://reviews.llvm.org/D18761

llvm-svn: 269560
2016-05-14 12:43:08 +00:00
NAKAMURA Takumi 81b08dedde ModuleMap.h: Fix a \param. [-Wdocumentation]
llvm-svn: 269559
2016-05-14 12:37:06 +00:00
NAKAMURA Takumi 2326f79a60 MSVCToolChain.cpp: Make version.dll generic for win32.
We may consider msvc features may be capable on mingw host, if it can.
Consider --host=mingw --target=msvc.

llvm-svn: 269557
2016-05-14 08:12:37 +00:00
NAKAMURA Takumi 4b8e3e59cd MSVCToolChain.cpp: Use explicit constructor for SmallString from std::string, to appease mingw-g++.
llvm-svn: 269556
2016-05-14 08:09:12 +00:00
Sean Callanan f3682a7014 Update identifiers as needed when loading macros from serialized ASTs.
This is essential for iterating across macros properly, which LLDB does when
loading macros from modules.  A naiver version of this patch (without the
conditional) caused assertion failures in the testsuite, but this version should
be safe.

Thanks to Ben Langmuir for the refinement that made this work.

llvm-svn: 269554
2016-05-14 06:24:14 +00:00
Sean Callanan f94ef1df8b Fixed a bug where the ASTImporter didn't propagate builtin IDs at all.
IdentifierInfos are assigned builtin IDs during parsing, but Idents.get() does 
not do that work.  So the ASTImporter needs to additionally set the builtin ID
for the newly-created IdentifierInfo.  This patch does that.

Currently ASTMerge tests only check syntax and the ASTMatchers don't check for
builtin IDs, so this is tricky to test, but LLDB will have a test for this.

llvm-svn: 269553
2016-05-14 06:11:19 +00:00
Craig Topper 4537ea74eb [X86] Change most 'void' pointers in builtin type lists to more correct types. Fix some unaligned load/store intrinsics to use a less aligned type in their pointer casts.
llvm-svn: 269552
2016-05-14 06:03:13 +00:00
Sean Callanan 041cceb019 Handle injected class names in the ASTImporter.
Every class as parsed by Clang has a forward declaration of itself as a member:

class A {
  class A;
  ...
}

but when the parser generates this it ensures that the RecordTypes for the two 
are the same.  This makes (among other things) inheritance work.  This patch
fixes a bug where the ASTImporter generated two separate RecordTypes when
importing the class and the contained forward declaration, and adds a test case.

Thanks to Doug Gregor for advice on this.

llvm-svn: 269551
2016-05-14 05:43:57 +00:00
Chandler Carruth 1b766d09d1 Revert "Reapply "[ProfileData] (clang) Use Error in InstrProf and Coverage, NFC""
This reverts commit r269492 as the corresponding LLVM commit was
reverted due to lots of warnings. See the review thread for the original
LLVM commit (r269491) for details.

llvm-svn: 269549
2016-05-14 05:39:45 +00:00
Sean Callanan 55d486d72a Added support to the ASTImporter for C++ constructor initializers.
Thanks to Aleksei Sidorin for review and advice.

llvm-svn: 269546
2016-05-14 05:20:31 +00:00
Richard Smith 9385d704c1 When typo-correcting a using-declaration, actually correct the name of the
UsingDecl (so that redeclaration lookup can find it).

llvm-svn: 269530
2016-05-14 01:58:49 +00:00
Richard Smith 81ef0e1adb Fix some typos.
llvm-svn: 269528
2016-05-14 01:21:40 +00:00
Craig Topper b1d4e18dfc [AVX512] Update pshufd type strings to match the backend. Also mark the immediate as an ICE instead of marking the previous vector as const.
llvm-svn: 269527
2016-05-14 00:49:36 +00:00
Bruno Cardoso Lopes 32b2897af6 [VFS] Add level() method to vfs::recursive_directory_iterator
Unlike sys::fs::recursive_directory_iterator,
vfs::recursive_directory_iterator does not implement the level() method,
which tells how deep in the directory tree the current iterator is. This
is needed in the vfs::recursive_directory_iterator so that future
improvements to the crash reproducer will be able to properly access
header for umbrellas when looking into the VFS.

rdar://problem/25880368

llvm-svn: 269520
2016-05-14 00:00:18 +00:00
Adrian McCarthy e4b26fc7a7 Get default -fms-compatibility-version from cl.exe's version
-fms-compatibility-version was defaulting to 18 (VS 2013), which is a pain if your environment is pointing to version 19 (VS 2015) libraries.

If cl.exe can be found, this patch uses its version number as the default instead. It re-uses the existing code to find the Visual Studio binaries folder and WinAPI methods to check its version. You can still explicitly specify a compatibility version on the command line. If you don't have cl.exe, this should be a no-op and you'll get the old default of 18.

This affected the tests, which assumed that if you didn't specific a version, that it would default to 18, but this won't be true for all machines. So a couple test cases had to be eliminated and a couple others had to be tweaked to allow for various outputs.

Addresses: https://llvm.org/bugs/show_bug.cgi?id=27215

Differential Revision: http://reviews.llvm.org/D20136

llvm-svn: 269515
2016-05-13 23:20:11 +00:00
Bruno Cardoso Lopes b3a0fa4863 [ModuleMap][CrashReproducer] Collect headers from inner frameworks
(1) Collect headers under inner frameworks (frameworks inside other
other frameworks).
(2) Make sure we also collect the right header files inside them.

More info on (2):

Consider a dummy framework module B, with header Frameworks/B/B.h. Now
consider that another framework A, with header Frameworks/A/A.h, has a
layout with a inner framework Frameworks/A/Frameworks/B/B.h, where the
"B/B.h" part is a symlink for Frameworks/B/B.h. Also assume that
Frameworks/A/A.h includes <B/B.h>.

When parsing header Frameworks/A/A.h, framework module lookup is
performed in search for B, and it happens that
"Frameworks/A/Frameworks/B/B.h" path is registered in the module instead
of real "Frameworks/B/B.h". This occurs because
"Frameworks/A/Frameworks/B/B.h" is scanned first by the FileManager,
when looking for inner framework modules under Frameworks/A/Frameworks.
This makes Frameworks/A/Frameworks/B/B.h the default cached named inside
the FileManager for the B.h file UID.

This leads to modules being built without consistent paths to underlying
header files. This is usually not a problem in regular compilation flow,
but it's an issue when running the crash reproducer. The issue is that
clangs collect "Frameworks/A/Frameworks/B/B.h" but not
"Frameworks/B/B.h" into the VFS, leading to err_mmap_umbrella_clash. So
make sure we also collect the original header.

Differential Revision: http://reviews.llvm.org/D20194

rdar://problem/25880368

llvm-svn: 269502
2016-05-13 22:21:51 +00:00
Vedant Kumar 0b7b7ae806 Reapply "[ProfileData] (clang) Use Error in InstrProf and Coverage, NFC"
Sync up with "(llvm) Use Error in InstrProf and Coverage".

Differential Revision: http://reviews.llvm.org/D19902

llvm-svn: 269492
2016-05-13 21:51:02 +00:00
Tim Northover 862eaf8a12 ARM-MachO: stop claiming to be EABI
Embedded ARM MachO targets are AAPCS but not full EABI (we don't use
__aeabi_whatever and the functions are allowed to be hard-float).

Turns out there was already a test for this, but its original purpose had
become corrupted over the years.

llvm-svn: 269487
2016-05-13 21:26:45 +00:00
Vedant Kumar 2d87639c5a Revert "[ProfileData] (clang) Use Error in InstrProf and Coverage, NFC"
This reverts commit r269463. It fails two llvm-profdata tests.

llvm-svn: 269468
2016-05-13 20:10:22 +00:00
David Majnemer 833b91eee8 [MS ABI] Delegating constructors should not assume they are most derived
A constructor needs to know whether or not it is most derived in order
to determine if it is responsible for virtual bases.  Delegating
constructors assumed they were most derived.

llvm-svn: 269465
2016-05-13 20:05:09 +00:00
Vedant Kumar 31af1fd161 [ProfileData] (clang) Use Error in InstrProf and Coverage, NFC
Sync up with "(llvm) Use Error in InstrProf and Coverage".

llvm-svn: 269463
2016-05-13 20:01:34 +00:00
Etienne Bergeron 75e52725e4 Add an AST matcher for CastExpr kind
Summary:
This AST matcher will match a given CastExpr kind.
It's an narrowing matcher on CastExpr.

Reviewers: klimek, alexfh, sbenza, aaron.ballman

Subscribers: Prazek, jroelofs, aaron.ballman, klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D19871

llvm-svn: 269460
2016-05-13 19:36:55 +00:00
Richard Smith a87b766027 Use marginally more appropriate functions to detect if we should declare an
implicit copy constructor/assignment, and other minor cleanups. No
functionality change intended.

llvm-svn: 269457
2016-05-13 18:48:05 +00:00