Commit Graph

53311 Commits

Author SHA1 Message Date
Saleem Abdulrasool d1ee08e7cd Basic: whitespace cleanup
Remove unnecessary separation of anonymous namespace.  NFC.

llvm-svn: 211990
2014-06-28 23:34:07 +00:00
Richard Trieu c1888e0c6e Extend -Wtautological-undefined-compare and -Wundefined-bool-conversion to
trigger on taking the address of a reference that is returned from a function
call.

llvm-svn: 211989
2014-06-28 23:25:37 +00:00
Craig Topper e3d2ecbe86 Import MutableArrayRef into clang namespace.
llvm-svn: 211988
2014-06-28 23:22:33 +00:00
Craig Topper 00bbdcf9b3 Remove llvm:: from uses of ArrayRef.
llvm-svn: 211987
2014-06-28 23:22:23 +00:00
Simon Atanasyan 98ba8a657d [Driver][Mips] Fix else-after-return.
No functional changes.

llvm-svn: 211984
2014-06-28 15:56:08 +00:00
Simon Atanasyan 755d7f9c28 [Driver][Mips] Remove redundant brackets.
No functional changes.

llvm-svn: 211983
2014-06-28 15:56:03 +00:00
Simon Atanasyan 9601e6bfaa [Driver][Mips] Remove redundant abstract/override function.
No functional changes.

llvm-svn: 211982
2014-06-28 15:55:55 +00:00
Alp Toker f76e6d8e6b Get arm_acle tests from r211962 working
llvm-svn: 211979
2014-06-28 06:51:27 +00:00
Reid Kleckner 5fb5b12d48 Extend -Wdynamic-class-memaccess to records containing dynamic classes
Reviewers: rtrieu

Subscribers: cfe-commits

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

llvm-svn: 211972
2014-06-27 23:58:21 +00:00
Yi Kong a44c4d7173 Introduce arm_acle.h supporting existing LLVM builtin intrinsics
Summary: This patch introduces ACLE header file, implementing extensions that can be directly mapped to existing Clang intrinsics. It implements for both AArch32 and AArch64.

Reviewers: t.p.northover, compnerd, rengolin

Reviewed By: compnerd, rengolin

Subscribers: rnk, echristo, compnerd, aemerson, mroth, cfe-commits

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

llvm-svn: 211962
2014-06-27 21:25:42 +00:00
David Blaikie 66cc07b4f7 Remove 'const' from MemoryBuffers used through the SourceManager
This removes a const_cast added in r211884 that occurred due to an
inconsistency in how MemoryBuffers are handled between some parts of
clang and LLVM.

MemoryBuffers are immutable and the general convention in the LLVM
project is to omit const from immutable types as it's simply
redundant/verbose (see llvm::Type, for example). While this change
doesn't remove "const" from /every/ MemoryBuffer, it at least makes this
chain of ownership/usage consistent.

llvm-svn: 211915
2014-06-27 17:40:03 +00:00
Ben Langmuir f3050d2461 Add reparse test for libclang
Adapted from a reproducer by Dan Schmidt, thanks!

llvm-svn: 211910
2014-06-27 17:04:26 +00:00
Reid Kleckner c542d37995 clang-cl: Map /EHs- to -fno-exceptions
This isn't 100% compatible with MSVC, but it's close enough.  MSVC's /EH
flag doesn't really control exceptions so much as how to clean up after
an exception is thrown.  The upshot is that cl.exe /EHs- will compile
try, throw, and catch statements with a warning, but clang-cl will
reject such constructs with a hard error.  We can't compile such EH
constructs anyway, but this may matter to consumers of the AST.

Reviewers: hans

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

llvm-svn: 211909
2014-06-27 17:02:02 +00:00
David Majnemer 4632e1eec1 CodeGen: Fix a typo in getThreadLocalWrapperLinkage
The description had a misspelling.  No functionality change.

llvm-svn: 211908
2014-06-27 16:56:27 +00:00
Chandler Carruth 6666074876 Fix a bug in my previous patch by restoring the behavior that the fatal
error handler is only registered once.

To avoid the use of std::call_once (the obvious way to do this) I've
wrapped everything up into a managed static and done the work in
a constructor. Silly, but it should be effective.

Some out-of-tree libclang users reported this to me, and I've asked them
to put together a test case which exhibits this behavior, but I wanted
to fix things ASAP since the nature of the fix is straight forward.

llvm-svn: 211905
2014-06-27 16:37:27 +00:00
Chandler Carruth 37ad2582d6 This fixes libclang to cope with the now compile-time multithreaded
selection re-enabled in r211900 in LLVM.

The approach (unlike r211121) doesn't rely on std::mutex or
std::call_once to avoid breaknig cygwin bots.

