Skip to content

Commit

Permalink
Merge pull request #122 from AndyAyersMS/Merge-12-11-15-V2
Browse files Browse the repository at this point in the history
Merge 12 11 15 v2
  • Loading branch information
AndyAyersMS committed Dec 16, 2015
2 parents 6e26222 + 1862332 commit 1f78316
Show file tree
Hide file tree
Showing 646 changed files with 24,315 additions and 7,370 deletions.
14 changes: 13 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
Checks: '-*,clang-diagnostic-*,llvm-*,misc-*'
Checks: '-*,clang-diagnostic-*,llvm-*,misc-*,readability-identifier-naming'
CheckOptions:
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.EnumCase
value: CamelCase
- key: readability-identifier-naming.FunctionCase
value: lowerCase
- key: readability-identifier-naming.UnionCase
value: CamelCase
- key: readability-identifier-naming.VariableCase
value: CamelCase

3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ endif( LLVM_USE_INTEL_JITEVENTS )
option(LLVM_USE_OPROFILE
"Use opagent JIT interface to inform OProfile about JIT code" OFF)

option(LLVM_EXTERNALIZE_DEBUGINFO
"Generate dSYM files and strip executables and libraries (Darwin Only)" OFF)

# If enabled, verify we are on a platform that supports oprofile.
if( LLVM_USE_OPROFILE )
if( NOT CMAKE_SYSTEM_NAME MATCHES "Linux" )
Expand Down
8 changes: 4 additions & 4 deletions CODE_OWNERS.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ N: Quentin Colombet
E: [email protected]
D: Register allocators

N: Anshuman Dasgupta
E: [email protected]
D: Hexagon Backend

N: Duncan P. N. Exon Smith
E: [email protected]
D: Branch weights and BlockFrequencyInfo
Expand Down Expand Up @@ -138,6 +134,10 @@ N: Richard Osborne
E: [email protected]
D: XCore Backend

N: Krzysztof Parzyszek
E: [email protected]
D: Hexagon Backend

N: Chad Rosier
E: [email protected]
D: Fast-Isel
Expand Down
2 changes: 1 addition & 1 deletion autoconf/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ AC_DEFINE_UNQUOTED(DEFAULT_SYSROOT,"$withval",
AC_ARG_WITH(clang-default-openmp-runtime,
AS_HELP_STRING([--with-clang-default-openmp-runtime],
[The default OpenMP runtime for Clang.]),,
withval="libgomp")
withval="libomp")
AC_DEFINE_UNQUOTED(CLANG_DEFAULT_OPENMP_RUNTIME,"$withval",
[Default OpenMP runtime used by -fopenmp.])

Expand Down
37 changes: 33 additions & 4 deletions cmake/modules/AddLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,10 @@ function(llvm_add_library name)
add_dependencies(${objlib} ${LLVM_COMMON_DEPENDS})
endforeach()
endif()

if(ARG_SHARED OR ARG_MODULE)
llvm_externalize_debuginfo(${name})
endif()
endfunction()

macro(add_llvm_library name)
Expand Down Expand Up @@ -595,7 +599,7 @@ endmacro(add_llvm_loadable_module name)


macro(add_llvm_executable name)
cmake_parse_arguments(ARG "DISABLE_LLVM_LINK_LLVM_DYLIB" "" "" ${ARGN})
cmake_parse_arguments(ARG "DISABLE_LLVM_LINK_LLVM_DYLIB;IGNORE_EXTERNALIZE_DEBUGINFO" "" "" ${ARGN})
llvm_process_sources( ALL_FILES ${ARG_UNPARSED_ARGUMENTS} )

# Generate objlib
Expand Down Expand Up @@ -655,14 +659,18 @@ macro(add_llvm_executable name)
if( LLVM_COMMON_DEPENDS )
add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
endif( LLVM_COMMON_DEPENDS )

if(NOT ARG_IGNORE_EXTERNALIZE_DEBUGINFO)
llvm_externalize_debuginfo(${name})
endif()
endmacro(add_llvm_executable name)

function(export_executable_symbols target)
if (NOT MSVC) # MSVC's linker doesn't support exporting all symbols.
set_target_properties(${target} PROPERTIES ENABLE_EXPORTS 1)
if (APPLE)
set_target_properties(${target} PROPERTIES
LINK_FLAGS "-rdynamic")
set_property(TARGET ${target} APPEND_STRING PROPERTY
LINK_FLAGS " -rdynamic")
endif()
endif()
endfunction()
Expand Down Expand Up @@ -870,7 +878,7 @@ function(add_unittest test_suite test_name)

set(LLVM_REQUIRES_RTTI OFF)

