Skip to content
This repository was archived by the owner on Feb 26, 2019. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang-nursery/clang
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d0fc1788123de9844c8088b977cd142021cea1f2
Choose a base ref
...
head repository: rust-lang-nursery/clang
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 032312dd0140a7074c9b89d305fe44eb0e44e407
Choose a head ref

Commits on Aug 28, 2018

  1. Parse compile commands lazily in InterpolatingCompilationDatabase

    Summary:
    This greatly reduces the time to read 'compile_commands.json'.
    For Chromium on my machine it's now 0.7 seconds vs 30 seconds before the
    change.
    
    Reviewers: sammccall, jfb
    
    Reviewed By: sammccall
    
    Subscribers: mgrang, jfb, cfe-commits
    
    Differential Revision: https://reviews.llvm.org/D51314
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340838 91177308-0d34-0410-b5e6-96231b3b80d8
    ilya-biryukov committed Aug 28, 2018
    Copy the full SHA
    b55f3a1 View commit details
  2. [Driver] Delete last reference of lld -flavor old-gnu

    This is dead code because lld -flavor old-gnu was removed in 2016 by rLLD262158.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340845 91177308-0d34-0410-b5e6-96231b3b80d8
    MaskRay committed Aug 28, 2018
    Copy the full SHA
    52da607 View commit details
  3. [ubsan] Enable -fsanitize=vptr on Apple devices and simulators

    It seems like an oversight that this check was not always enabled for
    on-device or device simulator targets.
    
    Differential Revision: https://reviews.llvm.org/D51239
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340849 91177308-0d34-0410-b5e6-96231b3b80d8
    vedantk committed Aug 28, 2018
    Copy the full SHA
    76b0fc1 View commit details
  4. Define variables in test case rather than using values from functions

    emitted ealier.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340854 91177308-0d34-0410-b5e6-96231b3b80d8
    ahatanaka committed Aug 28, 2018
    Copy the full SHA
    5238fd6 View commit details
  5. [libFuzzer] Port to Windows

    Summary:
    Port libFuzzer to windows-msvc.
    This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well.
    It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch.
    It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them.
    
    Patch By: metzman
    
    Reviewers: morehouse, rnk
    
    Reviewed By: morehouse, rnk
    
    Subscribers: morehouse, kcc, eraman
    
    Differential Revision: https://reviews.llvm.org/D51022
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340860 91177308-0d34-0410-b5e6-96231b3b80d8
    morehouse committed Aug 28, 2018
    Copy the full SHA
    cbe85b3 View commit details
  6. Revert "[libFuzzer] Port to Windows"

    This reverts commit r340860 due to failing tests.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340867 91177308-0d34-0410-b5e6-96231b3b80d8
    morehouse committed Aug 28, 2018
    Copy the full SHA
    0d9b892 View commit details
  7. [HIP] Fix output file extension

    OffloadBundlingJobAction constructor accepts a list of JobAction as inputs.
    The host JobAction is the last one. The file type of OffloadBundlingJobAction
    should be determined by the host JobAction (the last one) instead of the first
    one.
    
    Since HIP emits LLVM bitcode for device compilation, device JobAction has
    different file type as host Job Action. This bug causes incorrect output file
    extension for HIP.
    
    This patch fixes it by using the last input JobAction (host JobAction) to determine
    file type of OffloadBundlingJobAction.
    
    Differential Revision: https://reviews.llvm.org/D51336
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340873 91177308-0d34-0410-b5e6-96231b3b80d8
    yxsamliu committed Aug 28, 2018
    Copy the full SHA
    bc0fa1d View commit details
  8. [X86] Add kadd intrinsics to match gcc and icc.

    This adds the following intrinsics:
    _kadd_mask64
    _kadd_mask32
    _kadd_mask16
    _kadd_mask8
    
    These are missing from the Intel Intrinsics Guide, but are implemented by both gcc and icc.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340879 91177308-0d34-0410-b5e6-96231b3b80d8
    topperc committed Aug 28, 2018
    Copy the full SHA
    1d39f2e View commit details

