summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Add NDEBUG checks around LLVM_DUMP_METHOD functions for Wunused-function ↵Eric Christopher2017-11-162-1/+4
| | | | | | warnings. llvm-svn: 318371
* [DeclPrinter] Extract function PrintConstructorInitializers, NFCAlex Lorenz2017-11-161-64/+69
| | | | | | | | Patch by Nikolai Kosjar! Differential Revision: https://reviews.llvm.org/D40066 llvm-svn: 318367
* [DeclPrinter] Honor TerseOutput for constructorsAlex Lorenz2017-11-161-56/+59
| | | | | | | | Patch by Nikolai Kosjar! Differential Revision: https://reviews.llvm.org/D39957 llvm-svn: 318365
* Split x86 "Processor" info into its own def file. [NFC]Erich Keane2017-11-152-281/+9
| | | | | | | | | | | A first step toward removing the repetition of features/CPU info in the x86 target info, this patch pulls all the processor information out into its own .def file. Differential Revision: https://reviews.llvm.org/D40093 llvm-svn: 318343
* [AST, Sema] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2017-11-152-254/+383
| | | | | | other minor fixes (NFC). llvm-svn: 318341
* BuiltinOperatorOverloadBuilder: Don't consider types that are unavailable on ↵Hans Wennborg2017-11-151-71/+70
| | | | | | | | | | | | | the target (PR35174) In the PR, Clang ended up in a situation where it tried to mangle the __float128 type, which isn't supported when targetingt MSVC, because Clang instantiated a variable template with that type when searching for a conversion to use in an arithmetic expression. Differential revision: https://reviews.llvm.org/D39579 llvm-svn: 318309
* ASTMatchers.h: Fix ODR violations by avoiding internal linkage variables in ↵David Blaikie2017-11-151-0/+268
| | | | | | | | | | | | | | headers Internal linkage variables ODR referenced from inline functions create ODR violations (the same inline function ends up having different definitions in each TU, since it references different variables - rather than one definition). This also happens to break modular code generation - so this is the last fix to allow clang to compile with modular code generation. llvm-svn: 318304
* [OpenCL] Fix code generation of function-scope constant samplers.Alexey Bader2017-11-151-0/+4
| | | | | | | | | | | | | | | | | Summary: Constant samplers are handled as static variables and clang's code generation library, which leads to llvm::unreachable. We bypass emitting sampler variable as static since it's translated to a function call later. Reviewers: yaxunl, Anastasia Reviewed By: yaxunl, Anastasia Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D34342 llvm-svn: 318290
* [clang] Expose orderedString from CodeCompletionResult. NFCSam McCall2017-11-151-16/+12
| | | | llvm-svn: 318286
* PR35214: don't crash if we see an array of unknown bound added to an empty ↵Richard Smith2017-11-151-4/+5
| | | | | | but invalid designator. llvm-svn: 318258
* [modules] Fix crash in complex class merging scenario.Richard Smith2017-11-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | When we merge together class definitions, we can end up with the canonical declaration of a field not being the one that was lexically within the canonical definition of the class. Additionally, when we merge class definitions via update records (eg, for a template specialization whose declaration is instantiated in one module and whose definition is instantiated in multiple others), we can end up with the list of lexical contents for the class not including a particular declaration of a field whose lexical parent is that class definition. In the worst case, we have a field whose canonical declaration's lexical parent has no fields, and in that case this attempt to number the fields by walking the fields in the declaration of the class that contained one of the canonical fields will fail. Instead, when numbering fields in a class, do the obvious thing: walk the fields in the definition. I'm still trying to reduce a testcase; the setup that leads to the above scenario seems to be quite fragile. llvm-svn: 318245
* Simplify CpuIs code to use include from LLVMErich Keane2017-11-152-119/+24
| | | | | | | | | | | | LLVM exposes a file in the backend (X86TargetParser.def) that contains information about the correct list of CpuIs values. This patch removes 2 of the copied and pasted versions of this list from clang and instead includes the data from the .def file. Differential Revision: https://reviews.llvm.org/D40054 llvm-svn: 318234
* [PGO] Detect more structural changes with the stable hashVedant Kumar2017-11-141-13/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lifting from Bob Wilson's notes: The hash value that we compute and store in PGO profile data to detect out-of-date profiles does not include enough information. This means that many significant changes to the source will not cause compiler warnings about the profile being out of date, and worse, we may continue to use the outdated profile data to make bad optimization decisions. There is some tension here because some source changes won't affect PGO and we don't want to invalidate the profile unnecessarily. This patch adds a new hashing scheme which is more sensitive to loop nesting, conditions, and out-of-order control flow. Here are examples which show snippets which get the same hash under the current scheme, and different hashes under the new scheme: Loop Nesting Example -------------------- // Snippet 1 while (foo()) { while (bar()) {} } // Snippet 2 while (foo()) {} while (bar()) {} Condition Example ----------------- // Snippet 1 if (foo()) bar(); baz(); // Snippet 2 if (foo()) bar(); else baz(); Out-of-order Control Flow Example --------------------------------- // Snippet 1 while (foo()) { if (bar()) {} baz(); } // Snippet 2 while (foo()) { if (bar()) continue; baz(); } In each of these cases, it's useful to differentiate between the snippets because swapping their profiles gives bad optimization hints. The new hashing scheme considers some logical operators in an effort to detect more changes in conditions. This isn't a perfect scheme. E.g, it does not produce the same hash for these equivalent snippets: // Snippet 1 bool c = !a || b; if (d && e) {} // Snippet 2 bool f = d && e; bool c = !a || b; if (f) {} This would require an expensive data flow analysis. Short of that, the new hashing scheme looks reasonably complete, based on a scan over the statements we place counters on. Profiles which use the old version of the PGO hash remain valid and can be used without issue (there are tests in tree which check this). rdar://17068282 Differential Revision: https://reviews.llvm.org/D39446 llvm-svn: 318229
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-141-32/+40
| | | | | | minor fixes (NFC). llvm-svn: 318221
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-141-46/+62
| | | | | | minor fixes (NFC). llvm-svn: 318216
* [refactor][selection] canonicalize decl ref callee to the call exprAlex Lorenz2017-11-141-13/+48
| | | | | | | We would like to extract the full call when just the callee function is selected llvm-svn: 318215
* [refactor][selection] canonicalize member expr callee to the fullAlex Lorenz2017-11-141-1/+12
| | | | | | | | member call expression We would like to extract the full call when just the callee is selected. llvm-svn: 318205
* Switch -mcount and -finstrument-functions to emit EnterExitInstrumenter ↵Hans Wennborg2017-11-144-38/+22
| | | | | | | | | | | | | | | | attributes This updates -mcount to use the new attribute names (LLVM r318195), and switches over -finstrument-functions to also use these attributes rather than inserting instrumentation in the frontend. It also adds a new flag, -finstrument-functions-after-inlining, which makes the cygprofile instrumentation get inserted after inlining rather than before. Differential Revision: https://reviews.llvm.org/D39331 llvm-svn: 318199
* [OPENMP] Fix DSA analysis for threadprivates after deserialization.Alexey Bataev2017-11-141-0/+6
| | | | | | | If threadprivate vaible is deserialized, it is not marked as threadprivate in DSAStack. llvm-svn: 318194
* [refactor][extract] avoid extracting expressions from types in functionsAlex Lorenz2017-11-141-2/+4
| | | | llvm-svn: 318169
* Make DiagnosticIDs::getAllDiagnostics static. NFC.Gabor Horvath2017-11-142-2/+2
| | | | | | | | Patch by: Andras Leitereg! Differential Revision: https://reviews.llvm.org/D39372 llvm-svn: 318150
* [ASTImporter] TypeAliasTemplate and PackExpansion importing capabilityGabor Horvath2017-11-141-0/+83
| | | | | | | | Patch by: Zoltan Gera! Differential Revision: https://reviews.llvm.org/D39247 llvm-svn: 318147
* Refactor ContinuationIndenter's breakProtrudingToken logic.Manuel Klimek2017-11-143-64/+97
| | | | | | | | | | | Create more orthogonal pieces. The restructuring made it easy to try out several alternatives to D33589, and while none of the alternatives turned out to be the right solution, the underlying simplification of the structure is helpful. Differential Revision: https://reviews.llvm.org/D39900 llvm-svn: 318141
* [NewPassManager] Pass the -fdebug-pass-manager flag setting into the ↵Craig Topper2017-11-141-4/+4
| | | | | | | | | | | | | | | | Analysis managers to match what we do in opt Summary: Currently the -fdebug-pass-manager flag for clang doesn't enable the debug logging in the analysis managers. This is different than what the switch does when passed to opt. Reviewers: chandlerc Reviewed By: chandlerc Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40007 llvm-svn: 318140
* [PM] Wire up support for the bounds checking sanitizer with the new PM.Chandler Carruth2017-11-141-0/+14
| | | | | | | | | | | | | | | Not much interesting here. Mostly wiring things together. One thing worth noting is that the approach is substantially different from the old PM. Here, the -O0 case works fundamentally differently in that we just directly build the pipeline without any callbacks or other cruft. In some ways, this is nice and clean. However, I don't like that it causes the sanitizers to be enabled with different changes at different times. =/ Suggestions for a better way to do this are welcome. Differential Revision: https://reviews.llvm.org/D39085 llvm-svn: 318131
* [PM] Add a missing header that I had in the next commit but was neededChandler Carruth2017-11-141-0/+1
| | | | | | in r318128. Should fix the build. llvm-svn: 318130
* [completion] complete ObjC interface names in an expressionAlex Lorenz2017-11-142-3/+14
| | | | | | | | Objective-C interfaces can be used in a class property expression. rdar://26982192 llvm-svn: 318129
* [PM] Port BoundsChecking to the new PM.Chandler Carruth2017-11-141-1/+1
| | | | | | | | | | | Registers it and everything, updates all the references, etc. Next patch will add support to Clang's `-fexperimental-new-pass-manager` path to actually enable BoundsChecking correctly. Differential Revision: https://reviews.llvm.org/D39084 llvm-svn: 318128
* [Sema] Stable sort OverloadCandidates to remove non-deterministic orderingMandeep Singh Grang2017-11-141-1/+1
| | | | | | | | | | | | | | | | Summary: This fixes failure in Misc/diag-template-diffing.cpp uncovered by D39245. Reviewers: rjmccall, rsmith Reviewed By: rjmccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D39944 llvm-svn: 318121
* Update link to protobufHans Wennborg2017-11-131-1/+1
| | | | llvm-svn: 318110
* Update a link to the old code.google.com bug trackerHans Wennborg2017-11-131-1/+1
| | | | llvm-svn: 318109
* [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other ↵Eugene Zelenko2017-11-131-40/+62
| | | | | | minor fixes (NFC). llvm-svn: 318101
* OpenCL: Assume inline asm is convergentMatt Arsenault2017-11-131-4/+5
| | | | | | Already done for CUDA. llvm-svn: 318098
* [CodeGen] fix const-ness of cbrt and fmaSanjay Patel2017-11-132-16/+30
| | | | | | | | | | | cbrt() is always constant because it can't overflow or underflow. Therefore, it can't set errno. fma() is not always constant because it can overflow or underflow. Therefore, it can set errno. But we know that it never sets errno on GNU / MSVC, so make it constant in those environments. Differential Revision: https://reviews.llvm.org/D39641 llvm-svn: 318093
* [clang] Remove redundant return [NFC]Mandeep Singh Grang2017-11-133-5/+0
| | | | | | | | | | | | | | Reviewers: rsmith, sfantao, mcrosier Reviewed By: mcrosier Subscribers: jholewinski, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D39915 llvm-svn: 318074
* [analyzer] ObjCGenerics: Don't warn on cast conversions involving explicit castDevin Coughlin2017-11-131-16/+16
| | | | | | | | | | | | | | | | | | | | | | The ObjCGenerics checker warns on a cast when there is no subtyping relationship between the tracked type of the value and the destination type of the cast. It does this even if the cast was explicitly written. This means the user can't write an explicit cast to silence the diagnostic. This commit treats explicit casts involving generic types as an indication from the programmer that the Objective-C type system is not rich enough to express the needed invariant. On explicit casts, the checker now removes any existing information inferred about the type arguments. Further, it no longer assumes the casted-to specialized type because the invariant the programmer specifies in the cast may only hold at a particular program point and not later ones. This prevents a suppressing cast from requiring a cascade of casts down the line. rdar://problem/33603303 Differential Revision: https://reviews.llvm.org/D39711 llvm-svn: 318054
* [ThinLTO] Handle -fdebug-pass-manager for backend invocations via clangTeresa Johnson2017-11-131-0/+1
| | | | | | | | | | | | | Recommit of r317951 and r317951 along with what I believe should fix the remaining buildbot failures - the target triple should be specified for both the ThinLTO pre-thinlink compile and backend (post-thinlink) compile to ensure it is consistent. Original description: The LTO Config field wasn't being set when invoking a ThinLTO backend via clang (i.e. for distributed builds). llvm-svn: 318042
* [X86] test/testn intrinsics lowering to IR. clang sideUriel Korach2017-11-134-162/+128
| | | | | | | | | Change Header files of the intrinsics for lowering test and testn intrinsics to IR code. Removed test and testn builtins from clang Differential Revision: https://reviews.llvm.org/D38737 llvm-svn: 318035
* [x86][AVX512] Lowering shuffle i/f intrinsics to LLVM IRJina Nahias2017-11-132-105/+125
| | | | | | | | | This patch, together with a matching llvm patch (https://reviews.llvm.org/D38671), implements the lowering of X86 shuffle i/f intrinsics to IR. Differential Revision: https://reviews.llvm.org/D38672 Change-Id: I9b3c2f2b34323bd9ccb21d0c1832f848b88ec047 llvm-svn: 318025
* Add ObjC exception statement AST matchersDave Lee2017-11-111-0/+4
| | | | | | | | | | | | | | Summary: Add AST matchers for Objective-C @throw, @try, @catch and @finally. Reviewers: aaron.ballman, malcolm.parsons, alexshap, compnerd Reviewed By: aaron.ballman Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D39940 llvm-svn: 317992
* Adjust r316292 - remove the anonymous union for sharing a bitfield in ↵Faisal Vali2017-11-112-3/+2
| | | | | | | | | | | | | | FunctionDecl. The anonymous union did NOT save us storage, but instead behaved as if we added an additional integer data member to FunctionDecl. For additional context, the anonymous union renders the bit fields as non-adjacent and prevents them from sharing the same 'memory location' (i.e. bit-storage) by requiring the anonymous union object to be appropriately aligned. This was confirmed through discussion with Richard Smith in Albuquerque (ISO C++ Meeting) https://reviews.llvm.org/rL316292 llvm-svn: 317984
* [coroutines] Promote cleanup.dest.slot allocas to registers to avoid storing ↵Gor Nishanov2017-11-112-17/+35
| | | | | | | | | | | | | | | | | | | | | | it in the coroutine frame Summary: We don't want to store cleanup dest slot saved into the coroutine frame (as some of the cleanup code may access them after coroutine frame destroyed). This is an alternative to https://reviews.llvm.org/D37093 It is possible to do this for all functions, but, cursory check showed that in -O0, we get slightly longer function (by 1-3 instructions), thus, we are only limiting cleanup.dest.slot elimination to coroutines. Reviewers: rjmccall, hfinkel, eric_niebler Reviewed By: eric_niebler Subscribers: EricWF, cfe-commits Differential Revision: https://reviews.llvm.org/D39768 llvm-svn: 317981
* [CUDA] Fix std::min on device side to return the min, not the max.Justin Lebar2017-11-111-1/+1
| | | | | | | | | | | | | | | | Summary: How embarrassing. This is tested in the test-suite -- fix to come there in a separate patch. Reviewers: tra Subscribers: sanjoy, cfe-commits Differential Revision: https://reviews.llvm.org/D39817 llvm-svn: 317961
* Add CLANG_DEFAULT_OBJCOPY to allow Clang to use llvm-objcopy for dwarf fissionJake Ehrlich2017-11-113-42/+43
| | | | | | | | | | | | llvm-objcopy is getting to where it can be used in non-trivial ways (such as for dwarf fission in clang). It now supports dwarf fission but this feature hasn't been thoroughly tested yet. This change allows people to optionally build clang to use llvm-objcopy rather than GNU objcopy. By default GNU objcopy is still used so nothing should change. Differential Revision: https://reviews.llvm.org/D39029 llvm-svn: 317960
* Revert "[ThinLTO] Handle -fdebug-pass-manager for backend invocations via clang"Teresa Johnson2017-11-111-1/+0
| | | | | | | This reverts commit r317951 and r317952. The new test is aborting on some bots and I'll need to investigate later. llvm-svn: 317959
* Handle lambda captures of variable length arrays in profiling and printing.Richard Trieu2017-11-112-0/+6
| | | | | | | | From http://reviews.llvm.org/D4368 these cases were thought to not be reachable and the checks removed before the rest of the code was committed in r216649. However, these cases are reachable and the checks are added back. llvm-svn: 317957
* [Serialization] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko2017-11-113-113/+176
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 317953
* [ThinLTO] Handle -fdebug-pass-manager for backend invocations via clangTeresa Johnson2017-11-101-0/+1
| | | | | | | | | | | | | | Summary: The LTO Config field wasn't being set when invoking a ThinLTO backend via clang (i.e. for distributed builds). Reviewers: danielcdh Subscribers: mehdi_amini, inglorion, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D39923 llvm-svn: 317951
* Remove declaration of EmitMCountInstrumentation(). NFCHans Wennborg2017-11-101-3/+0
| | | | | | The definition was removed in r280355. llvm-svn: 317944
* AMDGPU/NFC: Move getAMDGPUTargetFeatures to AMDGPU toolchainKonstantin Zhuravlyov2017-11-103-19/+24
| | | | | | Differential Revision: https://reviews.llvm.org/D39877 llvm-svn: 317909
OpenPOWER on IntegriCloud