add_llvm_executable(${test_name} ${ARGN})
add_llvm_executable(${test_name} IGNORE_EXTERNALIZE_DEBUGINFO ${ARGN})
set(outdir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
set_output_directory(${test_name} BINARY_DIR ${outdir} LIBRARY_DIR ${outdir})
target_link_libraries(${test_name}
Expand Down Expand Up @@ -1168,3 +1176,24 @@ function(add_llvm_tool_symlink name dest)
endif()
endif()
endfunction()

function(llvm_externalize_debuginfo name)
if(NOT LLVM_EXTERNALIZE_DEBUGINFO)
return()
endif()

if(APPLE)
if(CMAKE_CXX_FLAGS MATCHES "-flto"
OR CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE} MATCHES "-flto")

set(lto_object ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${name}-lto.o)
set_property(TARGET ${name} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,-object_path_lto,${lto_object}")
endif()
add_custom_command(TARGET ${name} POST_BUILD
COMMAND xcrun dsymutil $<TARGET_FILE:${name}>
COMMAND xcrun strip -Sl $<TARGET_FILE:${name}>)
else()
message(FATAL_ERROR "LLVM_EXTERNALIZE_DEBUGINFO isn't implemented for non-darwin platforms!")
endif()
endfunction()
11 changes: 11 additions & 0 deletions cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ if( MSVC )
-wd4204 # Suppress 'nonstandard extension used : non-constant aggregate initializer'
-wd4577 # Suppress 'noexcept used with no exception handling mode specified; termination on exception is not guaranteed'
-wd4091 # Suppress 'typedef: ignored on left of '' when no variable is declared'
# C4592 is disabled because of false positives in Visual Studio 2015
# Update 1. Re-evaluate the usefulness of this diagnostic with Update 2.
-wd4592 # Suppress ''var': symbol will be dynamically initialized (implementation limitation)

# Ideally, we'd like this warning to be enabled, but MSVC 2013 doesn't
# support the 'aligned' attribute in the way that clang sources requires (for
Expand Down Expand Up @@ -584,6 +587,14 @@ if(LLVM_ENABLE_EH AND NOT LLVM_ENABLE_RTTI)
message(FATAL_ERROR "Exception handling requires RTTI. You must set LLVM_ENABLE_RTTI to ON")
endif()

option(LLVM_BUILD_INSTRUMENTED "Build LLVM and tools with PGO instrumentation (experimental)" Off)
mark_as_advanced(LLVM_BUILD_INSTRUMENTED)
append_if(LLVM_BUILD_INSTRUMENTED "-fprofile-instr-generate"
CMAKE_CXX_FLAGS
CMAKE_C_FLAGS
CMAKE_EXE_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS)

# Plugin support
# FIXME: Make this configurable.
if(WIN32 OR CYGWIN)
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/LLVMExternalProjectUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function(llvm_ExternalProject_Add name source_dir)
if(variableName MATCHES "^${nameCanon}")
string(REPLACE ";" "\;" value "${${variableName}}")
list(APPEND PASSTHROUGH_VARIABLES
-D${variableName}=${${value}})
-D${variableName}=${value})
endif()
endforeach()

Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -5954,7 +5954,7 @@ _ACEOF
if test "${with_clang_default_openmp_runtime+set}" = set; then
withval=$with_clang_default_openmp_runtime;
else
withval="libgomp"
withval="libomp"
fi


Expand Down
1 change: 1 addition & 0 deletions docs/BitCodeFormat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@ function. The operand fields are:
* ``anyregcc``: code 13
* ``preserve_mostcc``: code 14
* ``preserve_allcc``: code 15
* ``cxx_fast_tlscc``: code 17
* ``x86_stdcallcc``: code 64
* ``x86_fastcallcc``: code 65
* ``arm_apcscc``: code 66
Expand Down
6 changes: 4 additions & 2 deletions docs/CompilerWriterInfo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ ARM

* `ABI Addenda and Errata <http://infocenter.arm.com/help/topic/com.arm.doc.ihi0045d/IHI0045D_ABI_addenda.pdf>`_

* `ARM C Language Extensions <http://infocenter.arm.com/help/topic/com.arm.doc.ihi0053a/IHI0053A_acle.pdf>`_
* `ARM C Language Extensions <http://infocenter.arm.com/help/topic/com.arm.doc.ihi0053c/IHI0053C_acle_2_0.pdf>`_

AArch64
-------

* `ARMv8 Architecture Reference Manual <http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0487a.h/index.html>`_

* `ARMv8 Instruction Set Overview <http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.genc010197a/index.html>`_

* `ARM C Language Extensions <http://infocenter.arm.com/help/topic/com.arm.doc.ihi0053a/IHI0053A_acle.pdf>`_
* `ARM C Language Extensions <http://infocenter.arm.com/help/topic/com.arm.doc.ihi0053c/IHI0053C_acle_2_0.pdf>`_

Itanium (ia64)
--------------
Expand Down
27 changes: 27 additions & 0 deletions docs/DeveloperPolicy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,33 @@ for llvm users and not imposing a big burden on llvm developers:
it is to drop it. That is not very user friendly and a bit more effort is
expected, but no promises are made.

C API Changes
----------------

* Stability Guarantees: The C API is, in general, a "best effort" for stability.
This means that we make every attempt to keep the C API stable, but that
stability will be limited by the abstractness of the interface and the
stability of the C++ API that it wraps. In practice, this means that things
like "create debug info" or "create this type of instruction" are likely to be
less stable than "take this IR file and JIT it for my current machine".

* Release stability: We won't break the C API on the release branch with patches
that go on that branch, with the exception that we will fix an unintentional
C API break that will keep the release consistent with both the previous and
next release.

* Testing: Patches to the C API are expected to come with tests just like any
other patch.

* Including new things into the API: If an LLVM subcomponent has a C API already
included, then expanding that C API is acceptable. Adding C API for
subcomponents that don't currently have one needs to be discussed on the
mailing list for design and maintainability feedback prior to implementation.

* Documentation: Any changes to the C API are required to be documented in the
release notes so that it's clear to external users who do not follow the
project how the C API is changing and evolving.

.. _copyright-license-patents:

Copyright, License, and Patents
Expand Down
19 changes: 16 additions & 3 deletions docs/GettingStarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ Here's the short story for getting up and running quickly with LLVM:
* ``cd llvm/projects``
* ``svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt``

#. Checkout Libomp (required for OpenMP support):

* ``cd where-you-want-llvm-to-live``
* ``cd llvm/projects``
* ``svn co http://llvm.org/svn/llvm-project/openmp/trunk openmp``

#. Checkout libcxx and libcxxabi **[Optional]**:

* ``cd where-you-want-llvm-to-live``
Expand Down Expand Up @@ -535,6 +541,13 @@ If you want to check out compiler-rt (required to build the sanitizers), run:
% cd llvm/projects
% git clone http://llvm.org/git/compiler-rt.git
If you want to check out libomp (required for OpenMP support), run:

.. code-block:: console
% cd llvm/projects
% git clone http://llvm.org/git/openmp.git
If you want to check out libcxx and libcxxabi (optional), run:

.. code-block:: console
Expand Down Expand Up @@ -634,7 +647,7 @@ To set up clone from which you can submit code using ``git-svn``, run:
% git config svn-remote.svn.fetch :refs/remotes/origin/master
% git svn rebase -l
Likewise for compiler-rt and test-suite.
Likewise for compiler-rt, libomp and test-suite.

To update this clone without generating git-svn tags that conflict with the
upstream Git repo, run:
Expand All @@ -648,7 +661,7 @@ upstream Git repo, run:
git checkout master &&
git svn rebase -l)
Likewise for compiler-rt and test-suite.
Likewise for compiler-rt, libomp and test-suite.

