summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* StaticAnalyzer: Avoid an unintentional copyJustin Bogner2016-03-221-1/+1
| | | | | | | | | | The range here isn't over references, so using `auto &` here incites a copy. Switching to `auto *` would do, but we might as well list an explicit type for clarity. Found by -Wrange-loop-analysis. llvm-svn: 264071
* Make build bots happyDavid Majnemer2016-03-221-1/+0
| | | | | | | BasicBlock's lose their names for some builders, don't mention such names. llvm-svn: 264066
* [MS ABI] Assign an inheritance model for the dest of a member pointer upcastDavid Majnemer2016-03-222-1/+20
| | | | | | | | | While we correctly assigned an inheritance model for the source of a member pointer upcast, we did not do so for the destination. This fixes PR27030. llvm-svn: 264065
* [Perf-training] Using os.devnull instead of a temp fileChris Bieneman2016-03-221-4/+1
| | | | | | | | This is based on post-commit feedback from Vedant. Totally didn't know that existed and worked on Windows. Thanks Vedant! llvm-svn: 264064
* [Perf-training] Cleanup based on feedback from Sean SilvasChris Bieneman2016-03-221-11/+6
| | | | | | Sean provided feedback based on r257934 on cfe-commits. This change addresses that feedback. llvm-svn: 264063
* clang-format: [JS] do not wrap ES6 imports/exports.Daniel Jasper2016-03-223-22/+38
| | | | | | | | | "import ... from '...';" and "export ... from '...';" should be treated the same as goog.require/provide/module/forwardDeclare calls. Patch by Martin Probst. llvm-svn: 264055
* [ASTMatchers] New matcher hasReturnValue addedAlexander Kornienko2016-03-224-0/+35
| | | | | | | | | | | | | | Summary: A checker (will be uploaded after this patch) needs to check implicit casts. Existing generic matcher "has" ignores implicit casts and parenthesized expressions and no specific matcher for matching return value expression preexisted. The patch adds such a matcher (hasReturnValue). Reviewers: klimek, sbenza Subscribers: xazax.hun, klimek, cfe-commits Patch by Ádám Balogh! Differential Revision: http://reviews.llvm.org/D17986 llvm-svn: 264037
* Fix warning about extra semicolon. NFC.Vasileios Kalintiris2016-03-221-1/+1
| | | | llvm-svn: 264035
* [Objective-c] Do not set IsExact to true when the receiver is a class.Akira Hatanaka2016-03-223-3/+13
| | | | | | | | | | | | IsExact shouldn't be set to true in WeakObjectProfileTy::getBaseInfo when the receiver is a class because having a class as the receiver doesn't guarantee that the Base is exact. This is a follow-up to r263818. rdar://problem/25208167 llvm-svn: 264025
* [Perf-training] Fixing an issue with multi-threading PGO generationChris Bieneman2016-03-221-2/+5
| | | | | | When LIT parallelizes the profraw file generation we need to generate unique temp filenames then clean them up after the driver executes. llvm-svn: 264021
* Visual Studio Native Visualizations for constructors and methodsMike Spertus2016-03-221-23/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change, the class struct A { A(int _i); ~A(); int foo(double d); double bar(A *a) { return 1.3; } }; appears in the VS2015 Locals Window as D 0x02dbb378 struct A |- DeclKind CXXRecord |- Members |- [0] implicit struct A |- [1] Constructor {A(int _i)} |- [2] Destructor {~A()} |- [3] Method {int foo(double d)} |- [4] Method {double bar(struct A *)} |- [Raw View] /* Other stuff */ Note that these changes only benefit VS2015 as VS2013 does not have views and only displays the struct name "A", but the change does no apparent harm in VS2013, so is still a win. llvm-svn: 264020
* [OpenMP] Base support for target directive codegen on NVPTX device.Arpith Chacko Jacob2016-03-225-6/+1052
| | | | | | | | | | | | | | Summary: This patch adds base support for codegen of the target directive on the NVPTX device. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D17877 Reworked test case after buildbot failure on windows. Updated patch to integrate r263837 and test case nvptx_target_firstprivate_codegen.cpp. llvm-svn: 264018
* [CUDA] Implement atomicInc and atomicDec builtinsJustin Lebar2016-03-222-1/+23
| | | | | | | | | | | | | | | These functions cannot be implemented as atomicrmw or cmpxchg instructions, so they are implemented as a call to the NVVM intrinsics @llvm.nvvm.atomic.load.inc.32.p0i32 and @llvm.nvvm.atomic.load.dec.32.p0i32. Patch by Jason Henline. Reviewers: jlebar Differential Revision: http://reviews.llvm.org/D18322 llvm-svn: 264009
* [sema] [CUDA] Use std algorithms in EraseUnwantedCUDAMatchesImpl.Justin Lebar2016-03-221-17/+14
| | | | | | | | | | | | Summary: NFC Reviewers: tra Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18327 llvm-svn: 264008
* Revert r263974, "clang-cl: With -fmsc-version=1900, use MSVS2015 diag ↵NAKAMURA Takumi2016-03-213-23/+9
| | | | | | | | formatting." It seems the test wouldn't expect if default target is *-win32. llvm-svn: 264007
* [Perf-training] Adding support for tests to skip the clang driverChris Bieneman2016-03-215-2/+69
| | | | | | | | | | This patch adds a new set of substitutions to the lit run lines for order files and PGO generation which run the clang driver to get the cc1 command, then execute the cc1 command directly. This allows the scripts to bypass profiling the clang driver over and over again. The approach in this patch was discussed via IRC with Sean Silvas. Special thanks to Daniel Dunbar whose out-of-tree code I liberally plagiarized. llvm-svn: 263997
* [modules] Store mangling numbers in a deterministic order so they don't ↵Richard Smith2016-03-212-6/+5
| | | | | | cause the resulting .pcm files to be nondeterministic. llvm-svn: 263996
* [modules] Renumber DECL_UPDATES from 30 to 50, so it no longer collides withRichard Smith2016-03-211-6/+10
| | | | | | | | TYPE_TEMPLATE_SPECIALIZATION. This was fine in practice because both record kinds are only ever found by offset, but made the llvm-bcanalyzer -dump output very confusing. llvm-svn: 263989
* Revert "Convert some ObjC msgSends to runtime calls."Pete Cooper2016-03-2110-336/+18
| | | | | | | | | | | | | | This reverts commit r263607. This change caused more objc_retain/objc_release calls in the IR but those are then incorrectly optimized by the ARC optimizer. Work is going to have to be done to ensure the ARC optimizer doesn't optimize user written RR, but that should land before this change. This change will also need to be updated to take account for any changes required to ensure that user written calls to RR are distinct from those inserted by ARC. llvm-svn: 263984
* clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting.Nico Weber2016-03-213-9/+23
| | | | llvm-svn: 263974
* [modules] Don't invent a module cache path unless implicit module builds are ↵Richard Smith2016-03-212-22/+24
| | | | | | enabled. llvm-svn: 263970
* clang-format: [JS] no space in union and intersection types.Daniel Jasper2016-03-213-0/+22
| | | | | | | | | The operators | and & in types, as opposed to the bitwise operators, should not have whitespace around them (e.g. `Foo<Bar|Baz>`). Patch by Martin Probst. Thank you. llvm-svn: 263961
* Add replacement = "xxx" to AvailabilityAttr.Manman Ren2016-03-2111-20/+66
| | | | | | | | | | | | This commit adds a named argument to AvailabilityAttr, while r263652 adds an optional string argument to __attribute__((deprecated)). This was commited in r263687 and reverted in 263752 due to misaligned access. rdar://20588929 llvm-svn: 263958
* [ARM] Clang tests for ARM Cortex-A32 supportRenato Golin2016-03-213-10/+21
| | | | | | Patch by Sam Parker. llvm-svn: 263957
* NFC: wrap Availability-related data in its own struct in AttributeList.Manman Ren2016-03-211-31/+32
| | | | | | This makes it easy to add more data into Availability. llvm-svn: 263955
* clang-cl: Move /FC from "Unsupported" to "Ignored" list.Nico Weber2016-03-212-1/+2
| | | | | | | /FC affects if diagnostics print with full paths and if __FILE__ expands with a full path. clang-cl does both of these two by default. llvm-svn: 263953
* clang-cl: support __cdecl-on-struct anachronismReid Kleckner2016-03-212-0/+12
| | | | | | | | | | | | | | | | | | | | | | Summary: The Microsoft compiler emits warning C4229: anachronism used : modifiers on data are ignored for struct {} __cdecl s; but ICU's gendict can generate such (and does when building LibreOffice), so accepting this in clang-cl too would be useful. Reviewers: rnk Patch by Stephan Bergmann Differential Revision: http://reviews.llvm.org/D16628 llvm-svn: 263947
* clang-format: Make include sorting's main include detection configurable.Daniel Jasper2016-03-215-3/+73
| | | | | | | | | | This patch adds a regular expression to configure suffixes of an included file to check whether it is the "main" include of the current file. Previously, clang-format has allowed arbitrary suffixes on the formatted file, which is still the case when no IncludeMainRegex is specified. llvm-svn: 263943
* Remove debug output. Sorry for the noise.NAKAMURA Takumi2016-03-211-1/+1
| | | | llvm-svn: 263936
* clang/test/CodeGenCXX/cxx1z-lambda-star-this.cpp: Satisfy -Asserts.NAKAMURA Takumi2016-03-211-7/+7
| | | | llvm-svn: 263934
* clang/test/Frontend/plugin-annotate-functions.c requires the target ↵NAKAMURA Takumi2016-03-211-0/+1
| | | | | | examples/AnnotateFunctions. llvm-svn: 263931
* Reorder data members to be consistent with member initializers, to silence ↵Faisal Vali2016-03-211-6/+6
| | | | | | warnings. llvm-svn: 263922
* [Cxx1z] Implement Lambda Capture of *this by Value as [=,*this] (P0018R3)Faisal Vali2016-03-2122-88/+379
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement lambda capture of *this by copy. For e.g.: struct A { int d = 10; auto foo() { return [*this] (auto a) mutable { d+=a; return d; }; } }; auto L = A{}.foo(); // A{}'s lifetime is gone. // Below is still ok, because *this was captured by value. assert(L(10) == 20); assert(L(100) == 120); If the capture was implicit, or [this] (i.e. *this was captured by reference), this code would be otherwise undefined. Implementation Strategy: - amend the parser to accept *this in the lambda introducer - add a new king of capture LCK_StarThis - teach Sema::CheckCXXThisCapture to handle by copy captures of the enclosing object (i.e. *this) - when CheckCXXThisCapture does capture by copy, the corresponding initializer expression for the closure's data member direct-initializes it thus making a copy of '*this'. - in codegen, when assigning to CXXThisValue, if *this was captured by copy, make sure it points to the corresponding field member, and not, unlike when captured by reference, what the field member points to. - mark feature as implemented in svn Much gratitude to Richard Smith for his carefully illuminating reviews! llvm-svn: 263921
* clang-cl: Add a comment about /Oy- (see r245913).Nico Weber2016-03-211-0/+1
| | | | llvm-svn: 263920
* Visual Studio Visualizers for clang::FunctionDeclMike Spertus2016-03-201-2/+42
| | | | | | | Readably displays a FunctionDecl in the Visual Studio Locals Window something like: void g(int, double d, struct A && arr) llvm-svn: 263915
* [tsan] Allow -fsanitize=thread for iOS-style simulator targetsDevin Coughlin2016-03-202-1/+27
| | | | | | | | | Update the clang driver to allow -fsanitize=thread when targeting x86_64 iOS and tvOS simulators. Also restrict TSan targeting OS X to only be supported on x86_64 and not i386. Differential Revision: http://reviews.llvm.org/D18280 llvm-svn: 263913
* [VFS] Fix test to use more restrict set of headersBruno Cardoso Lopes2016-03-201-5/+5
| | | | llvm-svn: 263912
* AST: Fix some bogus indentation. NFCJustin Bogner2016-03-201-2/+2
| | | | | | Noticed by Liu Xin. Thanks! llvm-svn: 263909
* Fixed -Wdocumentation warningSimon Pilgrim2016-03-201-6/+6
| | | | llvm-svn: 263908
* Mark C++ features implemented in Clang 3.8 as done now that 3.8 has released.Richard Smith2016-03-201-3/+3
| | | | llvm-svn: 263896
* P0184R0: Allow types of 'begin' and 'end' expressions in range-based for ↵Richard Smith2016-03-2015-68/+109
| | | | | | loops to differ. llvm-svn: 263895
* Reapply [2] [VFS] Add 'overlay-relative' field to YAML filesBruno Cardoso Lopes2016-03-208-29/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reapplies r261552 and r263748. Fixed testcase to reapply. The VFS overlay mapping between virtual paths and real paths is done through the 'external-contents' entries in YAML files, which contains hardcoded paths to the real files. When a module compilation crashes, headers are dumped into <name>.cache/vfs directory and are mapped via the <name>.cache/vfs/vfs.yaml. The script generated for reproduction uses -ivfsoverlay pointing to file to gather the mapping between virtual paths and files inside <name>.cache/vfs. Currently, we are only capable of reproducing such crashes in the same machine as they happen, because of the hardcoded paths in 'external-contents'. To be able to reproduce a crash in another machine, this patch introduces a new option in the VFS yaml file called 'overlay-relative'. When it's equal to 'true' it means that the provided path to the YAML file through the -ivfsoverlay option should also be used to prefix the final path for every 'external-contents'. Example, given the invocation snippet "... -ivfsoverlay <name>.cache/vfs/vfs.yaml" and the following entry in the yaml file: "overlay-relative": "true", "roots": [ ... "type": "directory", "name": "/usr/include", "contents": [ { "type": "file", "name": "stdio.h", "external-contents": "/usr/include/stdio.h" }, ... Here, a file manager request for virtual "/usr/include/stdio.h", that will map into real path "/<absolute_path_to>/<name>.cache/vfs/usr/include/stdio.h. This is a useful feature for debugging module crashes in machines other than the one where the error happened. Differential Revision: http://reviews.llvm.org/D17457 rdar://problem/24499339 llvm-svn: 263893
* Better visualization of clang::BuiltinType in VisualStudioMike Spertus2016-03-201-0/+26
| | | | | | Whenever possible, use C++ names for visualizing builtin types. E.g., "long double" instead of "LongDouble" llvm-svn: 263891
* Visual Studio Visualizer for clang::FunctionProtoTypeMike Spertus2016-03-201-0/+32
| | | | | | Displays return type and parameters for the Function Protoype object in the Locals window. llvm-svn: 263890
* [Sema] Make type deduction work with some overloadable functionsGeorge Burgess IV2016-03-192-0/+71
| | | | | | | | | | | Some functions can't have their address taken. If we encounter an overload set where only one of the candidates can have its address taken, we should automatically select that candidate's type in type deduction. Differential Revision: http://reviews.llvm.org/D15591 llvm-svn: 263888
* [Sema] Allow casting of some overloaded functionsGeorge Burgess IV2016-03-195-14/+215
| | | | | | | | | | | Some functions can't have their address taken. If we encounter an overload set where only one of the candidates can have its address taken, we should automatically select that candidate in cast expressions. Differential Revision: http://reviews.llvm.org/D17701 llvm-svn: 263887
* [TLS on Darwin] use CXX_FAST_TLS calling convention for tls_init.Manman Ren2016-03-183-8/+22
| | | | | | | | | | This makes sure we don't generate a lot of code to spill/reload CSRs when calling tls_init from the access functions. This helps performance when tls_init is not inlined into the access functions. llvm-svn: 263854
* [OPENMP] Implementation of codegen for firstprivate clause of target directiveCarlo Bertolli2016-03-188-0/+882
| | | | | | | | | | | | | | | This patch implements the following aspects: It extends sema to check that a variable is not reference in both a map clause and firstprivate or private. This is needed to ensure correct functioning at codegen level, apart from being useful for the user. It implements firstprivate for target in codegen. The implementation applies to both host and nvptx devices. It adds regression tests for codegen of firstprivate, host and device side when using the host as device, and nvptx side. Please note that the regression test for nvptx codegen is missing VLAs. This is because VLAs currently require saving and restoring the stack which appears not to be a supported operation by nvptx backend. It adds a check in sema regression tests for target map, firstprivate, and private clauses. http://reviews.llvm.org/D18203 llvm-svn: 263837
* Fix printing of anonymous struct typedefs.Steven Watanabe2016-03-185-38/+55
| | | | | | | | | | | | | | | | | | | | | | clang -cc1 -ast-print put the struct definition in the wrong place, like this: struct {} typedef S; The reason that this happens is that the printing code first prints the struct definition, and then tells the next declaration to leave out the type. This behavior is correct for simple variable declarations, but fails for typedefs (or extern, mutable, etc). The patch address this problem by skipping the struct declaration when we first see it, and then telling the first subsequent declaration that it needs to print out the full struct definition. Differential Revision: http://reviews.llvm.org/D17285 llvm-svn: 263836
* [Objective-c] Fix a crash in WeakObjectProfileTy::getBaseInfo.Akira Hatanaka2016-03-182-5/+21
| | | | | | | | | | | | | The crash occurs in WeakObjectProfileTy::getBaseInfo when getBase() is called on an ObjCPropertyRefExpr object whose receiver is an interface. This commit fixes the crash by checking the type of the receiver and setting IsExact to true if it is an interface. rdar://problem/25208167 Differential Revision: http://reviews.llvm.org/D18268 llvm-svn: 263818
OpenPOWER on IntegriCloud