summaryrefslogtreecommitdiffstats
path: root/clang/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* cc1_main: fix -Wsign-compare on FreeBSDFangrui Song2018-07-251-2/+4
| | | | | | | Its __rlim_t is intentionally signed (__int64_t) because of legacy code that uses -1 for RLIM_INFINITY. llvm-svn: 337892
* Rewrite the VS integration scripts.Zachary Turner2018-07-201-4/+0
| | | | | | | | | | | | | | | | | | | | | | | This is a new modernized VS integration installer. It adds a Visual Studio .sln file which, when built, outputs a VSIX that can be used to install ourselves as a "real" Visual Studio Extension. We can even upload this extension to the visual studio marketplace. This fixes a longstanding problem where we didn't support installing into VS 2017 and higher. In addition to supporting VS 2017, due to the way this is written we now longer need to do anything special to support future versions of VS as well. Everything should "just work". This also fixes several bugs with our old integration, such as MSBuild triggering full rebuilds when /Zi was used. Finally, we add a new UI page called "LLVM" which becomes visible when the LLVM toolchain is selected. For now this only contains one option which is the path to clang-cl.exe, but in the future we can add more things here. Differential Revision: https://reviews.llvm.org/D42762 llvm-svn: 337572
* [Index] Set OrigD before D is changed.Eric Liu2018-07-202-0/+4
| | | | | | | | | | | | Reviewers: akyrtzi, arphaman Reviewed By: akyrtzi Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49476 llvm-svn: 337529
* PR15730/PR16986 Allow dependently typed vector_size types.Erich Keane2018-07-131-0/+1
| | | | | | | | | | | | | | | | | As listed in the above PRs, vector_size doesn't allow dependent types/values. This patch introduces a new DependentVectorType to handle a VectorType that has a dependent size or type. In the future, ALL the vector-types should be able to create one of these to handle dependent types/sizes as well. For example, DependentSizedExtVectorType could likely be switched to just use this instead, though that is left as an exercise for the future. Differential Revision: https://reviews.llvm.org/D49045 llvm-svn: 337036
* Revert -r336726, which included more files than intended.Erich Keane2018-07-101-1/+0
| | | | llvm-svn: 336727
* [NFC] Switch CodeGenFunction to use value init instead of member init listsErich Keane2018-07-101-0/+1
| | | | | | | | The member init list for the sole constructor for CodeGenFunction has gotten out of hand, so this patch moves the non-parameter-dependent initializations into the member value inits. llvm-svn: 336726
* Revert r336590 "[libclang] evalute compound statement cursors before trying ↵Evgeniy Stepanov2018-07-101-13/+13
| | | | | | | | | to evaluate" New memory leaks in LibclangParseTest_EvaluateChildExpression_Test::TestBody() llvm-svn: 336716
* Revert r336591 "[libclang] NFC, simplify clang_Cursor_Evaluate"Evgeniy Stepanov2018-07-101-24/+25
| | | | | | This change is blocking r336590 which is being reverted due to memory leaks. llvm-svn: 336715
* Support -fdebug-prefix-map for assembler source (pass to cc1as). ThisPaul Robinson2018-07-101-0/+7
| | | | | | | | | | | is useful to omit the debug compilation dir when compiling assembly files with -g. Part of PR38050. Patch by Siddhartha Bagaria! Differential Revision: https://reviews.llvm.org/D48989 llvm-svn: 336685
* [libclang] NFC, simplify clang_Cursor_EvaluateAlex Lorenz2018-07-091-25/+24
| | | | | | | Take advantage of early returns as suggested by Duncan in https://reviews.llvm.org/D49051 llvm-svn: 336591
* [libclang] evalute compound statement cursors before trying to evaluateAlex Lorenz2018-07-091-13/+13
| | | | | | | | | | | | | | the cursor like a declaration This change fixes a bug in libclang in which it tries to evaluate a statement cursor as a declaration cursor, because that statement still has a pointer to the declaration parent. rdar://38888477 Differential Revision: https://reviews.llvm.org/D49051 llvm-svn: 336590
* [Index] Add indexing support for MACROs.Eric Liu2018-07-091-0/+38
| | | | | | | | | | | | Reviewers: akyrtzi, arphaman, sammccall Reviewed By: sammccall Subscribers: malaperle, sammccall, cfe-commits Differential Revision: https://reviews.llvm.org/D48961 llvm-svn: 336524
* Factor out Clang's desired 8MB stack size constant from the variousRichard Smith2018-07-032-16/+11
| | | | | | places we hardcode it. llvm-svn: 336231
* [clang-format] Add a default format style that can be used by users of ↵Eric Liu2018-06-251-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | `getStyle` Summary: Tools that reformat code often call `getStyle` to decide the format style to use on a certain source file. In practice, "file" style is widely used. As a result, many tools hardcode "file" when calling `getStyle`, which makes it hard to control the default style in tools across a codebase when needed. This change introduces a `DefaultFormatStyle` constant (default to "file" in upstream), which can be modified downstream if wanted, so that all users/tools built from the same source tree can have a consistent default format style. This also adds an DefaultFallbackStyle that is recommended to be used by tools and can be modified downstream. Reviewers: sammccall, djasper Reviewed By: sammccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48492 llvm-svn: 335492
* Attempt to fix latent tablegen dependency issueReid Kleckner2018-06-231-1/+10
| | | | llvm-svn: 335419
* Fix BUILD_SHARED_LIBS=1 build of libclangHandleLLVMSam Clegg2018-06-221-1/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D48503 llvm-svn: 335380
* Implemented proto to LLVM conversion and LLVM fuzz targetEmmett Neyman2018-06-2214-36/+430
| | | | | | Differential Revision: https://reviews.llvm.org/D48106 llvm-svn: 335374
* Test commit, made a minor change to a commentEmmett Neyman2018-06-211-1/+1
| | | | llvm-svn: 335299
* [liblang] Remove DOS line endings in libclang.exportsRainer Orth2018-06-211-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Undefined first referenced symbol in file clang_getCompletionFixIt /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports clang_getTokenLocation /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports clang_getToken /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports clang_getTemplateCursorKind /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports clang_getTUResourceUsageName /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports clang_getCompletionChunkKind /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports clang_getCompletionChunkText /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports clang_getSpellingLocation /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports clang_getCompletionParent /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports clang_getCompletionChunkCompletionString /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports clang_getCompletionPriority /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports clang_getCompletionNumFixIts /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports clang_getTokenExtent /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports clang_getCompletionNumAnnotations /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports clang_getTokenKind /var/gcc/llvm/obj/local/tools/clang/tools/libclang/libclang.exports ld: fatal: symbol referencing errors collect2: error: ld returned 1 exit status make[2]: *** [tools/clang/tools/libclang/CMakeFiles/libclang.dir/build.make:651: lib/libclang.so.7] Error 1 It turns out that this is caused by https://reviews.llvm.org/D46862: it added a couple of CRs (^M) to some lines. Solaris ld takes them to be part of the symbol names, which of course are missing from the input objects. GNU ld handles this just fine. Fixed by removing the CRs. Bootstrapped on i386-pc-solaris2.11. I guess this is obvious. Differential Revision: https://reviews.llvm.org/D48423 llvm-svn: 335234
* [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point LiteralsLeonard Chan2018-06-202-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This diff includes the logic for setting the precision bits for each primary fixed point type in the target info and logic for initializing a fixed point literal. Fixed point literals are declared using the suffixes ``` hr: short _Fract uhr: unsigned short _Fract r: _Fract ur: unsigned _Fract lr: long _Fract ulr: unsigned long _Fract hk: short _Accum uhk: unsigned short _Accum k: _Accum uk: unsigned _Accum ``` Errors are also thrown for illegal literal values ``` unsigned short _Accum u_short_accum = 256.0uhk; // expected-error{{the integral part of this literal is too large for this unsigned _Accum type}} ``` Differential Revision: https://reviews.llvm.org/D46915 llvm-svn: 335148
* Update copyright year to 2018.Paul Robinson2018-06-181-1/+1
| | | | llvm-svn: 334936
* [cmake] Add linker detection for Apple platformsShoaib Meenai2018-06-141-2/+2
| | | | | | | | | | | | | | | | LLVM currently assumes that Apple platforms will always use ld64. In the future, LLD Mach-O might also be supported, so add the beginnings of linker detection support. ld64 is currently the only detected linker, since `ld64.lld -v` doesn't yield any useful version output, but we can add that detection later, and in the meantime it's still useful to have the ld64 identification. Switch clang's order file check to use this new detection rather than just checking for the presence of an ld64 executable. Differential Revision: https://reviews.llvm.org/D48201 llvm-svn: 334780
* [CMAKE][c-index-test] Honor CMAKE_OSX_SYSROOT to compute include dir for libxml2Bruno Cardoso Lopes2018-06-141-1/+5
| | | | | | | | | | | | | On MacOS, if CMAKE_OSX_SYSROOT is used and the user has command line tools installed, we currently get the include path for libxml2 as /usr/include/libxml2, instead of ${CMAKE_OSX_SYSROOT}/usr/include/libxml2. Make it consistent on MacOS by prefixing ${CMAKE_OSX_SYSROOT} when possible. rdar://problem/41103601 llvm-svn: 334747
* [libclang] Make c-index-test.c ISO C90 compliant.Matt Morehouse2018-06-131-1/+1
| | | | | | Fixes a build bot breakage caused by r334593. llvm-svn: 334612
* [libclang] Optionally add code completion results for arrow instead of dotIvan Donchevskii2018-06-134-21/+149
| | | | | | | | Follow up for D41537 - libclang part. Differential Revision: https://reviews.llvm.org/D46862 llvm-svn: 334593
* Refactor ExecuteAndWait to take StringRefs.Zachary Turner2018-06-121-12/+11
| | | | | | | | | | | | | | | | | | | This simplifies some code which had StringRefs to begin with, and makes other code more complicated which had const char* to begin with. In the end, I think this makes for a more idiomatic and platform agnostic API. Not all platforms launch process with null terminated c-string arrays for the environment pointer and argv, but the api was designed that way because it allowed easy pass-through for posix-based platforms. There's a little additional overhead now since on posix based platforms we'll be takign StringRefs which were constructed from null terminated strings and then copying them to null terminate them again, but from a readability and usability standpoint of the API user, I think this API signature is strictly better. llvm-svn: 334518
* [clang-fuzzer] Modified protobuf and converter to add new signature, remove ↵Matt Morehouse2018-06-112-12/+29
| | | | | | | | | | | | conditionals. Changed the function signature and removed conditionals from loop body. Patch By: emmettneyman Differential Revision: https://reviews.llvm.org/D47964 llvm-svn: 334421
* [clang-fuzzer] Made loop_proto more "vectorizable".Matt Morehouse2018-06-082-45/+13
| | | | | | | | | | | | | Edited loop_proto and its converter to make more "vectorizable" code according to kcc's comment in D47666 - Removed all while loops - Can only index into array with induction variable Patch By: emmettneyman Differential Revision: https://reviews.llvm.org/D47920 llvm-svn: 334252
* Introducing single for loop into clang_proto_fuzzerVitaly Buka2018-06-077-5/+351
| | | | | | | | | | | | | | | | | | | | Summary: Created a new protobuf and protobuf-to-C++ "converter" that wraps the entire C++ code in a single for loop. - Slightly changed cxx_proto.proto -> cxx_loop_proto.proto - Made some changes to proto_to_cxx files to handle the new kind of protobuf - Created ExampleClangLoopProtoFuzzer to test new protobuf and "converter" Patch by Emmett Neyman Reviewers: kcc, vitalybuka, morehouse Reviewed By: vitalybuka, morehouse Subscribers: mgorny, llvm-commits, cfe-commits Differential Revision: https://reviews.llvm.org/D47843 llvm-svn: 334216
* [clang-proto-fuzzer] Refactored LLVMFuzzerInitialize into its own file.Matt Morehouse2018-06-055-18/+71
| | | | | | | | | | Copied and renamed some files in preparation for new loop-proto-fuzzer. Patch By: emmettneyman Differential Revision: https://reviews.llvm.org/D47666 llvm-svn: 333969
* This diff includes changes for supporting the following types.Leonard Chan2018-06-041-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | // Primary fixed point types signed short _Accum s_short_accum; signed _Accum s_accum; signed long _Accum s_long_accum; unsigned short _Accum u_short_accum; unsigned _Accum u_accum; unsigned long _Accum u_long_accum; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; This diff only allows for declaration of the fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. The saturated versions of these types and the equivalent _Fract types will also be added in future patches. The tests included are for asserting that we can declare these types. Fixed the test that was failing by not checking for dso_local on some targets. Differential Revision: https://reviews.llvm.org/D46084 llvm-svn: 333923
* Revert "This diff includes changes for supporting the following types."Leonard Chan2018-06-021-12/+0
| | | | | | | This reverts commit r333814, which fails for a test checking the bit width on ubuntu. llvm-svn: 333815
* This diff includes changes for supporting the following types.Leonard Chan2018-06-021-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | ``` // Primary fixed point types signed short _Accum s_short_accum; signed _Accum s_accum; signed long _Accum s_long_accum; unsigned short _Accum u_short_accum; unsigned _Accum u_accum; unsigned long _Accum u_long_accum; // Aliased fixed point types short _Accum short_accum; _Accum accum; long _Accum long_accum; ``` This diff only allows for declaration of the fixed point types. Assignment and other operations done on fixed point types according to http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1169.pdf will be added in future patches. The saturated versions of these types and the equivalent `_Fract` types will also be added in future patches. The tests included are for asserting that we can declare these types. Differential Revision: https://reviews.llvm.org/D46084 llvm-svn: 333814
* [cmake] Support LLD for CLANG_ORDER_FILEShoaib Meenai2018-06-021-2/+5
| | | | | | | | | | | | | | | | | LLD also supports order files using the `--symbol-ordering-file` option. As the name would suggest, the order file format is slightly different from gold; gold's order files specify section names, whereas LLD's specify symbol names. Assuming you have an order file in the correct format though, we should support using it with LLD. Switch the check to actually use LLVM's linker detection rather than just checking for the presence of the gold executable, since we might have a gold executable present but be using LLD (or bfd for that matter) as our linker. Differential Revision: https://reviews.llvm.org/D47669 llvm-svn: 333810
* [cmake] Use LLVM's check_linker_flagShoaib Meenai2018-06-021-8/+1
| | | | | | | LLVM already defines this function, so make use of it instead of rolling our own. llvm-svn: 333808
* Reland r332885, "CodeGen, Driver: Start using direct split dwarf emission in ↵Peter Collingbourne2018-05-221-14/+23
| | | | | | | | | clang." As well as two follow-on commits r332906, r332911 with a fix for test clang/test/CodeGen/split-debug-filename.c. llvm-svn: 333013
* Revert "CodeGen, Driver: Start using direct split dwarf emission in clang."Amara Emerson2018-05-221-23/+14
| | | | | | This reverts commit r332885 as it broke several greendragon buildbots. llvm-svn: 332973
* CodeGen, Driver: Start using direct split dwarf emission in clang.Peter Collingbourne2018-05-211-14/+23
| | | | | | | | Fixes PR37466. Differential Revision: https://reviews.llvm.org/D47093 llvm-svn: 332885
* MC: Change the streamer ctors to take an object writer instead of a stream. ↵Peter Collingbourne2018-05-181-2/+4
| | | | | | | | | | | | | | NFCI. The idea is that a client that wants split dwarf would create a specific kind of object writer that creates two files, and use it to create the streamer. Part of PR37466. Differential Revision: https://reviews.llvm.org/D47050 llvm-svn: 332749
* [libclang] Allow skipping function bodies in preamble onlyIvan Donchevskii2018-05-172-1/+9
| | | | | | | | | | | | | | | | | | | Second attempt. Fix line endings and warning. As an addition to CXTranslationUnit_SkipFunctionBodies, provide the new option CXTranslationUnit_LimitSkipFunctionBodiesToPreamble, which constraints the skipping of functions bodies to the preamble only. Function bodies in the main file are not affected if this option is set. Skipping function bodies only in the preamble is what clangd already does and the introduced flag implements it for libclang clients. Patch by Nikolai Kosjar. Differential Revision: https://reviews.llvm.org/D45815 llvm-svn: 332587
* Revert https://reviews.llvm.org/D46050 and https://reviews.llvm.org/D45815Ivan Donchevskii2018-05-172-23/+15
| | | | | | | Windows line endings. Requires proper resubmission. llvm-svn: 332585
* [libclang] Allow skipping function bodies in preamble onlyIvan Donchevskii2018-05-172-15/+23
| | | | | | | | | | | | | | | | | As an addition to CXTranslationUnit_SkipFunctionBodies, provide the new option CXTranslationUnit_LimitSkipFunctionBodiesToPreamble, which constraints the skipping of functions bodies to the preamble only. Function bodies in the main file are not affected if this option is set. Skipping function bodies only in the preamble is what clangd already does and the introduced flag implements it for libclang clients. Patch by Nikolai Kosjar. Differential Revision: https://reviews.llvm.org/D45815 llvm-svn: 332578
* [diagtool] Add diagtool to install target.Jonas Devlieghere2018-05-161-0/+12
| | | | | | | | | | | | | | | | | | | | | | Although not very well known, diagtool is an incredibly convenient utility for dealing with diagnostics. Particularly useful are the "tree" and "show-enabled" commands: - The former prints the hierarchy of diagnostic (warning) flags and which of them are enabled by default. - The latter can be used to replace an invocation to clang and will print which diagnostics are disabled, warnings or errors. For instance: `diagtool show-enabled -Wall -Werror /tmp/test.c` will print that -Wunused-variable (warn_unused_variable) will be treated as an error. This patch adds them to the install target so it gets shipped with the LLVM release. It also adds a very basic man page and mentions this change in the release notes. Differential revision: https://reviews.llvm.org/D46694 llvm-svn: 332448
* update two comments as suggested on https://reviews.llvm.org/D46843Nico Weber2018-05-152-4/+2
| | | | llvm-svn: 332370
* [libclang] Stop assuming that the internal C++ ABI ↵Richard Smith2018-05-111-1/+29
| | | | | | ExceptionSpecificationType enumeration is the same as CXCursor_ExceptionSpecificationKind. llvm-svn: 332130
* [HIP] Let clang-offload-bundler support HIPYaxun Liu2018-05-111-5/+5
| | | | | | | | | | When bundle/unbundle intermediate files for HIP, there may be multiple sub archs, therefore BoundArch needs to be included in the target and output file names for clang-offload-bundler. Differential Revision: https://reviews.llvm.org/D46473 llvm-svn: 332121
* Reland '[clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective'Julie Hockett2018-05-101-1/+2
| | | | | | | | | | | | | | This commit relands r331904. Adding a SrcMgr::CharacteristicKind parameter to the InclusionDirective in PPCallbacks, and updating calls to that function. This will be useful in https://reviews.llvm.org/D43778 to determine which includes are system headers. Differential Revision: https://reviews.llvm.org/D46614 llvm-svn: 332021
* Revert "[clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective"Julie Hockett2018-05-091-2/+1
| | | | | | This reverts commit r331904 because of a memory leak. llvm-svn: 331932
* [clang] Adding CharacteristicKind to PPCallbacks::InclusionDirectiveJulie Hockett2018-05-091-1/+2
| | | | | | | | | | | Adding a SrcMgr::CharacteristicKind parameter to the InclusionDirective in PPCallbacks, and updating calls to that function. This will be useful in https://reviews.llvm.org/D43778 to determine which includes are system headers. Differential Revision: https://reviews.llvm.org/D46614 llvm-svn: 331904
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-0930-178/+178
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 llvm-svn: 331834
OpenPOWER on IntegriCloud