llvm-svn: 211901
2014-06-27 15:14:39 +00:00
Oliver Stannard 3f32b9be7f [ARM] Fix AAPCS non-compliance caused by very large structs
This is a fix to the code in clang which inserts padding arguments to
ensure that the ARM backend can emit AAPCS-VFP compliant code. This code
needs to track the number of registers which have been allocated in order
to do this. When passing a very large struct (>64 bytes) by value, clang
emits IR which takes a pointer to the struct, but the backend converts this
back to passing the struct in registers and on the stack. The bug was that
this was being considered by clang to only use one register, meaning that
there were situations in which padding arguments were incorrectly emitted
by clang.

llvm-svn: 211898
2014-06-27 13:59:27 +00:00
Logan Chien c237a1a2e3 Replace GetProgramPath("ld") with GetLinkerPath().
llvm-svn: 211895
2014-06-27 12:37:36 +00:00
James Molloy b452f78ad2 [ARM-BE] Generate correct NEON intrinsics for big endian systems.
The NEON intrinsics in arm_neon.h are designed to work on vectors
"as-if" loaded by (V)LDR. We load vectors "as-if" (V)LD1, so the
intrinsics are currently incorrect.

This patch adds big-endian versions of the intrinsics that does the
"obvious but dumb" thing of reversing all vector inputs and all
vector outputs. This will produce extra REVs, but we trust the
optimizer to remove them.

llvm-svn: 211893
2014-06-27 11:53:35 +00:00
Alexander Kornienko 9f2a4a0ab0 Don't check clang binary name, as it can be different in some test setups.
Summary: This unbreaks our internal build after these tests were turned on in r211738.

Reviewers: chandlerc

Reviewed By: chandlerc

Subscribers: benlangmuir, cfe-commits

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

llvm-svn: 211887
2014-06-27 11:18:13 +00:00
Alexey Bataev bae9a793fd [OPENMP] Parsing and sema analysis for 'copyprivate' clause.
llvm-svn: 211886
2014-06-27 10:37:06 +00:00
Alp Toker 895a23fa2b const_cast the memory MemoryBuffer following LLVM r211883
llvm-svn: 211884
2014-06-27 09:24:27 +00:00
Justin Bogner 80effa415c Driver: Pass -ivfsoverlay to module crashdumps
When we create a crashdump involving modules, we build a VFS to
reproduce the problem with. This updates the reproduction script to
use that VFS.

llvm-svn: 211876
2014-06-27 06:35:05 +00:00
Alp Toker aa0dd5a409 Add a FIXME for an unfortunate issue in ConvertBackendLocation()
This function is copying the entire file contents into memory repeatedly and
allocating new file IDs *each time* a source location is processed.

llvm-svn: 211874
2014-06-27 06:02:00 +00:00
Saleem Abdulrasool 4b68a05f3d Driver: use GNU::Link for the Generic_GCC toolchain
This changes the behaviour of the driver for linking to match that of the
Generic_GCC::Assemble.    The default link should use "ld" rather than "gcc" for
the linker as gcc does.  This avoids the unnecessary round-tripping through gcc.
It also is much more reasonable behaviour from the user's perspective.  This
should have been updated with SVN r195554 which changed the behaviour of
Generic_GCC::Assemble.

The gcc_forward test needs to be updated to mark the fact that -march is a flag
for GCC not ld.  This was updated as a typo fix, but added a check for a flag
that is not a link flag.

The bindings test covers the change for testing, and thus no new test was added.

llvm-svn: 211866
2014-06-27 05:06:41 +00:00
Alp Toker dc2c475904 CodeGenAction: don't duplicate entire .ll/.bc files into memory
Requires supporting changes from LLVM r211861.

llvm-svn: 211862
2014-06-27 04:34:44 +00:00
Alexey Bataev 5d495ae49b [OPENMP] Added several test cases in nesting of OpenMP regions test after review from Samuel F Antao.
llvm-svn: 211857
2014-06-27 03:33:10 +00:00
Alp Toker 1d1ac112f0 Account for differences in grep implementations
llvm-svn: 211856
2014-06-27 03:11:38 +00:00
Alp Toker 830c34e269 Restore test from r211844 skipping '.file' directives
At least this answers the question of whether .bc/.ll input processed by the
frontend produces identical output to the original compilation.

llvm-svn: 211853
2014-06-27 02:59:39 +00:00
Alp Toker 8e7e1b87c6 Partially disable test from r211844
ELF assembly contains .line directives that differ based on the input filename.
Weaken the test while considering options.

llvm-svn: 211849
2014-06-27 02:35:57 +00:00
Alp Toker 1a5a520d95 Add test coverage for .bc input in the frontend
Test that we can consume LLVM bitcode and additionally check that it produces
the same output as a direct compilation.

The feature is crashy and has gone untested until now, but we might as well
provide some coverage as long as it remains in tree.

Also test LL source input in the same way because the existing tests for that
don't look convincing.

llvm-svn: 211844
2014-06-27 02:04:28 +00:00
Alp Toker aab3a8f2fb Remove .bc from test config.suffixes
This was unused. Besides, a binary file can't really contain lit ShTests.