Commits on Aug 29, 2018

  1. Start reserving x18 by default on Android targets.

    Differential Revision: https://reviews.llvm.org/D45588
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340889 91177308-0d34-0410-b5e6-96231b3b80d8
    pcc committed Aug 29, 2018
    Copy the full SHA
    7324e18 View commit details
  2. [ARM] Set __ARM_FEATURE_SIMD32 for +dsp cores

    ARM_FEATURE_DSP is already set for targets with the +dsp feature. In
    the backend, this target feature is also used to represent the
    availability of the of the instructions that the ACLE guard through
    the __ARM_FEATURE_SIMD32 macro. We don't have any cores that
    implement one and not the other, so set this macro for cores later
    than V6 or for Cortex-M cores that the target parser, or user, reports
    that the 'dsp' instructions are supported.
    
    Differential Revision: https://reviews.llvm.org/D51093
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340911 91177308-0d34-0410-b5e6-96231b3b80d8
    sparker-arm committed Aug 29, 2018
    Copy the full SHA
    17172e0 View commit details
  3. [Preamble] Fix incorrect usage of std::error_category

    Differential Revision: https://reviews.llvm.org/D51380
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340929 91177308-0d34-0410-b5e6-96231b3b80d8
    aganea committed Aug 29, 2018
    Copy the full SHA
    927ea8c View commit details
  4. [OPENMP] Create non-const ident_t objects.

    Currently ident_t objects are created const when debug info is not
    enabled, but the libittnotify libray in the OpenMP runtime writes to
    the reserved_2 field (See __kmp_itt_region_forking in
    openmp/runtime/src/kmp_itt.inl).  Now create ident_t objects non-const.
    
    Differential Revision: https://reviews.llvm.org/D51331
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340934 91177308-0d34-0410-b5e6-96231b3b80d8
    mikerice1969 committed Aug 29, 2018
    Copy the full SHA
    f7e11f2 View commit details
  5. [Tooling] Do not restore working dir in ClangTool

    Summary:
    Resolve all relative paths before running the tool instead.
    
    This fixes the usage of ClangTool in AllTUsExecutor. The executor will
    try running multiple ClangTool instances in parallel with compile
    commands that usually have the same working directory.
    
    Changing working directory is a global operation, so we end up
    changing working directory in the middle of running other actions,
    which leads to spurious compile errors.
    
    Reviewers: ioeric, sammccall
    
    Reviewed By: ioeric
    
    Subscribers: cfe-commits
    
    Differential Revision: https://reviews.llvm.org/D51407
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340937 91177308-0d34-0410-b5e6-96231b3b80d8
    ilya-biryukov committed Aug 29, 2018
    Copy the full SHA
    6509b6d View commit details
  6. [MinGW] Don't mark external variables as DSO local

    Since MinGW supports automatically importing external variables from
    DLLs even without the DLLImport attribute, we shouldn't mark them
    as DSO local unless we actually know them to be local for sure.
    
    Keep marking thread local variables as DSO local.
    
    Differential Revision: https://reviews.llvm.org/D51382
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340941 91177308-0d34-0410-b5e6-96231b3b80d8
    mstorsjo committed Aug 29, 2018
    Copy the full SHA
    c510fac View commit details
  7. [libFuzzer] Port to Windows

    Summary:
    Port libFuzzer to windows-msvc.
    This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well.
    It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch.
    It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them.
    
    Reviewers: morehouse, rnk
    
    Reviewed By: morehouse, rnk
    
    Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman
    
    Differential Revision: https://reviews.llvm.org/D51022
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340949 91177308-0d34-0410-b5e6-96231b3b80d8
    morehouse committed Aug 29, 2018
    Copy the full SHA
    f4fb4ed View commit details
  8. [OPENMP][NVPTX] Add support for lightweight runtime.

    If the target construct can be executed in SPMD mode + it is a loop
    based directive with static scheduling, we can use lightweight runtime
    support.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340953 91177308-0d34-0410-b5e6-96231b3b80d8
    alexey-bataev committed Aug 29, 2018
    Copy the full SHA
    d9c61e0 View commit details
  9. Revert "[libFuzzer] Port to Windows"

    This reverts r340949 due to bot breakage again.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340954 91177308-0d34-0410-b5e6-96231b3b80d8
    morehouse committed Aug 29, 2018
    Copy the full SHA
    dc879fa View commit details
  10. [analyzer] [NFC] Follow the convention when naming classes

    Renames InvalidateRegionsWorker and RemoveDeadBindingsWorker
    
    Differential Revision: https://reviews.llvm.org/D51324
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340960 91177308-0d34-0410-b5e6-96231b3b80d8
    George Karpenkov committed Aug 29, 2018
    Copy the full SHA
    01c0d17 View commit details
  11. [analyzer] Better retain count rules for OSObjects

    Differential Revision: https://reviews.llvm.org/D51184
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340961 91177308-0d34-0410-b5e6-96231b3b80d8
    George Karpenkov committed Aug 29, 2018
    Copy the full SHA
    9af55c6 View commit details
  12. [analyzer] [NFC] Remove unused "state" argument from makeSymExprValNN

    Differential Revision: https://reviews.llvm.org/D51250
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340962 91177308-0d34-0410-b5e6-96231b3b80d8
    George Karpenkov committed Aug 29, 2018
    Copy the full SHA
    d2d7786 View commit details
  13. [analyzer] Move analyzer-eagerly-assume to AnalyzerOptions, enable by…

    … default
    
    Differential Revision: https://reviews.llvm.org/D51251
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340963 91177308-0d34-0410-b5e6-96231b3b80d8
    George Karpenkov committed Aug 29, 2018
    Copy the full SHA
    faff229 View commit details
  14. [analyzer] [NFC] Move class definition out of the function

    Differential Revision: https://reviews.llvm.org/D51322
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340964 91177308-0d34-0410-b5e6-96231b3b80d8
    George Karpenkov committed Aug 29, 2018
    Copy the full SHA
    b1014a1 View commit details
  15. [analyzer] Resolve the crash in ReturnUndefChecker

    By making sure the returned value from getKnownSVal is consistent with
    the value used inside expression engine.
    
    PR38427
    
    Differential Revision: https://reviews.llvm.org/D51252
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340965 91177308-0d34-0410-b5e6-96231b3b80d8
    George Karpenkov committed Aug 29, 2018
    Copy the full SHA
    ee49cd2 View commit details
  16. Add predefined macro __gnu_linux__ for proper aux-triple

    Clang predefine macro __linx__ for aux-triple with Linux OS
    but does not predefine macro __gnu_linux__. This causes
    some compilation error for certain applications, e.g. Eigen.
    
    This patch fixes that.
    
    Differential Revision: https://reviews.llvm.org/D51441
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340967 91177308-0d34-0410-b5e6-96231b3b80d8
    yxsamliu committed Aug 29, 2018
    Copy the full SHA
    b8a2d22 View commit details
  17. [OPENMP] Do not create offloading entry for declare target variables

    declarations.
    
    We should not create offloading entries for declare target var
    declarations as it causes compiler crash.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340968 91177308-0d34-0410-b5e6-96231b3b80d8
    alexey-bataev committed Aug 29, 2018
    Copy the full SHA
    b6aa47d View commit details
  18. [analyzer] Fix tests on 32-bit platforms by specifying the tuple expl…

    …icitly
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340972 91177308-0d34-0410-b5e6-96231b3b80d8
    George Karpenkov committed Aug 29, 2018
    Copy the full SHA
    33ec25f View commit details
  19. [CFG] [analyzer] Disable argument construction contexts for variadic …

    …functions.
    
    The analyzer doesn't make use of them anyway and they seem to have
    pretty weird AST from time to time, so let's just skip them for now.
    
    Fixes pr37769.
    
    Differential Revision: https://reviews.llvm.org/D50824
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340975 91177308-0d34-0410-b5e6-96231b3b80d8
    haoNoQ committed Aug 29, 2018
    Copy the full SHA
    c8b31d0 View commit details
  20. [CFG] [analyzer] Disable argument construction contexts for variadic …

    …functions.
    
    The analyzer doesn't make use of them anyway and they seem to have
    pretty weird AST from time to time, so let's just skip them for now.
    
    Fixes a crash reported as pr37769.
    
    Differential Revision: https://reviews.llvm.org/D50855
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340977 91177308-0d34-0410-b5e6-96231b3b80d8
    haoNoQ committed Aug 29, 2018
    Copy the full SHA
    2483f1c View commit details
  21. [analyzer] CFRetainReleaseChecker: Don't check C++ methods with the s…

    …ame name.
    
    Don't try to understand what's going on when there's a C++ method called eg.
    CFRetain().
    
    Refactor the checker a bit, to use more modern APIs.
    
    Differential Revision: https://reviews.llvm.org/D50866
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340982 91177308-0d34-0410-b5e6-96231b3b80d8
    haoNoQ committed Aug 29, 2018
    Copy the full SHA
    19ada6c View commit details
  22. [analyzer] Support modeling no-op BaseToDerived casts in ExprEngine.

    Introduce a new MemRegion sub-class, CXXDerivedObjectRegion, which is
    the opposite of CXXBaseObjectRegion, to represent such casts. Such region is
    a bit weird because it is by design bigger than its super-region.
    But it's not harmful when it is put on top of a SymbolicRegion
    that has unknown extent anyway.
    
    Offset computation for CXXDerivedObjectRegion and proper modeling of casts
    still remains to be implemented.
    
    Differential Revision: https://reviews.llvm.org/D51191
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340984 91177308-0d34-0410-b5e6-96231b3b80d8
    haoNoQ committed Aug 29, 2018
    Copy the full SHA
    0d516db View commit details
  23. [analyzer] Improve tracing for uninitialized struct fields

    rdar://13729267
    
    Differential Revision: https://reviews.llvm.org/D51323
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340986 91177308-0d34-0410-b5e6-96231b3b80d8
    George Karpenkov committed Aug 29, 2018
    Copy the full SHA
    11b8f23 View commit details
  24. [AttrDocs]: document gnu_inline function attribute

    Summary: This wasn't documented https://clang.llvm.org/docs/AttributeReference.html, and briefly mentioned https://clang.llvm.org/docs/UsersManual.html#differences-between-various-standard-modes.
    
    Reviewers: rsmith
    
    Reviewed By: rsmith
    
    Subscribers: efriedma, cfe-commits, srhines
    
    Differential Revision: https://reviews.llvm.org/D51190
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340987 91177308-0d34-0410-b5e6-96231b3b80d8
    nickdesaulniers committed Aug 29, 2018
    Copy the full SHA
    e385b93 View commit details
  25. [analyzer] Document that pointer arithmetic is not represented by Sym…

    …Exprs.
    
    Add assertions to verify that.
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340990 91177308-0d34-0410-b5e6-96231b3b80d8
    haoNoQ committed Aug 29, 2018
    Copy the full SHA
    bd078dd View commit details

