Commit Graph

167980 Commits

Author SHA1 Message Date
NAKAMURA Takumi 959c64bb76 [CMake] libclang: Use llvm_add_library(SHARED STATIC).
llvm-svn: 201862
2014-02-21 15:34:01 +00:00
Kostya Serebryany 0548c79859 [tsan] add coarse-grained lock around the DeadlockDetector. We can do better than that, but that's a start.
llvm-svn: 201861
2014-02-21 15:07:18 +00:00
Tobias Grosser 030237d0ff Codegen: Do not crash when seeing debug intrinsics
We now skip the debug intrinsics which is a lot better than crashing due to
uncopied metadata references. We should step by step investigate which debug
intrinsics we can copy without trouble.

We still keep the debug location metadata.

llvm-svn: 201860
2014-02-21 15:06:05 +00:00
NAKAMURA Takumi 9a51148cb5 [CMake] llvm-c/lto.h should be installed if libLTO.a is built.
llvm-svn: 201859
2014-02-21 14:57:09 +00:00
Aaron Ballman 0da8515910 Internal naming convention consistency change.
llvm-svn: 201858
2014-02-21 14:37:41 +00:00
Aaron Ballman 5ee46d2a9e Moving the documentation for the format attribute into AttrDocs.
llvm-svn: 201857
2014-02-21 14:36:13 +00:00
NAKAMURA Takumi 2fa24cc356 [CMake] libLTO: Use (SHARED|STATIC) to build both shared LTO and LTO_static.
llvm-svn: 201856
2014-02-21 14:17:43 +00:00
NAKAMURA Takumi 679e772dfe [CMake] llvm_add_library: Add dependencies also to objlibs as workaround of CMake issue 14747.
http://www.cmake.org/Bug/view.php?id=14747

llvm-svn: 201855
2014-02-21 14:17:29 +00:00
NAKAMURA Takumi e3408ab565 [CMake] Introduce "llvm_add_library(SHARED STATIC)" to build both shared lib and static lib simulataneously.
llvm_add_library(foo SHARED STATIC
    DEPENDS <dependent targets...>
    LINK_LIBS <required libraries...>
    )

It generates both foo (foo.so) and foo_static(foo.a) and both of them depend on DEPENDS and LINK_LIBS.
Then, also obj.foo is generated. obj.foo depends on DEPENDS, but doesn't depend on LINK_LIBS.

llvm-svn: 201854
2014-02-21 14:17:17 +00:00
NAKAMURA Takumi 12fedb0efd Teach LLVM-Config to use logical target names (2/2)
The module still needs to collect the list of all available libraries
in order to satisfy the 'all' component.  Provide this in the package
configuration file, 'LLVMConfig.cmake', as a LLVM_AVAILABLE_LIBS
variable.  (A variable is scoped better than a global property.)
Since this won't be set for our own build, fall back to looking up the
LLVM_LIBS property to get the value when it is not set.

Contributed by Brad King.

llvm-svn: 201853
2014-02-21 14:17:07 +00:00
NAKAMURA Takumi 1956c49a95 Teach LLVM-Config to use logical target names (1/2)
LLVM library names are now available as logical CMake targets both
to our own build and to application CMake code.  Replace use of
'list(FIND)' with a simple 'if(TARGET)' to determine whether a
library is available.

Contributed by Brad King.

llvm-svn: 201852
2014-02-21 14:16:52 +00:00
Aaron Ballman ea6668c4e8 Moving the documentation for the type safety checking attributes into AttrDocs. If a custom heading is provided, do not automatically generate the alternate spelling list. This is necessary because some attributes have distinct semantic spellings and meanings, but use the same semantic attribute internally. Such attributes should have multiple elements in their documentation list, but not show all spellings. At some point, it would be nice to have a way to attach the documentation element to a specific spelling for these cases.
llvm-svn: 201851
2014-02-21 14:14:04 +00:00
Aaron Ballman 7803b888c4 Moving the documentation for the sanitizer negation attributes into AttrDocs.
llvm-svn: 201850
2014-02-21 13:44:43 +00:00
Tim Northover a0c95eb2d6 Remove commas at the end of lists (C++11 again)
llvm-svn: 201849
2014-02-21 12:16:59 +00:00
Tim Northover 8fe03d6111 ARM & AArch64: use table for EmitCommonNeonBuiltinExpr
This extends the intrinsic lookup table format slightly, and adds
entries for use the shared ARM/AArch64 definitions. The benefit is
currently smaller than for the SISD intrinsics (there's more custom
code implementing this set), but a few lines are saved and there's
scope for future expansion.