This leaves your working directories on their master branches, so you'll need to
``checkout`` each working branch individually and ``rebase`` it on top of its
Expand Down Expand Up @@ -853,7 +866,7 @@ with the latest Xcode:

.. code-block:: console
% cmake -G "Ninja" -DCMAKE_OSX_ARCHITECTURES=armv7;armv7s;arm64"
% cmake -G "Ninja" -DCMAKE_OSX_ARCHITECTURES="armv7;armv7s;arm64"
-DCMAKE_TOOLCHAIN_FILE=<PATH_TO_LLVM>/cmake/platforms/iOS.cmake
-DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_RUNTIME=Off -DLLVM_INCLUDE_TESTS=Off
-DLLVM_INCLUDE_EXAMPLES=Off -DLLVM_ENABLE_BACKTRACES=Off [options]
Expand Down
54 changes: 50 additions & 4 deletions docs/LangRef.rst
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,26 @@ added in the future:
This calling convention, like the `PreserveMost` calling convention, will be
used by a future version of the ObjectiveC runtime and should be considered
experimental at this time.
"``cxx_fast_tlscc``" - The `CXX_FAST_TLS` calling convention for access functions
Clang generates an access function to access C++-style TLS. The access
function generally has an entry block, an exit block and an initialization
block that is run at the first time. The entry and exit blocks can access
a few TLS IR variables, each access will be lowered to a platform-specific
sequence.