Commits on Aug 30, 2018

  1. Copy the full SHA
    8d011e6 View commit details
  2. Adjust Attr representation so that changes to documentation don't affect

    how we parse source code.
    
    Instead of implicitly opting all undocumented attributes out of '#pragma
    clang attribute' support, explicitly opt them all out and remove the
    documentation check from TableGen.
    
    (No new attributes should be added without documentation, so this has
    little chance of backsliding. We already support the pragma on one
    undocumented attribute, so we don't even want to enforce our old
    "rule".)
    
    No functionality change intended.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341009 91177308-0d34-0410-b5e6-96231b3b80d8
    zygoloid committed Aug 30, 2018
    Copy the full SHA
    b9ef8cb View commit details
  3. Ensure canonical type is actually canonical.

    ASTContext::applyObjCProtocolQualifiers will return a canonical type when given
    a canonical type and an array of canonical protocols.  If the protocols are not
    canonical then the returned type is also not canonical.  Since a canonical type is needed, canonicalize the returned type before using it.  This later prevents
    a type from having a non-canonical canonical type.
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341013 91177308-0d34-0410-b5e6-96231b3b80d8
    Weverything committed Aug 30, 2018
    Copy the full SHA
    35db833 View commit details
  4. AMDGPU: Default to hidden visibility

    Object linking isn't supported, so it's not useful
    to emit default visibility. Default visibility requires
    relocations we don't yet support for functions compiled
    in another translation unit.
    
    WebAssembly already does this, although they insert these
    arguments in a different place for some reason.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341033 91177308-0d34-0410-b5e6-96231b3b80d8
    arsenm committed Aug 30, 2018
    Copy the full SHA
    1e76ac2 View commit details
  5. [CodeComplete] Report location of opening parens for signature help

    Summary: Used in clangd.
    
    Reviewers: sammccall
    
    Reviewed By: sammccall
    
    Subscribers: ioeric, kadircet, cfe-commits
    
    Differential Revision: https://reviews.llvm.org/D51436
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341063 91177308-0d34-0410-b5e6-96231b3b80d8
    ilya-biryukov committed Aug 30, 2018
    Copy the full SHA
    8cd8ed8 View commit details
  6. [OPENMP][NVPTX] Add options -f[no-]openmp-cuda-force-full-runtime.

    Added options -f[no-]openmp-cuda-force-full-runtime to [not] force use
    of the full runtime for OpenMP offloading to CUDA devices.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341073 91177308-0d34-0410-b5e6-96231b3b80d8
    alexey-bataev committed Aug 30, 2018
    Copy the full SHA
    38d46ff View commit details
  7. [Sema][NFC] Trivial cleanup in ActOnCallExpr

    Use logical or operator instead of a bool variable and if/else.
    
    Differential Revision: https://reviews.llvm.org/D51485
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341074 91177308-0d34-0410-b5e6-96231b3b80d8
    jkorous-apple committed Aug 30, 2018
    Copy the full SHA
    5204bd3 View commit details
  8. [HIP] Add -fvisibility hidden option to clang

    AMDGPU target need -fvisibility hidden option for clang to
    work around a limitation of no PLT support, otherwise there is compilation
    error at -O0.
    
    Differential Revision: https://reviews.llvm.org/D51434
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341077 91177308-0d34-0410-b5e6-96231b3b80d8
    yxsamliu committed Aug 30, 2018
    Copy the full SHA
    982b970 View commit details
  9. [libFuzzer] Port to Windows

    Summary:
    Port libFuzzer to windows-msvc.
    This patch allows libFuzzer targets to be built and run on Windows, using -fsanitize=fuzzer and/or fsanitize=fuzzer-no-link. It allows these forms of coverage instrumentation to work on Windows as well.
    It does not fix all issues, such as those with -fsanitize-coverage=stack-depth, which is not usable on Windows as of this patch.
    It also does not fix any libFuzzer integration tests. Nearly all of them fail to compile, fixing them will come in a later patch, so libFuzzer tests are disabled on Windows until them.
    
    Patch By: metzman
    
    Reviewers: morehouse, rnk
    
    Reviewed By: morehouse, rnk
    
    Subscribers: #sanitizers, delcypher, morehouse, kcc, eraman
    
    Differential Revision: https://reviews.llvm.org/D51022
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341082 91177308-0d34-0410-b5e6-96231b3b80d8
    morehouse committed Aug 30, 2018
    Copy the full SHA
    13f9234 View commit details
  10. Test the cross-product of how libgcc-related arguments are passed to …

    …the linker.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341083 91177308-0d34-0410-b5e6-96231b3b80d8
    Sterling-Augustine committed Aug 30, 2018
    Copy the full SHA
    570e134 View commit details
  11. [analyzer] InnerPointerChecker: Fix a segfault when checking symbolic…

    … strings.
    
    Return value of dyn_cast_or_null should be checked before use.
    Otherwise we may put a null pointer into the map as a key and eventually
    crash in checkDeadSymbols.
    
    Differential Revision: https://reviews.llvm.org/D51385
    
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341092 91177308-0d34-0410-b5e6-96231b3b80d8
    haoNoQ committed Aug 30, 2018
    Copy the full SHA
    914b703 View commit details
  12. [OPENMP] Fix PR38710: static functions are not emitted as implicitly

    'declare target'.
    
    All the functions, referenced in implicit|explicit target regions must
    be emitted during code emission for the device.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341093 91177308-0d34-0410-b5e6-96231b3b80d8
    alexey-bataev committed Aug 30, 2018
    Copy the full SHA
    c029fb7 View commit details
  13. Improve attribute documentation to list which spellings are used in w…

    …hich syntaxes.
    
    Summary:
    Instead of listing all the spellings (including attribute namespaces) in
    the section heading, only list the actual attribute names there, and
    list the spellings in the supported syntaxes table.
    
    This allows us to properly describe things like [[fallthrough]], for
    which we allow a clang:: prefix in C++ but not in C, and AlwaysInline,
    which has one spelling as a GNU attribute and a different spelling as a
    keyword, without needing to repeat the syntax description in the
    documentation text.
    
    Sample rendering: https://pste.eu/p/T1ZV.html
    
    Reviewers: aaron.ballman
    
    Subscribers: cfe-commits
    
    Differential Revision: https://reviews.llvm.org/D51473
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341097 91177308-0d34-0410-b5e6-96231b3b80d8
    zygoloid committed Aug 30, 2018
    Copy the full SHA
    8cee2e9 View commit details
  14. Add missing -Wc++11-compat / -Wc++14-compat warnings for:

     * generic lambdas
     * return type deduction
     * class template argument deduction
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341098 91177308-0d34-0410-b5e6-96231b3b80d8
    zygoloid committed Aug 30, 2018
    Copy the full SHA
    dbbd7fa View commit details
  15. Add test file missed from r341097.

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341099 91177308-0d34-0410-b5e6-96231b3b80d8
    zygoloid committed Aug 30, 2018
    Copy the full SHA
    d224345 View commit details
  16. Update FIXME as requested in code review.

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341100 91177308-0d34-0410-b5e6-96231b3b80d8
    zygoloid committed Aug 30, 2018
    Copy the full SHA
    1122a64 View commit details
  17. Change %clang++ to %clangxx in test run line as it was expanding to c…

    …lang.exe++ on Windows.
    
    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@341106 91177308-0d34-0410-b5e6-96231b3b80d8
    dyung committed Aug 30, 2018
    Copy the full SHA
    5e28552 View commit details
