summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* [OPENMP] Initial parsing and sema analysis for 'single' directive.Alexey Bataev2014-06-263-0/+8
| | | | llvm-svn: 211774
* [OPENMP] Initial parsing and sema analysis for 'section' directive.Alexey Bataev2014-06-263-0/+8
| | | | llvm-svn: 211767
* Convert some function arguments to use ArrayRef.Craig Topper2014-06-261-1/+1
| | | | llvm-svn: 211764
* CodeGen: Improve warnings about uninstrumented files when profilingJustin Bogner2014-06-264-12/+51
| | | | | | | | | Improve the warning when building with -fprofile-instr-use and a file appears not to have been profiled at all. This keys on whether a function is defined in the main file or not to avoid false negatives when one includes a header with functions that have been profiled. llvm-svn: 211760
* PR20038: DebugInfo: Call sites without DebugLocs for temporary dtors after a ↵David Blaikie2014-06-251-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | conditional With && at the top level of an expression, the last thing done when emitting the expression was an unconditional jump to the cleanup block. To reduce the amount of stepping, the DebugLoc is omitted from the unconditional jump. This is done by clearing the IRBuilder's "CurrentDebugLocation"*. If this is not set to some non-empty value before the cleanup block is emitted, the cleanups don't get a location either. If a call without a location is emitted in a function with debug info, and that call is then inlined - bad things happen. (without a location for the call site, the inliner would just leave the inlined DebugLocs as they were - pointing to roots in the original function, not inlined into the current function) Follow up commit to LLVM will ensure that breaking the invariants of the DebugLoc chains by having chains that don't lead to the current function will fail assertions, so we shouldn't accidentally slip any of these cases in anymore. Those assertions may reveal further cases that need to be fixed in clang, though I've tried to test heavily to avoid that. * See r128471, r128513 for the code that clears the CurrentDebugLocation. Simply removing this code or moving the code into IRBuilder to apply to all unconditional branches would regress desired behavior, unfortunately. llvm-svn: 211722
* Rename loop unrolling and loop vectorizer metadata to have a common prefix.Eli Bendersky2014-06-253-13/+13
| | | | | | | | | | | | | | | | | | | [Clang part] These patches rename the loop unrolling and loop vectorizer metadata such that they have a common 'llvm.loop.' prefix. Metadata name changes: llvm.vectorizer.* => llvm.loop.vectorizer.* llvm.loopunroll.* => llvm.loop.unroll.* This was a suggestion from an earlier review (http://reviews.llvm.org/D4090) which added the loop unrolling metadata. Patch by Mark Heffernan. llvm-svn: 211712
* [OPENMP] Initial support for 'sections' directive.Alexey Bataev2014-06-253-1/+10
| | | | llvm-svn: 211685
* Add R600 builtin codegen.Matt Arsenault2014-06-242-0/+38
| | | | llvm-svn: 211631
* Correctly Load Mixed FP-GP Variadic Arguments for x86-64.Rafael Espindola2014-06-241-2/+2
| | | | | | | | | | | | | | | | | | | | According to the x86-64 ABI, structures with both floating point and integer members are split between floating-point and general purpose registers, and consecutive 32-bit floats can be packed into a single floating point register. In the case of variadic functions these are stored to memory and the position recorded in the va_list. This was already correctly implemented in llvm.va_start. The problem is that the code in clang for implementing va_arg was reading floating point registers from the wrong location. Patch by Thomas Jablin. Fixes PR20018. llvm-svn: 211626
* Add new debug kind LocTrackingOnly.Diego Novillo2014-06-242-13/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This new debug emission kind supports emitting line location information in all instructions, but stops code generation from emitting debug info to the final output. This mode is useful when the backend wants to track source locations during code generation, but it does not want to produce debug info. This is currently used by optimization remarks (-Rpass, -Rpass-missed and -Rpass-analysis). When one of the -Rpass flags is used, the front end will enable location tracking, only if no other debug option is enabled. To prevent debug information from being generated, a new debug info kind LocTrackingOnly causes DIBuilder::createCompileUnit() to not emit the llvm.dbg.cu annotation. This blocks final code generation from generating debug info in the back end. Depends on D4234. Reviewers: echristo, dblaikie Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4235 llvm-svn: 211610
* ARM: remove dead CodeGen functions.Tim Northover2014-06-242-33/+0
| | | | | | These two are no longer being used by NEON codegen. llvm-svn: 211586
* Fix spelling. s/overloaed/overloaded/Jim Grosbach2014-06-231-2/+2
| | | | llvm-svn: 211530
* CodeGen: Remove a stray tab character (NFC)Justin Bogner2014-06-231-1/+1
| | | | llvm-svn: 211528
* Revert "Revert r211402 (and r211408,r211410), "CodeGen: Refactor ↵David Majnemer2014-06-224-366/+427
| | | | | | | | | dynamic_cast and typeid" It crashes msvc codegen in clang/test/SemaCXX/undefined-internal.cpp." This reverts commit r211467 which reverted r211408,r211410, it caused crashes in test/SemaCXX/undefined-internal.cpp for i686-win32 targets. llvm-svn: 211473
* Revert r211402 (and r211408,r211410), "CodeGen: Refactor dynamic_cast and ↵NAKAMURA Takumi2014-06-224-430/+366
| | | | | | | | | | typeid" It crashes msvc codegen in clang/test/SemaCXX/undefined-internal.cpp. It is reproducible with: $ clang -cc1 -triple i686-win32 -emit-llvm-only clang/test/SemaCXX/undefined-internal.cpp llvm-svn: 211467
* CodeGen: Refactor dynamic_cast and typeidDavid Majnemer2014-06-204-366/+430
| | | | | | | | | | | This refactors the emission of dynamic_cast and typeid expressions so that ABI specific knowledge lives in appropriate places. There are quite a few benefits for having the two implementations share a common core like sharing logic for optimization opportunities. While we are at it, clean up the tests. llvm-svn: 211402
* Don't crash when emitting a glvalue conditional where one arm is aRichard Smith2014-06-201-10/+32
| | | | | | throw-expression. Based on a patch by Marius Wachtler! llvm-svn: 211388
* [PowerPC] Fix small argument stack slot offset for LEUlrich Weigand2014-06-201-3/+7
| | | | | | | | | | | | | | | | | When small arguments (structures < 8 bytes or "float") are passed in a stack slot in the ppc64 SVR4 ABI, they must reside in the least significant part of that slot. On BE, this means that an offset needs to be added to the stack address of the parameter, but on LE, the least significant part of the slot has the same address as the slot itself. For the most part, this is handled in the LLVM back-end, where I just fixed the LE case in commit r211368. However, there is one piece of the clang front-end that is also aware of these stack-slot offsets: PPC64_SVR4_ABIInfo::EmitVAArg. This patch updates that routine to take endianness into account. llvm-svn: 211370
* Add module flags metadata to record the settings for enum and wchar widthOliver Stannard2014-06-201-0/+17
| | | | | | | Add module flags metadata to record the settings for enum and wchar width, to allow correct ARM build attribute generation llvm-svn: 211354
* [MS-ABI] Implement typeidWarren Hunt2014-06-181-2/+35
| | | | | | | 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/+29
| | | | | | | | | 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
* Inherit dll attributes to static localsHans Wennborg2014-06-182-2/+10
| | | | | | | | This makes us handle static locals in exported/imported functions correctly. Differential Revision: http://reviews.llvm.org/D4136 llvm-svn: 211173
* [OPENMP] Reformatting and code improvement.Alexey Bataev2014-06-183-22/+20
| | | | llvm-svn: 211147
* [OPENMP] Initial support for '#pragma omp for' (fixed incompatibility with ↵Alexey Bataev2014-06-183-0/+7
| | | | | | MSVC). llvm-svn: 211140
* Revert "[OPENMP] Initial support for '#pragma omp for'."Rafael Espindola2014-06-173-7/+0
| | | | | | | | 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
* Fix the comment which was backwards.Yaron Keren2014-06-171-1/+1
| | | | llvm-svn: 211112
* [OPENMP] Initial support for '#pragma omp for'.Alexey Bataev2014-06-173-0/+7
| | | | llvm-svn: 211096
* AArch64: Support for __builtin_arm_rbit() and __builtin_arm_rbit64().Jim Grosbach2014-06-161-0/+15
| | | | | | | | __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
* MS ABI: Implement x86_64 RTTIDavid Majnemer2014-06-161-18/+81
| | | | | | | | | | | | | | | | | 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
* Fix typosAlp Toker2014-06-161-1/+1
| | | | llvm-svn: 211025
* A non-trivial array-fill expression isn't necessarily a CXXConstructExpr. ItRichard Smith2014-06-131-6/+24
| | | | | | | could be an InitListExpr that runs constructors in C++11 onwards. Fixes a recent regression (introduced in r210091). llvm-svn: 210954
* Atomics: emit "cmpxchg weak" where possibleTim Northover2014-06-131-26/+60
| | | | | | | | | | | | | | | | | | 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
* Remove top-level Clang -fsanitize= flags for optional ASan features.Alexey Samsonov2014-06-132-10/+2
| | | | | | | | | | | | | 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-13/+16
| | | | | | | | 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
* Prefix another use of error_code.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210832
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210780
* Use StringRef to simplify code. No functional change.Craig Topper2014-06-121-1/+1
| | | | llvm-svn: 210751
* Use ArrayRef in some function parameters instead of a pointer and count. No ↵Craig Topper2014-06-121-1/+1
| | | | | | functional change. llvm-svn: 210750
* Add loop unroll pragma supportEli Bendersky2014-06-111-0/+14
| | | | | | | | http://reviews.llvm.org/D4089 Patch by Mark Heffernan. llvm-svn: 210667
* CodeGen: Correct linkage of thread_local for OS XDavid Majnemer2014-06-112-6/+25
| | | | | | | | | | | | | The backing store of thread local variables is internal for OS X and all accesses must go through the thread wrapper. However, individual TUs may have inlined through the thread wrapper. To fix this, give the thread wrapper functions WeakAnyLinkage. This prevents them from getting inlined into call-sites. This fixes PR19989. llvm-svn: 210632
* Objective-C IRGen. Patch to generate a weak symbol reference whenFariborz Jahanian2014-06-101-4/+7
| | | | | | | | 'super' dispatches a class method in category for OBJC_METACLASS. This is when class is a weak_import class. // rdar://16529125 llvm-svn: 210547
* [C++11] Use 'nullptr'.Craig Topper2014-06-093-9/+11
| | | | llvm-svn: 210448
* Avoid dubious IdentifierInfo::getNameStart() usesAlp Toker2014-06-071-32/+24
| | | | | | | | These cases in particular were incurring an extra strlen() when we already knew the length. They appear to be leftovers from when the interfaces worked with C strings that have continued to compile due to the implicit StringRef ctor. llvm-svn: 210403
* StringRefize TargetInfo::getABI()Alp Toker2014-06-071-3/+3
| | | | llvm-svn: 210402
* [MS-ABI] Implement dynamic_castWarren Hunt2014-06-061-4/+135
| | | | | | | | | | This patch implements call lower from dynamic_cast to __RTDynamicCast and __RTCastToVoid. Test cases are included. A feature of note is that helper function getPolymorphicOffset is placed in such a way that it can be used by EmitTypeid (to be implemented in a later patch) without being moved. Details are included as comments directly in the code. llvm-svn: 210377
* MS ABI: Update the thunk linkage computationHans Wennborg2014-06-064-7/+20
| | | | | | | | | | | | | | | | | | | | | | | As suggested by Reid: - class has GVA_Internal linkage -> internal - thunk has return adjustment -> weak_odr, to handle evil corner case [1] - all other normal methods -> linkonce_odr 1. Evil corner case: struct Incomplete; struct A { int a; virtual A *bar(); }; struct B { int b; virtual B *foo(Incomplete); }; struct C : A, B { int c; virtual C *foo(Incomplete); }; C c; Here, the thunk for C::foo() will be emitted when C::foo() is defined, which might be in a different translation unit, so it needs to be weak_odr. Differential Revision: http://reviews.llvm.org/D3992 llvm-svn: 210368
* Defer codegen of inline method definitions to the end of current top level ↵Hans Wennborg2014-06-061-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | declaration We would previously fail to emit a definition of bar() for the following code: struct __declspec(dllexport) S { void foo() { t->bar(); } struct T { void bar() {} }; T *t; }; Note that foo() is an exported method, but bar() is not. However, foo() refers to bar() so we need to emit its definition. We would previously fail to realise that bar() is used. By deferring the method definitions until the end of the top level declaration, we can simply call EmitTopLevelDecl on them and rely on the usual mechanisms to decide whether the method should be emitted or not. Differential Revision: http://reviews.llvm.org/D4038 llvm-svn: 210356
* Adding a new #pragma for the vectorize and interleave optimization hints.Aaron Ballman2014-06-062-18/+132
| | | | | | Patch thanks to Tyler Nowicki! llvm-svn: 210330
* Fix typosAlp Toker2014-06-061-6/+6
| | | | llvm-svn: 210328
OpenPOWER on IntegriCloud