summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Objective-C ARC. Allow conversion of (void*) pointers toFariborz Jahanian2014-06-184-7/+21
| | | | | | | retainable ObjC pointers without requiring a bridge-cast by recognizing this as a +0 context. // rdar://16627903 llvm-svn: 211234
* tests: relax ms-intrinsics testSaleem Abdulrasool2014-06-181-17/+14
| | | | | | | | | | Relax the tests to allow for differences between release and debug builds. This should fix the buildbots. Thanks to Benjamin Kramer and Eric Christo for their invaluable tip that this was release build specific issue. llvm-svn: 211227
* Relax the cl-inputs.c test a little bit in case link.exe is on PATHReid Kleckner2014-06-181-2/+2
| | | | llvm-svn: 211224
* [MS-ABI] Implement typeidWarren Hunt2014-06-181-0/+58
| | | | | | | This patch enables clang to generate calls to __RTtypeid when lowering typeid on win32 targets. Test cases are included. llvm-svn: 211223
* CodeGen: improve ms instrincics supportSaleem Abdulrasool2014-06-181-0/+41
| | | | | | | | | Add support for _InterlockedCompareExchangePointer, _InterlockExchangePointer, _InterlockExchange. These are available as a compiler intrinsic on ARM and x86. These are used directly by the Windows SDK headers without use of the intrin header. llvm-svn: 211216
* Objective-C. Check for integer overflow in Objective-C'sFariborz Jahanian2014-06-181-1/+19
| | | | | | boxed expression. // rdar://16417427 llvm-svn: 211215
* [analyzer] Don't create new PostStmt nodes if we don't have to.Jordan Rose2014-06-181-0/+27
| | | | | | | | Doing this caused us to mistakenly think we'd seen a particular state before when we actually hadn't, which resulted in false negatives. Credit to Rafael Auler for discovering this issue! llvm-svn: 211209
* Objective-C. Try to fix the test in buildbot in my last patch.Fariborz Jahanian2014-06-181-1/+1
| | | | llvm-svn: 211197
* Objective-C. Attributes on class declarations carry overFariborz Jahanian2014-06-181-1/+28
| | | | | | | to forward class declarations for diagnosis. // rdar://16681279 llvm-svn: 211195
* Make clang-cl accept .lib inputs (PR20065)Hans Wennborg2014-06-182-0/+9
| | | | | | | | | | Patch by Ehsan Akhgari! (Tiny tweak by me: renamed PathSegment to LibDir.) Differential Revision: http://reviews.llvm.org/D4192 llvm-svn: 211189
* Driver: correct the backend option spellingSaleem Abdulrasool2014-06-181-3/+3
| | | | | | The backend option does not have an '-enable' prefix. llvm-svn: 211177
* Inherit dll attributes to static localsHans Wennborg2014-06-182-0/+25
| | | | | | | | This makes us handle static locals in exported/imported functions correctly. Differential Revision: http://reviews.llvm.org/D4136 llvm-svn: 211173
* AArch64: re-enable tests that were looking for a non-existent backend.Tim Northover2014-06-1832-32/+32
| | | | | | | | In the final phase of the merge, I managed to disable a bunch of Clang tests accidentally. Fortunately none of them seem to have broken in the interim. llvm-svn: 211149
* [OPENMP] Initial support for '#pragma omp for' (fixed incompatibility with ↵Alexey Bataev2014-06-1810-107/+2353
| | | | | | MSVC). llvm-svn: 211140
* Fix bug in code for avoiding dynamic initialization of dllimport globalsHans Wennborg2014-06-181-0/+18
| | | | | | | | | | | | | When instantiating dllimport variables with dynamic initializers, don't bail out of Sema::InstantiateVariableInitializer without calling PopExpressionEvaluationContext(). This was causing a stale object to stay on the ExprEvalContexts stack, causing subsequent calls to getCurrentMangleNumberContext() to fail, resulting in incorrect numbering of static locals (and probably other broken things). llvm-svn: 211137
* Objective-C ARC. Do not warn about properties with bothFariborz Jahanian2014-06-171-2/+14
| | | | | | | | | IBOutlet and weak attributes when accessed being unpredictably set to nil because usage of such properties are always single threaded and its ivar cannot be set to nil asynchronously. // rdar://15885642 llvm-svn: 211132
* Revert "[OPENMP] Initial support for '#pragma omp for'."Rafael Espindola2014-06-1710-2353/+107
| | | | | | | | This reverts commit r211096. Looks like it broke the msvc build: SemaOpenMP.cpp(140) : error C4519: default template arguments are only allowed on a class template llvm-svn: 211113
* Rewrite ARM NEON intrinsic emission completely.James Molloy2014-06-173-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There comes a time in the life of any amateur code generator when dumb string concatenation just won't cut it any more. For NeonEmitter.cpp, that time has come. There were a bunch of magic type codes which meant different things depending on the context. There were a bunch of special cases that really had no reason to be there but the whole thing was so creaky that removing them would cause something weird to fall over. There was a 1000 line switch statement for code generation involving string concatenation, which actually did lexical scoping to an extent (!!) with a bunch of semi-repeated cases. I tried to refactor this three times in three different ways without success. The only way forward was to rewrite the entire thing. Luckily the testing coverage on this stuff is absolutely massive, both with regression tests and the "emperor" random test case generator. The main change is that previously, in arm_neon.td a bunch of "Operation"s were defined with special names. NeonEmitter.cpp knew about these Operations and would emit code based on a huge switch. Actually this doesn't make much sense - the type information was held as strings, so type checking was impossible. Also TableGen's DAG type actually suits this sort of code generation very well (surprising that...) So now every operation is defined in terms of TableGen DAGs. There are a bunch of operators to use, including "op" (a generic unary or binary operator), "call" (to call other intrinsics) and "shuffle" (take a guess...). One of the main advantages of this apart from making it more obvious what is going on, is that we have proper type inference. This has two obvious advantages: 1) TableGen can error on bad intrinsic definitions easier, instead of just generating wrong code. 2) Calls to other intrinsics are typechecked too. So we no longer need to work out whether the thing we call needs to be the Q-lane version or the D-lane version - TableGen knows that itself! Here's an example: before: case OpAbdl: { std::string abd = MangleName("vabd", typestr, ClassS) + "(__a, __b)"; if (typestr[0] != 'U') { // vabd results are always unsigned and must be zero-extended. std::string utype = "U" + typestr.str(); s += "(" + TypeString(proto[0], typestr) + ")"; abd = "(" + TypeString('d', utype) + ")" + abd; s += Extend(utype, abd) + ";"; } else { s += Extend(typestr, abd) + ";"; } break; } after: def OP_ABDL : Op<(cast "R", (call "vmovl", (cast $p0, "U", (call "vabd", $p0, $p1))))>; As an example of what happens if you do something wrong now, here's what happens if you make $p0 unsigned before the call to "vabd" - that is, $p0 -> (cast "U", $p0): arm_neon.td:574:1: error: No compatible intrinsic found - looking up intrinsic 'vabd(uint8x8_t, int8x8_t)' Available overloads: - float64x2_t vabdq_v(float64x2_t, float64x2_t) - float64x1_t vabd_v(float64x1_t, float64x1_t) - float64_t vabdd_f64(float64_t, float64_t) - float32_t vabds_f32(float32_t, float32_t) ... snip ... This makes it seriously easy to work out what you've done wrong in fairly nasty intrinsics. As part of this I've massively beefed up the documentation in arm_neon.td too. Things still to do / on the radar: - Testcase generation. This was implemented in the previous version and not in the new one, because - Autogenerated tests are not being run. The testcase in test/ differs from the autogenerated version. - There were a whole slew of special cases in the testcase generation that just felt (and looked) like hacks. If someone really feels strongly about this, I can try and reimplement it too. - Big endian. That's coming soon and should be a very small diff on top of this one. llvm-svn: 211101
* clang-format: Introduce style with spaces on both sides of */&.Daniel Jasper2014-06-171-0/+4
| | | | | | | Patch by Janusz Sobczak (slightly extended). This fixes llvm.org/19929. llvm-svn: 211098
* [OPENMP] Initial support for '#pragma omp for'.Alexey Bataev2014-06-1710-107/+2353
| | | | llvm-svn: 211096
* Add support for the /Fi argument to clang-cl (PR20036)Hans Wennborg2014-06-171-0/+8
| | | | | | | | Patch by Ehsan Akhgari! Differential Revision: http://reviews.llvm.org/D4143 llvm-svn: 211081
* MS static locals mangling: don't double-increment mangling number for switchesHans Wennborg2014-06-171-0/+29
| | | | | | Differential Revision: http://reviews.llvm.org/D4165 llvm-svn: 211079
* MS static locals mangling: don't count enum scopesHans Wennborg2014-06-171-0/+21
| | | | | | | | | | We may not have the mangling for static locals vs. enums completely figured out, but at least for my simple test cases, enums should not increment the mangling number. Differential Revision: http://reviews.llvm.org/D4164 llvm-svn: 211078
* Use the integrated assembler by default on OpenBSD/powerpc.Brad Smith2014-06-161-0/+5
| | | | llvm-svn: 211075
* AArch64: Fix silly think-o in tests.Jim Grosbach2014-06-161-4/+4
| | | | | | rdar://9283021 llvm-svn: 211064
* AArch64: Support for __builtin_arm_rbit() and __builtin_arm_rbit64().Jim Grosbach2014-06-161-0/+10
| | | | | | | | __builtin_arm_rbit() and __builtin_arm_rbit64(). rdar://9283021 llvm-svn: 211060
* ARM: Support for __builtin_arm_rbit() intrinsic.Jim Grosbach2014-06-161-0/+6
| | | | | | | | Reverse the bits in a word. Maps to the RBIT instruction. rdar://9283021 llvm-svn: 211059
* [modules] When we merge redecl chains or mark a decl used with an updateRichard Smith2014-06-164-0/+16
| | | | | | | record, mark all subsequent decls as 'used' too, to maintain the AST invariant that getPreviousDecl()->Used implies this->Used. llvm-svn: 211050
* MS ABI: Implement x86_64 RTTIDavid Majnemer2014-06-161-0/+121
| | | | | | | | | | | | | | | | | Summary: The RTTI scheme for x86_64 is largely the same as the one for i386. Differences are largely limited to avoiding load-time relocations by replacing pointers to RTTI metadata with the difference of that data relative to the load address of the module. Interestingly, this precludes the possibility of successfully using RTTI data from another DLL. The ImageBase reference is always relative to the current DLL. Differential Revision: http://reviews.llvm.org/D4148 llvm-svn: 211041
* Objective-C. Diagnose when property access is using declaredFariborz Jahanian2014-06-161-0/+25
| | | | | | | property accessor methods which have become deprecated or available. // rdar://15951801 llvm-svn: 211039
* [C++1z] Implement N4051: 'typename' is permitted instead of 'class' when ↵Richard Smith2014-06-162-1/+7
| | | | | | declaring a template template parameter. llvm-svn: 211031
* Add -std=c++1z flag for C++17 features.Richard Smith2014-06-162-0/+26
| | | | llvm-svn: 211030
* [OPENMP] Initial support of 'reduction' clauseAlexey Bataev2014-06-164-12/+229
| | | | llvm-svn: 211007
* test: add missed file in previous commitSaleem Abdulrasool2014-06-151-3/+3
| | | | llvm-svn: 210992
* Preprocessor: improve ACLE 6.4.1, 6.4.2 supportSaleem Abdulrasool2014-06-151-0/+40
| | | | | | | | | | | | | | | | | | This improves conformance with ACLE 6.4.1. Define additional macros that indicate support for the ARM and Thumb instruction set architecture. This includes the following set of macros: __ARM_ARCH __ARM_ARCH_ISA_ARM __ARM_ARCH_ISA_THUMB __ARM_32BIT_STATE These help identify the environment that the code is intended to execute on. Adjust the handling for ACLE 6.4.2 to be more correct. We would define the profile as a free-standing token rather than a quoted single character. llvm-svn: 210991
* Fix a crash in Retain Count checker error reportingAnna Zaks2014-06-131-0/+60
| | | | | | | | | Fixes a crash in Retain Count checker error reporting logic by handing the allocation statement retrieval from a BlockEdge program point. Also added a simple CFG dump routine for debugging. llvm-svn: 210960
* A non-trivial array-fill expression isn't necessarily a CXXConstructExpr. ItRichard Smith2014-06-131-0/+19
| | | | | | | could be an InitListExpr that runs constructors in C++11 onwards. Fixes a recent regression (introduced in r210091). llvm-svn: 210954
* Add support for the /EP argument to clang-clHans Wennborg2014-06-131-1/+5
| | | | | | | | | | This maps the /EP argument to both -E and -P. Patch by Ehsan Akhgari! Differential Reviion: http://reviews.llvm.org/D4133 llvm-svn: 210935
* Fix test for release builds.Tim Northover2014-06-131-2/+2
| | | | llvm-svn: 210934
* Atomics: emit "cmpxchg weak" where possibleTim Northover2014-06-132-4/+45
| | | | | | | | | | | | | | | | | | Most builtins date from before the "cmpxchg weak" was a gleam in the C++ committee's eye, so fortunately not much needs to change. But a few of them *do* acknowledge that failure is possible. For these, we'll emit the usual cartesian product of cmpxchg operations if we can't statically determine weakness. CodeGen can sort it out later if the function gets inlined. The only other non-trivial aspect of this is (I think) that we emit the scalar expression for "IsWeak" once, at the beginning, and propagate its value through the successive blocks. There's not much in it, but it's slightly more consistent with the existing handling of FailureOrder. llvm-svn: 210932
* [PPC64LE] Run some existing Altivec tests on powerpc64le as wellBill Schmidt2014-06-134-0/+6
| | | | | | | | | | | There are several Altivec tests that formerly ran only on big-endian targets (and in some cases only on 32-bit targets). It is useful to verify these on little-endian targets as well. While testing these, I discovered a typo in <altivec.h>. This is also fixed by this patch. llvm-svn: 210928
* Adds a Pragma spelling for attributes to tablegen and makes use of it for loopTyler Nowicki2014-06-132-0/+61
| | | | | | | | | hint attributes. Includes tests for pragma printing and for attribute order which is incorrectly reversed by ParsedAttributes. Reviewed by Aaron Ballman llvm-svn: 210925
* Remove top-level Clang -fsanitize= flags for optional ASan features.Alexey Samsonov2014-06-133-46/+3
| | | | | | | | | | | | | Init-order and use-after-return modes can currently be enabled by runtime flags. use-after-scope mode is not really working at the moment. The only problem I see is that users won't be able to disable extra instrumentation for init-order and use-after-scope by a top-level Clang flag. But this instrumentation was implicitly enabled for quite a while and we didn't hear from users hurt by it. llvm-svn: 210924
* IR-change: cmpxchg operations now return { iN, i1 }.Tim Northover2014-06-133-28/+83
| | | | | | | | This is a minimal fix for clang. I'll soon add support for generating weak variants when requested, but that's not really necessary for the LLVM change in isolation. llvm-svn: 210907
* Tests: use CHECK-LABEL to help debugging failuresTim Northover2014-06-131-29/+29
| | | | llvm-svn: 210906
* MS ABI: Fix inheritance model calculation in CRTPDavid Majnemer2014-06-131-4/+15
| | | | | | | | | | | | | | | | | CRTP-like patterns involve a class which inherits from another class using itself as a template parameter. However, the base class itself may try to create a pointer-to-member which involves the derived class. This is problematic because we may not have finished parsing the most derived classes' base specifiers yet. It turns out that MSVC simply uses the unspecified inheritance model instead of doing anything fancy. This fixes PR19987. llvm-svn: 210886
* Missed a space at the end of the line.Brad Smith2014-06-131-1/+1
| | | | llvm-svn: 210884
* Use dwarf-2 by default on OpenBSD and FreeBSD.Brad Smith2014-06-133-20/+36
| | | | | | | The Tools.cpp part of the patch partially based on a patch from FreeBSD's LLVM tree. llvm-svn: 210883
* Extend AST dump to include 'used' and 'referenced' flags, and put 'invalid' ↵Richard Smith2014-06-132-11/+27
| | | | | | flag in the right place. llvm-svn: 210872
* Recover from missing 'typename' in sizeof(T::InnerType)Reid Kleckner2014-06-121-0/+61
| | | | | | | | | | | | | | | | | | | | | | Summary: 'sizeof' is a UnaryExprOrTypeTrait, and it can contain either a type or an expression. This change threads a RecoveryTSI parameter through the layers between TransformUnaryExprOrTypeTrait the point at which we look up the type. If lookup finds a single type result after instantiation, we now build TypeSourceInfo for it just like a normal transformation would. This fixes the last error in the hello world ATL app that I've been working with, and it now links and runs with clang. Please try it and file bugs! Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4108 llvm-svn: 210855
OpenPOWER on IntegriCloud