llvm-svn: 211843
2014-06-27 02:04:21 +00:00
NAKAMURA Takumi a217a1a68b clang/test/Driver/fuse-ld.c: Really fix to match dos path.
llvm-svn: 211841
2014-06-27 01:32:59 +00:00
Anna Zaks b8de0c4278 Do not inline methods of C++ containers (coming from headers).
This silences false positives (leaks, use of uninitialized value) in simple
code that uses containers such as std::vector and std::list. The analyzer
cannot reason about the internal invariances of those data structures which
leads to false positives. Until we come up with a better solution to that
problem, let's just not inline the methods of the containers and allow objects
to escape whenever such methods are called.

This just extends an already existing flag "c++-container-inlining" and applies
the heuristic not only to constructors and destructors of the containers, but
to all of their methods.

We have a bunch of distinct user reports all related to this issue
(radar://16058651, radar://16580751, radar://16384286, radar://16795491
[PR19637]).

llvm-svn: 211832
2014-06-27 01:03:05 +00:00
Logan Chien ad86372630 Allow different path separator for windows build.
llvm-svn: 211823
2014-06-27 00:19:33 +00:00
Reid Kleckner 11c6f6165b Avoid extra back reference key lookup in msmangler
Avoid a second key lookup when the back reference key is going to be
inserted in the StringMap. The string lookups in the msmangler are the
main responsible for the huge overhead when compared to the itanium
mangler. This patch makes a small but noticeable improvement.

Reviewed by: rnk

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

Patch by Agustín Bergé!

llvm-svn: 211813
2014-06-26 22:42:18 +00:00
Fariborz Jahanian 53f867ac45 Objective-C ARC. Provide diagnostic and fix-it
when casting a retainable object to a objc_bridge_related
CF type with the suggestion of applying the method
specified in the bridging attribute to the object.
// rdar://15932435

llvm-svn: 211807
2014-06-26 21:22:16 +00:00
Justin Bogner f05a499339 Driver: Fix a misleading comment and test for what it actually did
llvm-svn: 211806
2014-06-26 20:59:39 +00:00
Justin Bogner 5aaf2e729b Driver: Remove trailing whitespace
llvm-svn: 211805
2014-06-26 20:59:36 +00:00
Hans Wennborg 1da044a4da clang-cl: Don't store the cl compiler Tool on the stack (PR20131)
The Command will refer back to the Tool as its source,
so it has to outlive the Command.

Having the Tool on the stack would cause us to crash
when using "clang-cl -GR -fallback", because if the
Command fails, Driver::ExecuteCompilation tries to
peek at the Command's source.

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

llvm-svn: 211802
2014-06-26 19:59:02 +00:00
Jim Grosbach be83cb8c96 ARM: Correctly identify cortex-m4 as v7em.
Get the predefined macro for the architecture correct.
cortex-m4: __ARM_ARCH_7EM__
cortex-m3: __ARM_ARCH_7M__
cortex-m0: __ARM_ARCH_6M__

rdar://17420090

llvm-svn: 211792
2014-06-26 17:24:16 +00:00
Zachary Turner dfa871bdd2 Add a Visualizer for VarDecl.
Reviewed by: Aaron Ballman

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

llvm-svn: 211788
2014-06-26 16:26:42 +00:00
Logan Chien 606769ecc6 Propset the executables for GetProgramPath().
llvm-svn: 211786
2014-06-26 14:38:46 +00:00
Logan Chien eb9162f0bb Implement the -fuse-ld= option.
This commit implements the -fuse-ld= option, so that the user
can specify -fuse-ld=bfd to use ld.bfd.

This commit re-applies r194328 with some test case changes.
It seems that r194328 was breaking macosx or mingw build
because clang can't find ld.bfd or ld.gold in the given sysroot.
We should use -B to specify the executable search path instead.

Patch originally by David Chisnall.

llvm-svn: 211785
2014-06-26 14:23:45 +00:00
Will Schmidt f048751912 Add ppc64/power8 as a target
llvm-svn: 211778
2014-06-26 13:34:10 +00:00
Alexey Bataev d1e40fbfe1 [OPENMP] Initial parsing and sema analysis for 'single' directive.
llvm-svn: 211774
2014-06-26 12:05:45 +00:00
Alexey Bataev 1e0498a92d [OPENMP] Initial parsing and sema analysis for 'section' directive.
llvm-svn: 211767
2014-06-26 08:21:58 +00:00
David Majnemer 07910d6ab5 Sema: Allow dllimport entities in template args for mingw
Previously dllimport variables inside of template arguments relied on
not using the C++11 codepath when -fms-compatibility was set.

While this allowed us to achieve compatibility with MSVC, it did so at
the expense of MingW.

Instead, try to use the DeclRefExpr we dig out of the template argument.
If it has the dllimport attribute, accept it and skip the C++11
null-pointer check.

llvm-svn: 211766
2014-06-26 07:48:46 +00:00
Craig Topper 7e0daca110 Convert some function arguments to use ArrayRef.
llvm-svn: 211764
2014-06-26 04:58:53 +00:00
Craig Topper 9d5583ef0a Convert StringLiteralParser constructor to use ArrayRef instead of a pointer and count.
llvm-svn: 211763
2014-06-26 04:58:39 +00:00