Showing 1,604 changed files with 76,020 additions and 41,804 deletions.
60 changes: 34 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
cmake_minimum_required(VERSION 3.4.3)

if(POLICY CMP0075)
cmake_policy(SET CMP0075 NEW)
endif()

# If we are not building as a part of LLVM, build Clang as an
# standalone project, using LLVM as an external library:
if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
@@ -289,25 +293,13 @@ set(CLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(CLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})

if( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE )
message(FATAL_ERROR "In-source builds are not allowed. CMake would overwrite "
"the makefiles distributed with LLVM. Please create a directory and run cmake "
message(FATAL_ERROR "In-source builds are not allowed. "
"Please create a directory and run cmake "
"from there, passing the path to this source directory as the last argument. "
"This process created the file `CMakeCache.txt' and the directory "
"`CMakeFiles'. Please delete them.")
endif()

if( NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
file(GLOB_RECURSE
tablegenned_files_on_include_dir
"${CLANG_SOURCE_DIR}/include/clang/*.inc")
if( tablegenned_files_on_include_dir )
message(FATAL_ERROR "Apparently there is a previous in-source build, "
"probably as the result of running `configure' and `make' on "
"${CLANG_SOURCE_DIR}. This may cause problems. The suspicious files are:\n"
"${tablegenned_files_on_include_dir}\nPlease clean the source directory.")
endif()
endif()

# If CLANG_VERSION_* is specified, use it, if not use LLVM_VERSION_*.
if(NOT DEFINED CLANG_VERSION_MAJOR)
set(CLANG_VERSION_MAJOR ${LLVM_VERSION_MAJOR})
@@ -406,22 +398,35 @@ option(CLANG_BUILD_TOOLS
option(CLANG_ENABLE_ARCMT "Build ARCMT." ON)
option(CLANG_ENABLE_STATIC_ANALYZER "Build static analyzer." ON)

option(CLANG_ANALYZER_BUILD_Z3
"Build the static analyzer with the Z3 constraint manager." OFF)
set(CLANG_ANALYZER_Z3_INSTALL_DIR "" CACHE STRING "Install directory of the Z3 solver.")

option(CLANG_ENABLE_PROTO_FUZZER "Build Clang protobuf fuzzer." OFF)
find_package(Z3 4.7.1 EXACT)

if(NOT CLANG_ENABLE_STATIC_ANALYZER AND (CLANG_ENABLE_ARCMT OR CLANG_ANALYZER_BUILD_Z3))
message(FATAL_ERROR "Cannot disable static analyzer while enabling ARCMT or Z3")
if (CLANG_ANALYZER_Z3_INSTALL_DIR)
if (NOT Z3_FOUND)
message(FATAL_ERROR "Z3 4.7.1 has not been found in CLANG_ANALYZER_Z3_INSTALL_DIR: ${CLANG_ANALYZER_Z3_INSTALL_DIR}.")
endif()
endif()

if(CLANG_ANALYZER_BUILD_Z3)
find_package(Z3 4.5)
if(Z3_FOUND)
set(CLANG_ANALYZER_WITH_Z3 1)
else()
message(FATAL_ERROR "Cannot find Z3 header file or shared library")
set(CLANG_ANALYZER_ENABLE_Z3_SOLVER_DEFAULT "${Z3_FOUND}")

option(CLANG_ANALYZER_ENABLE_Z3_SOLVER
"Enable Support for the Z3 constraint solver in the Clang Static Analyzer."
${CLANG_ANALYZER_ENABLE_Z3_SOLVER_DEFAULT}
)

if (CLANG_ANALYZER_ENABLE_Z3_SOLVER)
if (NOT Z3_FOUND)
message(FATAL_ERROR "CLANG_ANALYZER_ENABLE_Z3_SOLVER cannot be enabled when Z3 is not available.")
endif()

set(CLANG_ANALYZER_WITH_Z3 1)
endif()

option(CLANG_ENABLE_PROTO_FUZZER "Build Clang protobuf fuzzer." OFF)

if(NOT CLANG_ENABLE_STATIC_ANALYZER AND (CLANG_ENABLE_ARCMT OR CLANG_ANALYZER_ENABLE_Z3_SOLVER))
message(FATAL_ERROR "Cannot disable static analyzer while enabling ARCMT or Z3")
endif()

if(CLANG_ENABLE_ARCMT)
@@ -497,6 +502,7 @@ if( CLANG_INCLUDE_TESTS )
)
endif()
add_subdirectory(test)
add_subdirectory(bindings/python/tests)

if(CLANG_BUILT_STANDALONE)
# Add a global check rule now that all subdirectories have been traversed
@@ -505,11 +511,13 @@ if( CLANG_INCLUDE_TESTS )
get_property(LLVM_LIT_PARAMS GLOBAL PROPERTY LLVM_LIT_PARAMS)
get_property(LLVM_LIT_DEPENDS GLOBAL PROPERTY LLVM_LIT_DEPENDS)
get_property(LLVM_LIT_EXTRA_ARGS GLOBAL PROPERTY LLVM_LIT_EXTRA_ARGS)
get_property(LLVM_ADDITIONAL_TEST_TARGETS
GLOBAL PROPERTY LLVM_ADDITIONAL_TEST_TARGETS)
add_lit_target(check-all
"Running all regression tests"
${LLVM_LIT_TESTSUITES}
PARAMS ${LLVM_LIT_PARAMS}
DEPENDS ${LLVM_LIT_DEPENDS}
DEPENDS ${LLVM_LIT_DEPENDS} ${LLVM_ADDITIONAL_TEST_TARGETS}
ARGS ${LLVM_LIT_EXTRA_ARGS}
)
endif()
4 changes: 2 additions & 2 deletions bindings/python/README.txt
Original file line number Diff line number Diff line change
@@ -4,12 +4,12 @@

This directory implements Python bindings for Clang.

You may need to alter LD_LIBRARY_PATH so that the Clang library can be
You may need to set CLANG_LIBRARY_PATH so that the Clang library can be
found. The unit tests are designed to be run with any standard test
runner. For example:
--
$ env PYTHONPATH=$(echo ~/llvm/tools/clang/bindings/python/) \
LD_LIBRARY_PATH=$(llvm-config --libdir) \
CLANG_LIBRARY_PATH=$(llvm-config --libdir) \
python -m unittest discover -v
tests.cindex.test_index.test_create ... ok
...
15 changes: 15 additions & 0 deletions bindings/python/clang/cindex.py
Original file line number Diff line number Diff line change
@@ -2254,6 +2254,12 @@ def from_result(res, fn, args):

return res

def get_num_template_arguments(self):
return conf.lib.clang_Type_getNumTemplateArguments(self)

def get_template_argument_type(self, num):
return conf.lib.clang_Type_getTemplateArgumentAsType(self, num)

def get_canonical(self):
"""
Return the canonical type for a Type.
@@ -3999,6 +4005,15 @@ def cursor(self):
Type,
Type.from_result),

("clang_Type_getNumTemplateArguments",
[Type],
c_int),

("clang_Type_getTemplateArgumentAsType",
[Type, c_uint],
Type,
Type.from_result),

("clang_Type_getOffsetOf",
[Type, c_interop_string],
c_longlong),
41 changes: 41 additions & 0 deletions bindings/python/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Test target to run Python test suite from main build.

add_custom_target(check-clang-python
COMMAND ${CMAKE_COMMAND} -E env
CLANG_LIBRARY_PATH=$<TARGET_FILE_DIR:libclang>
${PYTHON_EXECUTABLE} -m unittest discover
DEPENDS libclang
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..)

set(RUN_PYTHON_TESTS TRUE)
set_target_properties(check-clang-python PROPERTIES FOLDER "Clang tests")

# Do not try to run if libclang was built with ASan because
# the sanitizer library will likely be loaded too late to perform
# interception and will then fail.
# We could use LD_PRELOAD/DYLD_INSERT_LIBRARIES but this isn't
# portable so its easier just to not run the tests when building
# with ASan.
list(FIND LLVM_USE_SANITIZER "Address" LLVM_USE_ASAN_INDEX)
if(NOT LLVM_USE_ASAN_INDEX EQUAL -1)
set(RUN_PYTHON_TESTS FALSE)
endif()

# Tests fail on Windows, and need someone knowledgeable to fix.
# It's not clear whether it's a test or a valid binding problem.
if(WIN32)
set(RUN_PYTHON_TESTS FALSE)
endif()

# AArch64 and Hexagon have known test failures that need to be
# addressed.
# SystemZ has broken Python/FFI interface:
# https://reviews.llvm.org/D52840#1265716
if(${LLVM_NATIVE_ARCH} MATCHES "^(AArch64|Hexagon|SystemZ)$")
set(RUN_PYTHON_TESTS FALSE)
endif()

if(RUN_PYTHON_TESTS)
set_property(GLOBAL APPEND PROPERTY
LLVM_ADDITIONAL_TEST_TARGETS check-clang-python)
endif()
4 changes: 4 additions & 0 deletions bindings/python/tests/cindex/test_access_specifiers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])

from clang.cindex import AccessSpecifier
from clang.cindex import Cursor
10 changes: 5 additions & 5 deletions bindings/python/tests/cindex/test_cdb.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])

from clang.cindex import CompilationDatabase
from clang.cindex import CompilationDatabaseError
from clang.cindex import CompileCommands
@@ -26,11 +31,6 @@ def test_create(self):
"""Check we can load a compilation database"""
cdb = CompilationDatabase.fromDirectory(kInputsDir)

def test_lookup_fail(self):
"""Check file lookup failure"""
cdb = CompilationDatabase.fromDirectory(kInputsDir)
self.assertIsNone(cdb.getCompileCommands('file_do_not_exist.cpp'))

def test_lookup_succeed(self):
"""Check we get some results if the file exists in the db"""
cdb = CompilationDatabase.fromDirectory(kInputsDir)
13 changes: 9 additions & 4 deletions bindings/python/tests/cindex/test_code_completion.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])

from clang.cindex import TranslationUnit

import unittest
@@ -61,11 +66,11 @@ class Q : public P {
cr = tu.codeComplete('fake.cpp', 12, 5, unsaved_files=files)

expected = [
"{'const', TypedText} || Priority: 40 || Availability: Available || Brief comment: None",
"{'volatile', TypedText} || Priority: 40 || Availability: Available || Brief comment: None",
"{'const', TypedText} || Priority: 50 || Availability: Available || Brief comment: None",
"{'volatile', TypedText} || Priority: 50 || Availability: Available || Brief comment: None",
"{'operator', TypedText} || Priority: 40 || Availability: Available || Brief comment: None",
"{'P', TypedText} | {'::', Text} || Priority: 75 || Availability: Available || Brief comment: None",
"{'Q', TypedText} | {'::', Text} || Priority: 75 || Availability: Available || Brief comment: None"
"{'P', TypedText} || Priority: 50 || Availability: Available || Brief comment: None",
"{'Q', TypedText} || Priority: 50 || Availability: Available || Brief comment: None"
]
self.check_completion_results(cr, expected)

5 changes: 5 additions & 0 deletions bindings/python/tests/cindex/test_comment.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])

from clang.cindex import TranslationUnit
from tests.cindex.util import get_cursor

5 changes: 5 additions & 0 deletions bindings/python/tests/cindex/test_cursor.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])

import ctypes
import gc
import unittest
5 changes: 5 additions & 0 deletions bindings/python/tests/cindex/test_cursor_kind.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])

from clang.cindex import CursorKind

import unittest
5 changes: 5 additions & 0 deletions bindings/python/tests/cindex/test_diagnostics.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])

from clang.cindex import *
from .util import get_tu

Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])

import clang.cindex
from clang.cindex import ExceptionSpecificationKind
from .util import get_tu
5 changes: 5 additions & 0 deletions bindings/python/tests/cindex/test_file.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])

from clang.cindex import Index, File

import unittest
5 changes: 5 additions & 0 deletions bindings/python/tests/cindex/test_index.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])

from clang.cindex import *
import os
import unittest
5 changes: 5 additions & 0 deletions bindings/python/tests/cindex/test_linkage.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])

from clang.cindex import LinkageKind
from clang.cindex import Cursor
from clang.cindex import TranslationUnit
5 changes: 5 additions & 0 deletions bindings/python/tests/cindex/test_location.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])

from clang.cindex import Cursor
from clang.cindex import File
from clang.cindex import SourceLocation
5 changes: 5 additions & 0 deletions bindings/python/tests/cindex/test_tls_kind.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])

from clang.cindex import TLSKind
from clang.cindex import Cursor
from clang.cindex import TranslationUnit
5 changes: 5 additions & 0 deletions bindings/python/tests/cindex/test_token_kind.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])

from clang.cindex import TokenKind

import unittest
5 changes: 5 additions & 0 deletions bindings/python/tests/cindex/test_tokens.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])

from clang.cindex import CursorKind
from clang.cindex import Index
from clang.cindex import SourceLocation
5 changes: 5 additions & 0 deletions bindings/python/tests/cindex/test_translation_unit.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import os
from clang.cindex import Config
if 'CLANG_LIBRARY_PATH' in os.environ:
Config.set_library_path(os.environ['CLANG_LIBRARY_PATH'])

from contextlib import contextmanager
import gc
import os
Loading