summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Added Fixer implementation and fix() interface in clang-format for removing ↵Eric Liu2016-04-255-258/+665
| | | | | | | | | | | | | | | | | redundant code. Summary: After applying replacements, redundant code like extra commas or empty namespaces might be introduced. Fixer can detect and remove any redundant code introduced by replacements. The current implementation only handles redundant commas. Reviewers: djasper, klimek Subscribers: ioeric, mprobst, klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D18551 llvm-svn: 267416
* [Clang][Builtin][AVX512]Adding intrinsics for vfpclass{sd|ss} ↵Michael Zuckerman2016-04-252-0/+83
| | | | | | | | vfpclass{pd|ps} instruction set Differential Revision: http://reviews.llvm.org/D19476 llvm-svn: 267414
* [analyzer] Let TK_PreserveContents span across the whole base region.Artem Dergachev2016-04-252-2/+2
| | | | | | | | | | | | If an address of a field is passed through a const pointer, the whole structure's base region should receive the TK_PreserveContents trait and avoid invalidation. Additionally, include a few FIXME tests shown up during testing. Differential Revision: http://reviews.llvm.org/D19057 llvm-svn: 267413
* [Clang][AVX512][BUILTIN] Adding intrinsics for ↵Michael Zuckerman2016-04-252-0/+119
| | | | | | | | VSCATTERPF{1|0}{DPS|QPS|DPD|QPD} instruction set Differential Revision: http://reviews.llvm.org/D19313 llvm-svn: 267398
* [OPENMP 4.5] Codegen for 'taskloop' directive.Alexey Bataev2016-04-255-77/+550
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The taskloop construct specifies that the iterations of one or more associated loops will be executed in parallel using OpenMP tasks. The iterations are distributed across tasks created by the construct and scheduled to be executed. The next code will be generated for the taskloop directive: #pragma omp taskloop num_tasks(N) lastprivate(j) for( i=0; i<N*GRAIN*STRIDE-1; i+=STRIDE ) { int th = omp_get_thread_num(); #pragma omp atomic counter++; #pragma omp atomic th_counter[th]++; j = i; } Generated code: task = __kmpc_omp_task_alloc(NULL,gtid,1,sizeof(struct task),sizeof(struct shar),&task_entry); psh = task->shareds; psh->pth_counter = &th_counter; psh->pcounter = &counter; psh->pj = &j; task->lb = 0; task->ub = N*GRAIN*STRIDE-2; task->st = STRIDE; __kmpc_taskloop( NULL, // location gtid, // gtid task, // task structure 1, // if clause value &task->lb, // lower bound &task->ub, // upper bound STRIDE, // loop increment 0, // 1 if nogroup specified 2, // schedule type: 0-none, 1-grainsize, 2-num_tasks N, // schedule value (ignored for type 0) (void*)&__task_dup_entry // tasks duplication routine ); llvm-svn: 267395
* [Clang][AVX512][BuiltIn] Adding support to intrinsics of VPERMD and VPERMW ↵Michael Zuckerman2016-04-256-0/+468
| | | | | | | | instruction set Differential Revision: http://reviews.llvm.org/D19195 llvm-svn: 267380
* Debug info: Apply an empty debug location for global OpenMP destructors.Adrian Prantl2016-04-241-0/+3
| | | | | | | | | | | | LLVM really wants a debug location on every inlinable call in a function with debug info, because it otherwise cannot set up inlining debug info. This change applies an artificial line 0 debug location (which is how DWARF marks automatically generated code that has no corresponding source code) to the .__kmpc_global_dtor_. functions to avoid the LLVM Verifier complaining. llvm-svn: 267369
* clang-format: [JS] generator and async functions.Martin Probst2016-04-244-11/+35
| | | | | | | | | | | | | | | For generators, see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_generators async functions are not quite in the spec yet, but stage 3 and already widely used: http://tc39.github.io/ecmascript-asyncawait/ Reviewers: djasper Subscribers: klimek Differential Revision: http://reviews.llvm.org/D19204 llvm-svn: 267368
* Improve diagnostic checking for va_start to also warn on other instances of ↵Aaron Ballman2016-04-241-3/+10
| | | | | | | | undefined behavior, such as a parameter declared with the register keyword in C, or a parameter of a type that undergoes default argument promotion. This helps cover some more of the CERT secure coding rule EXP58-CPP. Pass an object of the correct type to va_start (https://www.securecoding.cert.org/confluence/display/cplusplus/EXP58-CPP.+Pass+an+object+of+the+correct+type+to+va_start). llvm-svn: 267338
* Fix a couple assertions that can never fire because the condition ANDed with ↵Craig Topper2016-04-242-2/+2
| | | | | | the string is just true or 1. llvm-svn: 267313
* DebugInfo: Adapt to loss of DITypeRef in LLVM r267296Duncan P. N. Exon Smith2016-04-231-5/+3
| | | | | | | | | | | | | LLVM stopped using MDString-based type references, and DIBuilder no longer fills 'retainedTypes:' with every DICompositeType that has an 'identifier:' field. There are just minor changes to keep the same behaviour in CFE. Leaving 'retainedTypes:' unfilled has a dramatic impact on the output order of the IR though. There are a huge number of testcase changes, which were unfortunately not really scriptable. llvm-svn: 267297
* Revert the bool portion of r267054Richard Trieu2016-04-221-12/+4
| | | | | | | Remove the floating point to bool conversion warnings. Some of these conversions will be caught by -Wliteral-conversion and -Wfloat-conversion llvm-svn: 267234
* PGO] PGOFuncName meta data if PGOFuncName is different from function's raw nameRong Xu2016-04-221-0/+2
| | | | | | | | | | Write out the PGOFuncName meta data if PGOFuncName is different from function's raw name. This should only apply to internal linkage functions. This is to be consumed by indirect-call promotion when called in LTO optimization pass. Differential Revision: http://reviews.llvm.org/D18624 llvm-svn: 267224
* Fix a bug involving deferred decl emission and PCHReid Kleckner2016-04-221-2/+18
| | | | | | | | | | | | | | | | For various reasons, involving dllexport and class linkage compuations, we have to wait until after the semicolon after a class declaration to emit inline methods. These are "deferred" decls. Before this change, finishing the tag decl would trigger us to deserialize some PCH so that we could make a "pretty" IR-level type. Deserializing the PCH triggered calls to HandleTopLevelDecl, which, when done, checked the deferred decl list, and emitted some dllexported decls that weren't ready. Avoid this re-entrancy. Deferred decls should not get emitted when a tag is finished, they should only be emitted after a real top level decl in the main file. llvm-svn: 267186
* [clang][AVX512][Builtin] adding intrinsics for vf{n}madd{ss|sd} and ↵Michael Zuckerman2016-04-221-0/+431
| | | | | | | | vf{n}sub{ss|sd} instruction set Differential Revision: http://reviews.llvm.org/D19320 llvm-svn: 267135
* [Clang][AVX512][BUILTIN] Adding scalar intrinsics for rsqrt14 ,rcp14, getexp ↵Michael Zuckerman2016-04-221-0/+215
| | | | | | | | and getmant instruction set Differential Revision: http://reviews.llvm.org/D19326 llvm-svn: 267129
* [OPENMP] Fix for PR27463: Privatizing struct fields with array typeAlexey Bataev2016-04-221-1/+1
| | | | | | | | | | causes code generation failure. The codegen part of firstprivate clause for member decls used type of original variable without skipping reference type from OMPCapturedExprDecl. Patch fixes this problem. llvm-svn: 267125
* [index] Add SymbolSubKinds for ObjC IB annotations.Argyrios Kyrtzidis2016-04-221-0/+17
| | | | llvm-svn: 267118
* [index] Add a SymbolSubKind for an ObjC unit test.Argyrios Kyrtzidis2016-04-221-1/+35
| | | | llvm-svn: 267117
* [index] Change SymbolCXXTemplateKind to a 'SymbolSubKinds' bitset.Argyrios Kyrtzidis2016-04-221-19/+41
| | | | | | This provides a more general and flexible way to annotate special symbols. llvm-svn: 267116
* [OPENMP] Fix for LCV in simd directives in explicit clauses.Alexey Bataev2016-04-223-114/+204
| | | | | | | | If loop control variable for simd-based directives is explicitly marked as linear/lastprivate in clauses, codegen for such construct would crash. Patch fixes this problem. llvm-svn: 267101
* [CUDA] removed unneeded __nvvm_reflect_anchor()Artem Belevich2016-04-211-10/+0
| | | | | | | | | Since r265060 LLVM infers correct __nvvm_reflect attributes, so explicit declaration of __nvvm_reflect() is no longer needed. Differential Revision: http://reviews.llvm.org/D19074 llvm-svn: 267062
* [esan] EfficiencySanitizer driver flagsDerek Bruening2016-04-215-1/+36
| | | | | | | | | | | | | | | | Summary: Adds a framework to enable the instrumentation pass for the new EfficiencySanitizer ("esan") family of tools. Adds a flag for esan's cache fragmentation tool via -fsanitize=efficiency-cache-frag. Adds appropriate tests for the new flag. Reviewers: eugenis, vitalybuka, aizatsky, filcab Subscribers: filcab, kubabrecka, llvm-commits, zhaoqin, kcc Differential Revision: http://reviews.llvm.org/D19169 llvm-svn: 267059
* Split interesting warnings off from -Wfloat-conversionRichard Trieu2016-04-212-27/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restructure the implict floating point to integer conversions so that interesting sub-groups are under different flags. Breakdown of warnings: No warning: Exact conversions from floating point to integer: int x = 10.0; int x = 1e10; -Wliteral-conversion - Floating point literal to integer with rounding: int x = 5.5; int x = -3.4; -Wfloat-conversion - All conversions not covered by the above two: int x = GetFloat(); int x = 5.5 + 3.5; -Wfloat-zero-conversion - The expression converted has a non-zero floating point value that gets converted to a zero integer value, excluded the cases falling under -Wliteral-conversion. Subset of -Wfloat-conversion. int x = 1.0 / 2.0; -Wfloat-overflow-conversion - The floating point value is outside the range of the integer type, exluding cases from -Wliteral conversion. Subset of -Wfloat-conversion. char x = 500; char x = -1000; -Wfloat-bool-conversion - Any conversion of a floating point type to bool. Subset of -Wfloat-conversion. if (GetFloat()) {} bool x = 5.0; -Wfloat-bool-constant-conversion - Conversion of a compile time evaluatable floating point value to bool. Subset of -Wfloat-bool-conversion. bool x = 1.0; bool x = 4.0 / 20.0; Also add EvaluateAsFloat to Sema, which is similar to EvaluateAsInt, but for floating point values. llvm-svn: 267054
* clang-cl: Don't assert on using /Yc with non-source files, PR27450Nico Weber2016-04-211-19/+19
| | | | | | Move phase handling after input type validation. llvm-svn: 267040
* [Hexagon] Define architecture version macros for hexagonv55Krzysztof Parzyszek2016-04-211-0/+5
| | | | llvm-svn: 266989
* [Clang][AVX512][BuiltIn] Adding intrinsics of VGATHER{DPS|DPD} , ↵Michael Zuckerman2016-04-215-0/+217
| | | | | | | | VPGATHER{QD|QQ|DD|DQ} and VGATHERPF{0|1}{DPS|QPS|DPD|QPD} instruction set . Differential Revision: http://reviews.llvm.org/D19224 llvm-svn: 266983
* Correctly parse GCC-style asm line following MS-style asm line.Denis Zobnin2016-04-212-25/+38
| | | | | | | | | | | | | | Quit parsing MS-style inline assembly if the following statement has GCC style. Enables compilation of code like void f() { __asm mov ebx, ecx __asm__("movl %ecx, %edx"); } Differential Revision: http://reviews.llvm.org/D18652 llvm-svn: 266976
* [Tooling] Inject -resource-dir instead of overwriting argv[0].Benjamin Kramer2016-04-211-8/+23
| | | | | | | | | This allows using a different standard library (the one from argv[0] in the compilation database) with the correct builtins. Differential Revision: http://reviews.llvm.org/D19356 llvm-svn: 266973
* Compilation for Intel MCU (Part 1/3)Andrey Turetskiy2016-04-212-8/+40
| | | | | | | | | | | Add -miamcu option which: * Sets IAMCU triple * Sets IAMCU ABI * Enforces static compilation Differential Revision: http://reviews.llvm.org/D18398 llvm-svn: 266972
* [modules] Make the tweak to avoid circular inclusion of emmintrin.h andRichard Smith2016-04-212-12/+5
| | | | | | | | | xmmintrin.h a bit more directed. If for whatever reason modules are enabled but we textually include one of these headers, don't deploy the special case for modules. To make this work cleanly, extend __building_module to be defined even when modules is disabled. llvm-svn: 266945
* Module Debugging: Emit the canonical debug info for Objective-C classesAdrian Prantl2016-04-201-2/+5
| | | | | | | | | | | | | in the compile unit that contains their implementation even if their interface is declared in a module. The private @implementation of an @interface may have additional hidden ivars so we should not defer to the public version of the type that is found in the module. <rdar://problem/25541798> llvm-svn: 266937
* [Tooling] Fix getting fully qualified names of template alias types.Chaoren Lin2016-04-201-0/+2
| | | | | | | | | | Reviewers: rsmith, rnk Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D19253 llvm-svn: 266925
* [OPENMP] Codegen for untied tasks.Alexey Bataev2016-04-204-79/+185
| | | | | | | | If the untied clause is present on a task construct, any thread in the team can resume the task region after a suspension. Patch adds proper codegen for untied tasks. llvm-svn: 266853
* Enable ODR uniquing of DITypes for ThinLTO backendsTeresa Johnson2016-04-201-0/+5
| | | | | | | | | | | | | | | | | Summary: This is a follow-on to apply Duncan's new DIType ODR uniquing from r266549 and r266713 in more places. When invoking ThinLTO backend compiles via clang (for a distributed build), invoke enableDebugTypeODRUniquing() before parsing the module. Reviewers: dexonsmith, joker.eph Subscribers: llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D19264 llvm-svn: 266852
* [Parse] Reuse OptionUnroll rather than matching it again. NFCAdam Nemet2016-04-191-2/+1
| | | | llvm-svn: 266829
* [Parse] Use StringSwitch to improve readability. NFCAdam Nemet2016-04-191-4/+8
| | | | | | | | A subsequent patch will propose a "distribute" loop hint. Similarly to unroll, this does not have a "assume_safety" argument either so this condition will get more complex. llvm-svn: 266827
* [AArch64] Fix D19098 fallout.Marcin Koscielnicki2016-04-191-5/+0
| | | | | | | | | | The intrinsic is now called llvm.thread.pointer, not llvm.aarch64.thread.pointer. Also, the code handling it in CGBuiltin.cpp is dead - it's already covered by GCCBuiltin. Remove it. Differential Revision: http://reviews.llvm.org/D19099 llvm-svn: 266817
* [ARM NEON] Define vfms_f32 on ARM, and all vfms using vfma.Ahmed Bougacha2016-04-191-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r259537 added vfma/vfms to armv7, but the builtin was only lowered on the AArch64 side. Instead of supporting it on ARM, get rid of it. The vfms builtin lowered to: %nb = fsub float -0.0, %b %r = @llvm.fma.f32(%a, %nb, %c) Instead, define the operation in terms of vfma, and swap the multiplicands. It now lowers to: %na = fsub float -0.0, %a %r = @llvm.fma.f32(%na, %b, %c) This matches the instruction more closely, and lets current LLVM generate the "natural" operand ordering: fmls.2s v0, v1, v2 instead of the crooked (but equivalent): fmls.2s v0, v2, v1 Except for theses changes, assembly is identical. LLVM accepts both commutations, and the LLVM tests in: test/CodeGen/AArch64/arm64-fmadd.ll test/CodeGen/AArch64/fp-dp3.ll test/CodeGen/AArch64/neon-fma.ll test/CodeGen/ARM/fusedMAC.ll already check either the new one only, or both. Also verified against the test-suite unittests. llvm-svn: 266807
* Fixed a bug in AnnotatedLine::startsWith when there are comments in the line.Eric Liu2016-04-191-4/+13
| | | | | | | | | | | | Summary: When there are comments in the line, one token may be checked multiple times. Reviewers: mprobst, djasper Subscribers: ioeric, cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D19106 llvm-svn: 266803
* ObjC Class Property: don't emit class properties on old deployment targets.Manman Ren2016-04-191-0/+9
| | | | | | | | For old deployment targets, emit nil for all class property lists. rdar://25616128 llvm-svn: 266800
* Fix PR26999 better- RenderDebugEnablingArgs() once onlyDouglas Katzman2016-04-191-22/+22
| | | | llvm-svn: 266797
* reuse mustBeJSIdent for interface detectionMartin Probst2016-04-191-7/+8
| | | | llvm-svn: 266790
* clang-format: [JS] support `interface` as a free standing identifier.Martin Probst2016-04-191-0/+15
| | | | | | | | | | | | | | | Summary: `interface` can be used as a fee standing identifier in JavaScript/TypeScript. This change uses the heuristic of whether it's followed by another identifier as an indication. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D19240 llvm-svn: 266789
* reduce indentation; NFCISanjay Patel2016-04-191-9/+6
| | | | llvm-svn: 266787
* [CodeGen] Widen non-power-of-2 vector HFA base types.Ahmed Bougacha2016-04-191-1/+12
| | | | | | | | | | | | | | | | | | | | | | | Currently, for the ppc64--gnu and aarch64 ABIs, we recognize: typedef __attribute__((__ext_vector_type__(3))) float v3f32; typedef __attribute__((__ext_vector_type__(16))) char v16i8; struct HFA { v3f32 a; v16i8 b; }; as an HFA. Since the first type encountered is used as the base type, we pass the HFA as: [2 x <3 x float>] Which leads to incorrect IR (relying on padding values) when the second field is used. Instead, explicitly widen the vector (after size rounding) in isHomogeneousAggregate. Differential Revision: http://reviews.llvm.org/D18998 llvm-svn: 266784
* [CodeGen] Fix whitespace. NFC.Ahmed Bougacha2016-04-191-1/+1
| | | | llvm-svn: 266783
* Pass dwarf-version to cc1as.Douglas Katzman2016-04-191-0/+6
| | | | | | Fix PR26999 - crashing in cc1as with any '*bsd' target. llvm-svn: 266775
* reduce indentation; NFCISanjay Patel2016-04-191-10/+7
| | | | llvm-svn: 266765
* [Clang][Builtin][AVX512] Adding intrinsics for VGETMANT{PD|PS} and ↵Michael Zuckerman2016-04-192-0/+257
| | | | | | | | VGETEXP{PD|PS} instruction set Differential Revision: http://reviews.llvm.org/D19197 llvm-svn: 266763
OpenPOWER on IntegriCloud