summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* ARM & AArch64: another block of miscellaneous NEON sharing.Tim Northover2014-01-311-119/+83
| | | | llvm-svn: 200527
* ARM & AArch64: move shared vld/vst intrinsics to common implementation.Tim Northover2014-01-312-176/+147
| | | | llvm-svn: 200526
* ARM & AArch64: more instructions into common blockTim Northover2014-01-311-73/+52
| | | | llvm-svn: 200525
* ARM & AArch64: merge another NEON block completely.Tim Northover2014-01-311-236/+154
| | | | llvm-svn: 200524
* ARM & AArch64: extend shared NEON implementation to first block.Tim Northover2014-01-302-88/+73
| | | | | | | This extends the refactoring to the whole of the first block of trivial correspondences (as a fairly arbitrary boundary). llvm-svn: 200472
* ARM & AArch64: fully share NEON implementation of permutation intrinsicsTim Northover2014-01-302-71/+83
| | | | | | | As a starting point, this moves the CodeGen for NEON permutation instructions (vtrn, vzip, vuzp) into a new shared function. llvm-svn: 200471
* ARM & AArch64: share the BI__builtin_neon enum defs.Tim Northover2014-01-301-1102/+1102
| | | | llvm-svn: 200470
* Objective-C [IRGen]. Generator a tail call to objc_getProperty() in Fariborz Jahanian2014-01-301-1/+5
| | | | | | | synthesized getters for performance improvement. // rdar://15884113 llvm-svn: 200430
* Fixing PR18430 by checking that the size of bitfields plus padding does notYunzhong Gao2014-01-291-1/+6
| | | | | | | | grow into the following virtual base. Differential Revision: http://llvm-reviews.chandlerc.com/D2560 llvm-svn: 200359
* [ARM] Fix AAPCS-VFP non-compliance when returning HFA from variadic functions.Amara Emerson2014-01-281-8/+10
| | | | | | | | | Arguments and return values must always be marshalled as for the base AAPCS when the callee is a variadic function. Patch by Oliver Stannard! llvm-svn: 200307
* Enforce safe usage of DiagnosticsEngine::getCustomDiagID()Alp Toker2014-01-262-5/+5
| | | | | | | | | | | | | | | | Replace the last incorrect uses and templatize the function to require a compile-time constant string preventing further misuse. The diagnostic formatter expects well-formed input and has undefined behaviour with arbitrary input or crafted user strings in source files. Accepting user input would also have caused unbounded generation of new diagnostic IDs which can be problematic in long-running sessions or language bindings. This completes the work to fix several incorrect callers that passed user input or raw messages to the diagnostics engine where a constant format string was expected. llvm-svn: 200132
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-2512-49/+45
| | | | | | | | | | | | | | | A return type is the declared or deduced part of the function type specified in the declaration. A result type is the (potentially adjusted) type of the value of an expression that calls the function. Rule of thumb: * Declarations have return types and parameters. * Expressions have result types and arguments. llvm-svn: 200082
* Fixing PR18510 by checking whether the non-virtual base of the derived classYunzhong Gao2014-01-241-1/+6
| | | | | | | | | | might have a smaller size as compared to the stand-alone type of the base class. This is possible when the derived class is packed and hence might have smaller alignment requirement than the base class. Differential Revision: http://llvm-reviews.chandlerc.com/D2599 llvm-svn: 200031
* Fix to PR8880 (clang dies processing a for loop)Serge Pavlov2014-01-231-12/+12
| | | | | | | | | | | | | | | | | | | | | | | Due to statement expressions supported as GCC extension, it is possible to put 'break' or 'continue' into a loop/switch statement but outside its body, for example: for ( ; ({ if (first) { first = 0; continue; } 0; }); ) This code is rejected by GCC if compiled in C mode but is accepted in C++ code. GCC bug 44715 tracks this discrepancy. Clang used code generation that differs from GCC in both modes: only statement of the third expression of 'for' behaves as if it was inside loop body. This change makes code generation more close to GCC, considering 'break' or 'continue' statement in condition and increment expressions of a loop as it was inside the loop body. It also adds error for the cases when 'break'/'continue' appear outside loop due to this syntax. If code generation differ from GCC, warning is issued. Differential Revision: http://llvm-reviews.chandlerc.com/D2518 llvm-svn: 199897
* [AArch64 NEON] Fix a bug about vcles_f32 and vcled_f64.Kevin Qin2014-01-231-0/+1
| | | | | | | As vcles_f32() and vcled_f64 are implemented by FCMGE, operands should make a swap. llvm-svn: 199866
* CodeGen: Fix tracking of PGO counters for the logical or operatorJustin Bogner2014-01-231-1/+1
| | | | | | | This adds tests for both logical or and for logical and, which was already correct. llvm-svn: 199865
* CodeGen: Handle PGO counters for constructors and destructorsJustin Bogner2014-01-231-0/+6
| | | | llvm-svn: 199864
* Handle va_arg on struct types for the le32 target (PNaCl and Emscripten)Mark Seaborn2014-01-221-1/+5
| | | | | | | | | | | | | | | PNaCl and Emscripten can both handle va_arg IR instructions with struct type. Also add a test to cover generating a va_arg IR instruction from va_arg in C on le32 (as already handled by VisitVAArgExpr() in CGExprScalar.cpp), which was not covered by a test before. (This fixes https://code.google.com/p/nativeclient/issues/detail?id=2381) Differential Revision: http://llvm-reviews.chandlerc.com/D2539 llvm-svn: 199830
* Correct various uses of 'argument' that in fact refer to function parametersAlp Toker2014-01-212-10/+9
| | | | | | Cleanup only. llvm-svn: 199773
* Debug info: use the file a typedef is defined in as its decl_file insteadAdrian Prantl2014-01-211-2/+4
| | | | | | | | | of the current compilation unit. As a side effect this enables many more LTO uniquing opportunities. This reapplies r199757 with a better testcase. llvm-svn: 199760
* revert 199757 for buildbot breakage.Adrian Prantl2014-01-211-4/+2
| | | | llvm-svn: 199758
* Debug info: use the file a typedef is defined in as its decl_file insteadAdrian Prantl2014-01-211-2/+4
| | | | | | | | | of the current compilation unit. As a side effect this enables many more LTO uniquing opportunities. rdar://problem/15851206 llvm-svn: 199757
* Use private linkage for utf-16 objc strings too.Rafael Espindola2014-01-211-9/+2
| | | | llvm-svn: 199709
* Now that r199688 avoids the real issue, use private linkage for objc strings.Rafael Espindola2014-01-211-5/+2
| | | | llvm-svn: 199705
* Revert "CodeGen: Simplify CodeGenFunction::EmitCaseStmt"Justin Bogner2014-01-213-0/+52
| | | | | | | | | I misunderstood the discussion on this. The complexity here is justified by the malloc overhead it saves. This reverts commit r199302. llvm-svn: 199700
* Give explicit sections for string constants used in NSStrings.Rafael Espindola2014-01-201-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without them they can be merged with non unnamed_addr constants during LTO. The resulting constant is not unnamed_addr and goes in a different section, which causes ld64 to crash. A testcase that would crash before: * file1.mm: void g(id notification) { [notification valueForKey:@"name"]; } * file2.cpp: extern const char js_name_str[] = "name"; * file3.cpp extern bool JS_GetProperty(const char *name); extern const char js_name_str[]; bool js_ReportUncaughtException() { JS_GetProperty(js_name_str); } run clang file1.mm -o file1.o -c -w -emit-llvm clang file2.cpp -o file2.o -c -w -emit-llvm clang file3.cpp -o file3.o -c -w ld -dylib -o XUL file1.o file2.o file3.o -undefined dynamic_lookup. llvm-svn: 199688
* Rename FunctionProtoType accessors from 'arguments' to 'parameters'Alp Toker2014-01-206-36/+36
| | | | | | | | | | | | | | | | | Fix a perennial source of confusion in the clang type system: Declarations and function prototypes have parameters to which arguments are supplied, so calling these 'arguments' was a stretch even in C mode, let alone C++ where default arguments, templates and overloading make the distinction important to get right. Readability win across the board, especially in the casting, ADL and overloading implementations which make a lot more sense at a glance now. Will keep an eye on the builders and update dependent projects shortly. No functional change. llvm-svn: 199686
* Simplify further.Rafael Espindola2014-01-201-7/+5
| | | | | | Thanks to David Blaikie for the push. llvm-svn: 199685
* Remove virtual methods that were added in 2009 and still had 1 implementation.Rafael Espindola2014-01-201-7/+9
| | | | llvm-svn: 199665
* Refactor ABI argument lowering a littleReid Kleckner2014-01-181-57/+60
| | | | | | | | | Currently it tracks the number of free registers, but soon it will track stack offsets for inalloca lowering. No functional change. llvm-svn: 199532
* Revert "Revert r199416, "MS ABI: Improve selection of an inheritance model""David Majnemer2014-01-171-39/+50
| | | | | | | | | | This reverts commit r199475 (which reverted r199416) with fixes for the breakages. We wouldn't lock an inheritance model if we saw a pointer-to-member formed as a result of the address-of operator. llvm-svn: 199482
* Revert r199416, "MS ABI: Improve selection of an inheritance model"NAKAMURA Takumi2014-01-171-50/+39
| | | | | | | | | | | | It broke tests for targeting x86_64-pc-win32: Clang Tools :: clang-modernize/LoopConvert/array.cpp Clang :: CodeGenCXX/2010-05-10-Var-DbgInfo.cpp Clang :: CodeGenCXX/member-call-parens.cpp Clang :: CodeGenCXX/ptr-to-datamember.cpp Clang :: SemaTemplate/instantiate-function-1.cpp llvm-svn: 199475
* Debug info: Refactor NoLocation and ArtificialLocation to use a common baseAdrian Prantl2014-01-174-31/+39
| | | | | | | | | class and use it pervasively to restore debug locations. Fixes an interaction between cleanup and EH that caused the location to not be restored properly after emitting a landing pad. rdar://problem/15208190 llvm-svn: 199444
* MS ABI: Improve selection of an inheritance modelDavid Majnemer2014-01-161-39/+50
| | | | | | | | | | | | | | | | | | | | | | | | The MSVC ABI is rather finicky about the exact representation of it's pointer-to-member representation. The exact position of when and where it will go with one representation versus another appears to be when it desires the pointer-to-member to be complete. To properly implement this in clang, do several things: - Give up on tracking the polymorphic nature of the class. It isn't useful to Sema and is only pertinent when choosing CodeGen-time details like whether the field-offset can be 0 instead of -1. - Insist on locking-in the inheritance model when we ask our pointer-to-member type to be complete. From there, grab the underlying CXXRecordDecl and try to make *that* complete. Once we've done this, we can calculate it's inheritance model and apply it using an attribute. N.B. My first bullet point is a lie. We will eventually care about the specifics of whether or not a CXXRecordDecl is or is not polymorphic because MSVC compatible mangling of such things depends on it. However, I believe we will handle this in a rather different way. llvm-svn: 199416
* [asan] Remove -fsanitize-address-zero-base-shadow command lineEvgeniy Stepanov2014-01-161-4/+2
| | | | | | | | | | | | | | | | flag from clang, and disable zero-base shadow support on all platforms where it is not the default behavior. - It is completely unused, as far as we know. - It is ABI-incompatible with non-zero-base shadow, which means all objects in a process must be built with the same setting. Failing to do so results in a segmentation fault at runtime. - It introduces a backward dependency of compiler-rt on user code, which is uncommon and complicates testing. This is the Clang part of a larger change. llvm-svn: 199372
* Make -fno-inline attach NoInline attribute to all functions that are notRoman Divacky2014-01-151-3/+8
| | | | | | | | | | marked as AlwaysInline or ForceInline. This moves us to what gcc does with -fno-inline. The attribute approach was discussed to be better than switching to InlineAlways inliner in presence of LTO. llvm-svn: 199324
* CodeGen: Simplify CodeGenFunction::EmitCaseStmtJustin Bogner2014-01-153-52/+0
| | | | | | | | | | | | | Way back in r129652 we tried to avoid emitting an empty block at -O0 for switch cases that did nothing but break. This led to a poor debugging experience as reported in PR9796, so we disabled the optimization for -O0 but left it in for higher optimization levels in r154420. Since the whole point of this was to improve -O0, it's silly to keep the complexity at all. llvm-svn: 199302
* Improve comment.Fariborz Jahanian2014-01-141-3/+3
| | | | llvm-svn: 199258
* ObjectiveC. add comment.Fariborz Jahanian2014-01-141-3/+3
| | | | llvm-svn: 199257
* Simplifying the OpenCL image attribute. It does not need a semantic integer ↵Aaron Ballman2014-01-141-2/+2
| | | | | | parameter because the required information is encoded in the spelling. Added an appropriate subject to the attribute, and simplified the semantic checking (which will likely be expanded upon in a future patch). Also, removed the GNU spelling since it was unsupported in the first place. llvm-svn: 199229
* Update CodeGen to use DLL storage class for dllimport/dllexportNico Rieck2014-01-141-9/+17
| | | | | | | With the old linkage types removed, set the linkage to external for both dllimport and dllexport to reflect what's currently supported. llvm-svn: 199220
* [ms-abi] Remove duplicated vbptr offset codeReid Kleckner2014-01-141-39/+5
| | | | | | | | | Record layout will tell us the offset of a shared vbptr inside a non-virtual base. No functionality change. llvm-svn: 199171
* [ms-abi] Always generate complete constructors in the Microsoft C++ ABIReid Kleckner2014-01-132-5/+11
| | | | | | | | Fixes PR18435, where we generated a base ctor instead of a complete ctor, and so failed to construct virtual bases when constructing the complete object. llvm-svn: 199160
* CodeGen: Clarify a comment about PGO in case statement rangesJustin Bogner2014-01-131-3/+4
| | | | llvm-svn: 199140
* CodeGen: Rename adjustFallThroughCount -> adjustForControlFlowJustin Bogner2014-01-137-24/+24
| | | | | | | | adjustFallThroughCount isn't a good name, and the documentation was even worse. This commit attempts to clarify what it's for and when to use it. llvm-svn: 199139
* CodeGen: Introduce CodeGenPGO::setCurrentRegionUnreachableJustin Bogner2014-01-133-9/+13
| | | | | | | | There are a number of places where we do PGO.setCurrentRegionCount(0) directly after an unconditional branch. Give this operation a name so that it's clearer why we're doing this. llvm-svn: 199138
* CodeGen: Remove a superfluous setCurrentRegionCountJustin Bogner2014-01-131-1/+0
| | | | | | | | This call looks like it was an artifact of an earlier change, and doesn't actually make sense. We begin a new region immediately anyway, so it was mostly harmless. llvm-svn: 199137
* CodeGen: Remove some unnecessary bracesJustin Bogner2014-01-131-2/+1
| | | | llvm-svn: 199136
* Update for getLazyBitcodeModule API change.Rafael Espindola2014-01-131-3/+5
| | | | llvm-svn: 199126
* [cleanup] Update the include of Dominators.h to reflect its move to theChandler Carruth2014-01-131-1/+1
| | | | | | IR library in LLVM r199082. llvm-svn: 199083
OpenPOWER on IntegriCloud