This calling convention aims to minimize overhead in the caller by
preserving as many registers as possible (all the registers that are
perserved on the fast path, composed of the entry and exit blocks).

This calling convention behaves identical to the `C` calling convention on
how arguments and return values are passed, but it uses a different set of
caller/callee-saved registers.

Given that each platform has its own lowering sequence, hence its own set
of preserved registers, we can't use the existing `PreserveMost`.

- On X86-64 the callee preserves all general purpose registers, except for
RDI and RAX.
"``cc <n>``" - Numbered convention
Any calling convention may be specified by number, allowing
target-specific calling conventions to be used. Target specific
Expand Down Expand Up @@ -3731,9 +3751,9 @@ DICompileUnit
"""""""""""""

``DICompileUnit`` nodes represent a compile unit. The ``enums:``,
``retainedTypes:``, ``subprograms:``, ``globals:`` and ``imports:`` fields are
tuples containing the debug info to be emitted along with the compile unit,
regardless of code optimizations (some nodes are only emitted if there are
``retainedTypes:``, ``subprograms:``, ``globals:``, ``imports:`` and ``macros:``
fields are tuples containing the debug info to be emitted along with the compile
unit, regardless of code optimizations (some nodes are only emitted if there are
references to them from instructions).

.. code-block:: llvm
Expand All @@ -3742,7 +3762,7 @@ references to them from instructions).
isOptimized: true, flags: "-O2", runtimeVersion: 2,
splitDebugFilename: "abc.debug", emissionKind: 1,
enums: !2, retainedTypes: !3, subprograms: !4,
globals: !5, imports: !6)
globals: !5, imports: !6, macros: !7, dwoId: 0x0abcd)
Compile unit descriptors provide the root scope for objects declared in a
specific compilation unit. File descriptors are defined using this scope.
Expand Down Expand Up @@ -4108,6 +4128,32 @@ compile unit.
!2 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "foo", scope: !0,
entity: !1, line: 7)
DIMacro
"""""""

``DIMacro`` nodes represent definition or undefinition of a macro identifiers.
The ``name:`` field is the macro identifier, followed by macro parameters when
definining a function-like macro, and the ``value`` field is the token-string
used to expand the macro identifier.

.. code-block:: llvm
!2 = !DIMacro(macinfo: DW_MACINFO_define, line: 7, name: "foo(x)",
value: "((x) + 1)")
!3 = !DIMacro(macinfo: DW_MACINFO_undef, line: 30, name: "foo")
DIMacroFile
"""""""""""

``DIMacroFile`` nodes represent inclusion of source files.
The ``nodes:`` field is a list of ``DIMacro`` and ``DIMacroFile`` nodes that
appear in the included source file.

.. code-block:: llvm
!2 = !DIMacroFile(macinfo: DW_MACINFO_start_file, line: 7, file: !2,
nodes: !3)
'``tbaa``' Metadata
^^^^^^^^^^^^^^^^^^^

Expand Down
2 changes: 2 additions & 0 deletions docs/LibFuzzer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,8 @@ Trophies

* `Python <http://bugs.python.org/issue25388>`_

* OpenSSL/BoringSSL: `[1] <https://boringssl.googlesource.com/boringssl/+/cb852981cd61733a7a1ae4fd8755b7ff950e857d>`_

* `Libxml2
<https://bugzilla.gnome.org/buglist.cgi?bug_status=__all__&content=libFuzzer&list_id=68957&order=Importance&product=libxml2&query_format=specific>`_

Expand Down
2 changes: 1 addition & 1 deletion docs/ReleaseProcess.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ test-release.sh
---------------

This script will check-out, configure and compile LLVM+Clang (+ most add-ons, like ``compiler-rt``,
``libcxx`` and ``clang-extra-tools``) in three stages, and will test the final stage.
``libcxx``, ``libomp`` and ``clang-extra-tools``) in three stages, and will test the final stage.
It'll have installed the final binaries on the Phase3/Releasei(+Asserts) directory, and
that's the one you should use for the test-suite and other external tests.

Expand Down
2 changes: 1 addition & 1 deletion examples/Kaleidoscope/Orc/fully_lazy/toy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ class KaleidoscopeJIT {

std::map<std::string, std::unique_ptr<FunctionAST>> FunctionDefs;

JITCompileCallbackManager<OrcX86_64> CompileCallbacks;
LocalJITCompileCallbackManager<OrcX86_64> CompileCallbacks;
};

static void HandleDefinition(SessionContext &S, KaleidoscopeJIT &J) {
Expand Down
Loading

0 comments on commit 1f78316

Please sign in to comment.