summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Make DiagnosticErrorTrap work even if SuppressAllDiagnostics is enabled.Richard Smith2014-12-051-10/+11
| | | | | | Patch by Brad King! llvm-svn: 223525
* Workaround attribute ordering issue with kernel only attributesMatt Arsenault2014-12-051-0/+10
| | | | | | | | | | | Placing the attribute after the kernel keyword would incorrectly reject the attribute, so use the smae workaround that other kernel only attributes use. Also add a FIXME because there are two different phrasings now for the same error, althoug amdgpu_num_[sv]gpr uses a consistent one. llvm-svn: 223490
* Use else if when checking multiple attributes.Matt Arsenault2014-12-051-4/+2
| | | | | | Only one of these can really match. llvm-svn: 223489
* Modify __has_attribute so that it only looks for GNU-style attributes. ↵Aaron Ballman2014-12-051-1/+1
| | | | | | Removes the ability to look for generic attributes and keywords via this macro, which has the potential to be a breaking change. However, since there is __has_cpp_attribute and __has_declspec_attribute, and given the limited usefulness of querying a generic attribute name regardless of syntax, this seems like the correct path forward. llvm-svn: 223468
* Added a new preprocessor macro: __has_declspec_attribute. This can be used ↵Aaron Ballman2014-12-051-0/+5
| | | | | | as a way to determine whether Clang supports a __declspec spelling for a given attribute, similar to __has_attribute and __has_cpp_attribute. llvm-svn: 223467
* Temporarily reverting r223443 due to bot breakage.Aaron Ballman2014-12-053-187/+140
| | | | llvm-svn: 223465
* clang-format: Support NS_OPTIONS, CF_ENUM and CF_OPTIONS.Daniel Jasper2014-12-052-1/+8
| | | | | | This fixes llvm.org/PR21756. llvm-svn: 223458
* Driver: Objective-C should respect -fno-exceptionsDavid Majnemer2014-12-051-25/+14
| | | | | | | | | | | | Clang attempted to replicate a GCC bug: -fobjc-exceptions forces -fexceptions to be enabled. However, this has unintended effects and other awkard side effects that Clang doesn't "correctly" ape (e.g. it's impossible to turn off C++ exceptions in ObjC++ mode). Instead, -f[no]objc-exceptions and -f[no]cxx-exceptions now have an identical relationship with -f[no]exceptions. llvm-svn: 223455
* Driver: Cleanup -fexceptions behaviorDavid Majnemer2014-12-051-48/+15
| | | | | | | No functionality change is intended, just a cleanup of the logic clang uses to determine what -fexceptions/-fno-exceptions ends up doing. llvm-svn: 223453
* [OPENMP] Codegen for 'omp barrier' directive.Alexey Bataev2014-12-053-42/+48
| | | | | | | | | Adds generation of call to "i32 kmpc_cancel_barrier(ident_t *, i32)" libcall for explicitly specified barriers (OMP_IDENT_BARRIER_EXPL flag is added to "flags" field of "ident_t" structure). Also this patch replaces all calls to "kmpc_barrier" function by calls of "__kmpc_cancel_barrier" function which provides additional functionality for OpenMP 4.0. Also, library specific enum OpenMPLocationFlags moved to private section of CGOpenMPRuntime class to make it more independent from library implementation. Differential Revision: http://reviews.llvm.org/D6447 llvm-svn: 223444
* [modules] Instead of storing absolute paths in a .pcm file, store the path toRichard Smith2014-12-053-140/+187
| | | | | | | | | the root of the module and use paths relative to that directory wherever possible. This is a step towards allowing explicit modules to be relocated without being rebuilt, which is important for some kinds of distributed builds, for good paths in diagnostics, and for appropriate .d output. llvm-svn: 223443
* Have the driver and the target code agree on what the default ABIEric Christopher2014-12-051-1/+36
| | | | | | | | | is for each machine. Fix up darwin tests that were testing for aapcs on armv7-ios when the actual ABI is apcs. Should be no user visible change without -cc1. llvm-svn: 223429
* Use isOSBinFormatMachO() instead of comparing the object formatEric Christopher2014-12-053-4/+3
| | | | | | against an enum. llvm-svn: 223422
* Parse qualifiers after comma in declarator lists as a Microsoft extensionNico Rieck2014-12-041-0/+40
| | | | | | MSVC parses and ignores these with a warning. llvm-svn: 223413
* Recognize __unaligned keyword after type specifierNico Rieck2014-12-041-0/+1
| | | | | | | | The __unaligned keyword can appear after a struct definition: struct foo {...} __unaligned *x; llvm-svn: 223412
* Adding a FIXME to the code, based on a discussion in IRC; NFC.Aaron Ballman2014-12-041-0/+4
| | | | llvm-svn: 223403
* Silence warning: "NOMINMAX" redefined.Yaron Keren2014-12-041-1/+3
| | | | llvm-svn: 223391
* Add attributes for AMDGPU register limits.Matt Arsenault2014-12-042-0/+74
| | | | | | | This is a performance hint that can be applied to kernels to attempt to limit the number of used registers. llvm-svn: 223384
* clang-format: [JS] Don't put top-level dict literals on a single line.Daniel Jasper2014-12-041-0/+3
| | | | | | | These are often used for enums which apparently are easier to read if formatted with one element per line. llvm-svn: 223367
* Fix PR21684 - Ellipsis following an 'auto' parameter sans name/ID Faisal Vali2014-12-041-7/+8
| | | | | | | | should indicate a c++ parameter pack not a c-variadic. int i = [](auto...) { return 0; }(); // OK now. llvm-svn: 223357
* clang-format: More restrictively classify import declarations.Daniel Jasper2014-12-041-1/+2
| | | | | | | | | | | Before: import::SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaa); After: import::SomeFunction(aaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 223345
* [OPENMP] Codegen for 'omp master' directiveAlexey Bataev2014-12-043-3/+86
| | | | | | | | | | | | | | Patch adds 2 library functions to OpenMPRuntime class - int32 kmpc_master(ident_t *, int32 gtid) and void kmpc_end_master(ident_t *, int32 gtid); For 'omp master' directive the next code is generated: if (__kmpc_master(loc, gtid)) { <Associated structured block>; __kmpc_end_master(log, gtid); } Differential Revision: http://reviews.llvm.org/D6473 llvm-svn: 223342
* Always emit kernel arg info for SPIR.Sameer Sahasrabuddhe2014-12-041-4/+4
| | | | | | | | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=21555 Currently, kernel argument metadata is omitted unless the "-cl-kernel-arg-info" option is specified. But the SPIR 1.2 spec requires that all metadata except kernel_arg_name should always be emitted, and kernel_arg_name is only emitted when "-cl-kernel-arg-info" is specified. Patch ported by Ryan Burn from the Khronos SPIR generator. https://github.com/KhronosGroup/SPIR llvm-svn: 223340
* CodeGen: refactor ARM builtin handlingSaleem Abdulrasool2014-12-042-20/+22
| | | | | | | | Create a helper function to construct a value for the ARM hint intrinsic rather than inling the construction. In order to avoid the use of the sentinel value, inline the use of intrinsic instruction retrieval. NFC. llvm-svn: 223338
* Implement __umulh with __int128 arithmeticReid Kleckner2014-12-031-1/+6
| | | | | | Use the same approach as _umul128, but just return the high half. llvm-svn: 223316
* [msan] allow -fsanitize-coverage=N together with -fsanitize=memory, clang partKostya Serebryany2014-12-031-1/+1
| | | | llvm-svn: 223311
* CUDA host device code with two code pathsReid Kleckner2014-12-034-13/+65
| | | | | | | | | | | | | | | | | | | | | | | Summary: Allow CUDA host device functions with two code paths using __CUDA_ARCH__ to differentiate between code path being compiled. For example: __host__ __device__ void host_device_function(void) { #ifdef __CUDA_ARCH__ device_only_function(); #else host_only_function(); #endif } Patch by Jacques Pienaar. Reviewed By: rnk Differential Revision: http://reviews.llvm.org/D6457 llvm-svn: 223271
* Cast vtable address points to i32 (...)** to enable more globaloptReid Kleckner2014-12-031-4/+8
| | | | | | | | | | | | We currently use i32 (...)** as the type of the vptr field in the LLVM struct type. LLVM's GlobalOpt prefers any bitcasts to be on the side of the data being stored rather than on the pointer being stored to. Reviewers: majnemer Differential Revision: http://reviews.llvm.org/D5916 llvm-svn: 223267
* Make ArgumentsAdjuster an std::function.Alexander Kornienko2014-12-033-55/+67
| | | | | | | | | | | | Reviewers: klimek Reviewed By: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6505 llvm-svn: 223248
* clang-format: Fix fake parentheses placement with comments.Daniel Jasper2014-12-031-1/+1
| | | | | | | | | | | | | | | | Before: return (a > b // comment1 // comment2 || c); After: return (a > b // comment1 // comment2 || c); llvm-svn: 223234
* clang-format: Fix expression parser not closing stuff at end of stmt.Daniel Jasper2014-12-031-10/+11
| | | | | | | | | | | | | | Uncovered by a Java test case: Before: public some.package.Type someFunction( // comment int parameter) {} After: public some.package.Type someFunction( // comment int parameter) {} llvm-svn: 223228
* [OPENMP] Code formatting and improvement, no functional changes.Alexey Bataev2014-12-032-22/+18
| | | | llvm-svn: 223225
* Handle delayed corrections in a couple more error paths in ↵Kaelyn Takata2014-12-031-0/+2
| | | | | | ParsePostfixExpressionSuffix. llvm-svn: 223209
* UBSan now uses prologue data instead of prefix dataPeter Collingbourne2014-12-031-6/+6
| | | | | | | | | | | | As the semantics of prefix data has changed. See D6454. Patch by Ben Gamari! Test Plan: Testsuite Differential Revision: http://reviews.llvm.org/D6489 llvm-svn: 223190
* Add support for has_feature(cxx_alignof) and has_feature(c_alignof).Nico Weber2014-12-031-0/+3
| | | | | | | r142020 added support for has_feature(cxx_alignas). This does the same for alignof. llvm-svn: 223186
* Fix incorrect codegen for devirtualized calls to virtual overloaded operators.Nico Weber2014-12-033-59/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider this program: struct A { virtual void operator-() { printf("base\n"); } }; struct B final : public A { virtual void operator-() override { printf("derived\n"); } }; int main() { B* b = new B; -static_cast<A&>(*b); } Before this patch, clang saw the virtual call to A::operator-(), figured out that it can be devirtualized, and then just called A::operator-() directly, without going through the vtable. Instead, it should've looked up which operator-() the call devirtualizes to and should've called that. For regular virtual member calls, clang gets all this right already. So instead of giving EmitCXXOperatorMemberCallee() all the logic that EmitCXXMemberCallExpr() already has, cut the latter function into two pieces, call the second piece EmitCXXMemberOrOperatorMemberCallExpr(), and use it also to generate code for calls to virtual member operators. This way, virtual overloaded operators automatically don't get devirtualized if they have covariant returns (like it was done for regular calls in r218602), etc. This also happens to fix (or at least improve) codegen for explicit constructor calls (`A a; a.A::A()`) in MS mode with -fsanitize-address-field-padding=1. (This adjustment for virtual operator calls seems still wrong with the MS ABI.) llvm-svn: 223185
* PR21706: -Wunsequenced was missing warnings when leaving a sequenced region ↵Richard Smith2014-12-031-5/+6
| | | | | | that contained side effects. llvm-svn: 223184
* FullProduct should be _FullProductDavid Majnemer2014-12-021-2/+2
| | | | llvm-svn: 223179
* Ensure typos in the default values of template parameters get diagnosed.Kaelyn Takata2014-12-021-1/+1
| | | | llvm-svn: 223177
* Intrin: shrx_u64 should be _shrx_u64David Majnemer2014-12-021-1/+1
| | | | llvm-svn: 223176
* Intrin: Add _umul128David Majnemer2014-12-021-3/+12
| | | | | | | | | | | | | | Implement _umul128; it provides the high and low halves of a 128-bit multiply. We can simply use our __int128 arithmetic to implement this, we generate great code for it: movq %rdx, %rax mulq %rcx movq %rdx, (%r8) retq Differential Revision: http://reviews.llvm.org/D6486 llvm-svn: 223175
* InstrProf: Use the same names for variables as we use in the profileJustin Bogner2014-12-022-18/+14
| | | | | | | | There's no need to use different names for the local variables than we use in the profile itself, and it's a bit simpler and easier to debug if we're consistent. llvm-svn: 223173
* InstrProf: Remove some pointless indirection (NFC)Justin Bogner2014-12-022-15/+15
| | | | | | | | It doesn't make much sense to have std::unique_ptrs of std::string and std::vector. Avoid some useless indirection by using these types directly. llvm-svn: 223166
* Diagnose TypoExprs in a couple of error cases in ParsePostfixExpressionSuffix.Kaelyn Takata2014-12-022-3/+7
| | | | | | | Also have CorrectDelayedTyposInExpr check that the Expr* isn't null before trying to access its members. Fixes PR21679. llvm-svn: 223162
* Wrap to 80 columns. No behavior change.Nico Weber2014-12-021-3/+4
| | | | llvm-svn: 223149
* Make le64 DescriptionString consistent with other targets.JF Bastien2014-12-021-1/+1
| | | | | | | | | | | | | | | Summary: In particular, remove the defaults and reorder fields so it matches the result of DataLayout::getStringDescription(). Change by David Neto. Reviewers: dschuff, sdt Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6482 llvm-svn: 223140
* This patch fixes a crash involving use of predefinedFariborz Jahanian2014-12-021-1/+5
| | | | | | | | expressions. It fixes crash when mangling name for block's helper function used inside a constructor/destructor. rdar://19065361. llvm-svn: 223136
* Fix invalid calling convention used for libcalls on ARM.Anton Korobeynikov2014-12-025-9/+52
| | | | | | | | | | | | | | | | ARM ABI specifies that all the libcalls use soft FP ABI (even hard FP binaries). These days clang emits _mulsc3 / _muldc3 calls with default (C) calling convention which would be translated into AAPCS_VFP LLVM calling and thus the result of complex multiplication will be bogus. Introduce a way for a target to specify explicitly calling convention for libcalls. Right now this is temporary correctness fix. Ultimately, we'll end with intrinsic for complex multiplication and all calling convention decisions for libcalls will be put into backend. llvm-svn: 223123
* Reverted r223114, it caused failure on on clang-native-arm-cortex-a9.Serge Pavlov2014-12-022-96/+2
| | | | llvm-svn: 223120
* clang-format: Add option to suppress operator alignment.Daniel Jasper2014-12-022-4/+12
| | | | | | | | | | | | | | | | With alignment: int aaaaaa = aa + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb * cccccccccccccccccccccccccccccccc; Without alignment: int aaaaaa = aa + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb * cccccccccccccccccccccccccccccccc; This fixes llvm.org/PR21666. llvm-svn: 223117
OpenPOWER on IntegriCloud