llvm-svn: 201848
2014-02-21 11:57:24 +00:00
Tim Northover 2d83796860 AArch64: refactor table-driven NEON lookup.
This extracts the table-driven intrinsic lookup phase into a separate
function, to be used by EmitCommonNeonBuiltinExpr soon.

It also simplifies the logic used in that lookup, since VectorCastArgN
and ScalarArgN were actually identical.

llvm-svn: 201847
2014-02-21 11:57:20 +00:00
Oliver Stannard 96601cad2f Add support for FPv4-SP to the clang driver
Added two new options for -mfpu when targetting ARM:
* fpv4-sp-d16
* fp4-sp-d16

The first is the same spelling as gcc.

The lack of a leading `v' is correct, this is consistent with ARM's
documentation and gcc's spelling of the option.

llvm-svn: 201846
2014-02-21 10:39:15 +00:00
Tim Northover 23a2fb59b6 Darwin: use the compiler-provided linker
When actually compiling we use clang for the final .dylib creation stage, so we
should ask it what linker it'll use when detecting support for our
architectures.

llvm-svn: 201845
2014-02-21 10:19:22 +00:00
Yaron Keren 7b89f9958f Solve the errors
Error 1 error C2681: 'add_rvalue_reference<_Tp*>::type' : invalid expression
type for dynamic_cast c:\libcxx\include\type_traits

This is one more step getting libcxx compile under Visual C++. The patch is 
#if defined(_LIBCPP_MSVC) so will affect only this build.

When libcxx can be compiled, it will probably require the current version or
maybe even the next Update of Visual C++ 2013.

Patch by G M!

llvm-svn: 201844
2014-02-21 10:00:31 +00:00
Chandler Carruth 265b83a87f Teach libc++ to use the compiler-provided C-compatible ::max_align_t
rather than its own type for std::max_align_t. This is particularly
relevant as the types may not be ABI compatible despite users expecting
them to be.

llvm-svn: 201843
2014-02-21 08:37:30 +00:00
NAKAMURA Takumi 7da9487dd4 [CMake] Get rid of explicit dependencies to include/clang/*.inc and introduce CLANG_TABLEGEN_TARGETS.
This does;
  - clang_tablegen() adds each tblgen'd target to global property CLANG_TABLEGEN_TARGETS as list.
  - List of targets is added to LLVM_COMMON_DEPENDS.
  - all clang libraries and targets depend on generated headers.

You might wonder this would be regression, but in fact, this is little loss.
  - Almost all of clang libraries depend on tblgen'd files and clang-tblgen.
  - clang-tblgen may cause short stall-out but doesn't cause unconditional rebuild.
  - Each library's dependencies to tblgen'd files might vary along headers' structure.
    It made hard to track and update *really optimal* dependencies.

Each dependency to intrinsics_gen and ClangSACheckers is left as DEPENDS.

llvm-svn: 201842
2014-02-21 07:59:59 +00:00
Kevin Qin 07334d37de [AArch64] Add register constraints to avoid generating STLXR and STXR with unpredictable behavior.
llvm-svn: 201841
2014-02-21 07:45:48 +00:00
Patrik Hagglund ab01d4bb14 Fix gcc -Wparentheses warning.
llvm-svn: 201840
2014-02-21 07:23:53 +00:00
Jason Molenda 31d7ad4ecf Add a new idea of a "fallback" UnwindPlan to the RegisterContextLLDB
class.  If we try to unwind a stack frame to find a caller stack
frame, and we fail to get a valid-looking frame, AND if the UnwindPlan
we used is an assembly-inspection based UnwindPlan, then we should 
throw away the assembly-inspection UnwindPlan and try unwinding with 
the architectural default UnwindPlan.  

This code path won't be taken if eh_frame unwind instructions are available -
lldb will always prefer those once it's off the zeroth frame.

The problem I'm trying to fix here is the class of unwind failures that
happen when we have hand-written assembly on the stack, with no eh_frame,
and lldb's assembly parser fails to understand the assembly.  People usually
write their hand-written assembly to follow the frame-pointer-preserving
conventions of the platform so the architectural default UnwindPlan will 
often work.  We won't have the spill location for most of the non-volatile
registers if we fall back to this, but it's better than stopping the unwind
prematurely.

This is a bit of a tricky change that I believe is correct, but if we get
unwinds that go of into the weeds / unwind bogus frames at the end of the
stack, I'll need to revisit it.

<rdar://problem/16099440> 

llvm-svn: 201839
2014-02-21 05:20:25 +00:00
Filip Pizlo d57124455b This test was failing on non-X86-64 platforms because stackmaps only work on X86-64.
Disable it on non-X86-64 platforms and add a comment.

llvm-svn: 201838
2014-02-21 03:17:31 +00:00
Rafael Espindola 33ebd2171e Accept -no-integrated-as in -cc1 and forward it to llvm.
llvm-svn: 201837
2014-02-21 03:14:07 +00:00
Rafael Espindola 48fa6ed153 Make DisableIntegratedAS a TargetOption.
This replaces the old NoIntegratedAssembler with at TargetOption. This is
more flexible and will be used to forward clang's -no-integrated-as option.

llvm-svn: 201836
2014-02-21 03:13:54 +00:00
Reid Kleckner e4a5220d7c MS ABI: Include the vfptr offset in memptrs to virtual methods
Virtual methods expect 'this' to point to the vfptr containing the
virtual method, and this extends to virtual member pointer thunks.  The
relevant vfptr is always at offset zero on entry to the thunk, and no
this adjustment is needed.

Previously we would not include the vfptr adjustment in the member
pointer, and we'd look at the vfptr offset when loading from the vftable
in the thunk.

Fixes PR18917.

llvm-svn: 201835
2014-02-21 02:27:32 +00:00
Rafael Espindola f193902918 One last pass of DataLayout variable renaming.
llvm-svn: 201834
2014-02-21 02:01:42 +00:00
Rafael Espindola 612886fc8c Rename a few more DataLayout variables.
llvm-svn: 201833
2014-02-21 01:53:35 +00:00
Warren Hunt f6ec74826e [MS-ABI] Update to zero-sized padding algorithm
Slight change to the way zero-sized sub-objects are tracked in the 
presence of virtual bases.
In addition we correctly distinguish between dsize and nvsize.
addresses http://llvm.org/bugs/show_bug.cgi?id=18826
Unit tests are included.

llvm-svn: 201832
2014-02-21 01:40:35 +00:00
Jim Ingham 90331d5cf4 There’s no need to call posix_spawnp_setbinpref_np when we are launching in the shell. That only sets the architecture of the shell, we use “arch —arch” to actually pick the binary we actually want to launch’s architecture.
<rdar://problem/16103187>

llvm-svn: 201831
2014-02-21 01:25:21 +00:00
Bob Wilson f8cf1611e3 Fix an assertion failure when invoking dsymutil.
There is no bound architecture for the dsymutil action in the driver. Trying
to check various properties of the target will cause an assertion failure
because the target doesn't get initialized without a bound architecture.
<rdar://problem/16111555>

llvm-svn: 201830
2014-02-21 00:20:07 +00:00
Jordan Rose 45d71a2715 [analyzer] Fix a bug in IdenticalExprChecker concerning while loops.
Somehow both Daniel and I missed the fact that while loops are only identical
if they have identical bodies.

Patch by Daniel Fahlgren!

llvm-svn: 201829
2014-02-21 00:18:31 +00:00
Adrian Prantl 75c4779943 Add a fallback path for buildbots temporarily stuck on really old
versions of LLDB.

llvm-svn: 201828
2014-02-21 00:17:02 +00:00
Rafael Espindola 37dc9e19f5 Rename many DataLayout variables from TD to DL.
I am really sorry for the noise, but the current state where some parts of the
code use TD (from the old name: TargetData) and other parts use DL makes it
hard to write a patch that changes where those variables come from and how
they are passed along.

llvm-svn: 201827
2014-02-21 00:06:31 +00:00
Filip Pizlo c95bd8d88f Stackmaps are used for OSR exits, which is a custom kind of unwinding. Hence, they
should not be marked nounwind.

Marking them nounwind caused crashes in the WebKit FTL JIT, because if we enable 
sufficient optimizations, LLVM starts eliding compact_unwind sections (or any unwind 
data for that matter), making deoptimization via stackmaps impossible.

This changes the stackmap intrinsic to be may-throw, adds a test for exactly the 
sympton that WebKit saw, and fixes TableGen to handle un-attributed intrinsics.

Thanks to atrick and philipreames for reviewing this.

llvm-svn: 201826
2014-02-20 23:57:31 +00:00
Reid Kleckner 71966c99a5 Revert the removal of PPCallbacks::PragmaComment() in r201821
The pp-trace clang tool was using it successfully.  We can still delete
the callbacks in Frontend/PrintPreprocessedOutput.cpp because they were
effectively dead.

llvm-svn: 201825
2014-02-20 23:37:45 +00:00
David Majnemer 2b0d66df24 Sema: Do not assert when dereferencing member pointer using virtual inheritance with an incomplete class type
The MS ABI requires that we determine the vbptr offset if have a
virtual inheritance model.  Instead, raise an error pointing to the
diagnostic when this happens.

This fixes PR18583.

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

llvm-svn: 201824
2014-02-20 23:22:07 +00:00
Reid Kleckner af1465cef5 Revert "Enable MSRecordLayout in the presence of external sources."
This reverts commit r201810.

It was failing these tests on my workstation:
    Clang :: CodeGen/override-layout.c
    Clang :: CodeGenCXX/override-layout.cpp
    Clang :: PCH/check-deserializations.cpp

llvm-svn: 201823
2014-02-20 23:07:29 +00:00
Nick Lewycky 75080ff25d Make sure that value handle users see the transformation of an indirect call to a direct call. This is important for the CallGraph iteration. Patch by Björn Steinbrink!
llvm-svn: 201822
2014-02-20 23:00:15 +00:00
Reid Kleckner 0e73ec4550 Expand macros in pragmas with -fms-extensions and -E
gcc never expands macros in pragmas and MSVC always expands macros
before processing pragmas.  Clang usually allows macro expansion, except
in a handful of pragmas, most of which are handled by the lexer.

Also remove PPCallbacks for pragmas that are currently handled in the
parser.  Without a Parser, such as with clang -E, these callbacks would
never be called.

Fixes PR18576.

llvm-svn: 201821
2014-02-20 22:59:51 +00:00
Reid Kleckner 5b0864695b Hide pragma handler classes in ParsePragma.cpp
This reduces the number of files we need to touch to add a new pragma,
and reduces the number of externally visible symbols in clang.

Make the handlers structs instead of classes because the vast majority
have no private members.

Reviewers: rsmith

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

llvm-svn: 201820
2014-02-20 22:52:09 +00:00
Eli Bendersky 7da92ed879 Set the SuppressWarnings option on tool level and propagate to the library.
The SuppressWarnings flag, unfortunately, isn't very useful for custom tools
that want to use the LLVM module linker. So I'm changing it to a parameter of
the Linker, and the flag itself moves to the llvm-link tool.

For the time being as SuppressWarnings is pretty much the only "option" it
seems reasonable to propagate it to Linker objects. If we end up with more
options in the future, some sort of "struct collecting options" may be a
better idea.

llvm-svn: 201819
2014-02-20 22:19:24 +00:00
Ben Langmuir c8130a74f4 Recommit virtual file system
Previously reverted in r201755 due to causing an assertion failure.

I've removed the offending assertion, and taught the CompilerInstance to
create a default virtual file system inside createFileManager. In the
future, we should be able to reach into the CompilerInvocation to
customize this behaviour without breaking clients that don't care.

llvm-svn: 201818
2014-02-20 21:59:23 +00:00
Tobias Grosser 37eb422f69 Add polyhedral dead code elimination.
This pass eliminates loop iterations that compute results that are not used
later on. This can help e.g. in D, where the default zero-initialization is
often unnecessary if right after new values are assigned to an array.

Contributed-by: Peter Conn <conn.peter@gmail.com>
llvm-svn: 201817
2014-02-20 21:43:54 +00:00
Tobias Grosser 3fc9154c40 Fix formatting
llvm-svn: 201816
2014-02-20 21:43:45 +00:00
Tobias Grosser d6aafa7c2e Do not track location of scalar dependences in ScopInfo
We do not have a use for this information at the moment. If we need this at some
point, the "instruction -> access" mapping needs to be enhanced as a single
instruction could then possibly perform multiple accesses.

This patch allows us to build the polyhedral information for scops with scalar
dependences.

llvm-svn: 201815
2014-02-20 21:29:09 +00:00
Tobias Grosser 612c2bc071 Fix typo
llvm-svn: 201814
2014-02-20 21:29:02 +00:00
Benjamin Kramer 28cdfd3be6 cstdint is a C++11 header, LLVM provides its own version of it.
Some versions of libstdc++ forbid using cstdint in C++98 mode.

llvm-svn: 201812
2014-02-20 21:05:21 +00:00