summaryrefslogtreecommitdiff
path: root/lib/CodeGen
Commit message (Collapse)AuthorAge
...
* PR12208: Under -fno-elide-constructors, don't forget to actually copy an NRVORichard Smith2014-01-11
| | | | | | | | variable to the return slot. Patch by David Wiberg, with test case alterations by me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198991 91177308-0d34-0410-b5e6-96231b3b80d8
* CGRecordLayoutBuilder.cpp: Clarify if-else. [-Wdangling-else]NAKAMURA Takumi2014-01-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198906 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-abi] Fixing CGRecordLayoutBuilder w.r.t. MS NonVirutalBase LayoutWarren Hunt2014-01-09
| | | | | | | | | | | | | | | | The MS abi lays out *all* non-virtual bases with leading vfptrs before laying out non-virutal bases without vfptrs. This guarantees that the primary base is laid out first. r198818 fixed RecordLayoutBuilder to produce compatiable layouts. This patch fixes CGRecordLayoutBuilder to be able to consume those layouts and produce meaningful output without tripping any asserts about assumed incoming layout. A test case is included that shows CGRecordLayoutBuilder in fact produces output in the compatiable order. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198900 91177308-0d34-0410-b5e6-96231b3b80d8
* Use getPointerSizeInBits.Rafael Espindola2014-01-09
| | | | | | | I introduced this bug in 198815. Thanks for Mark Lacey for noticing. Unfortunately, I have no idea how to test this code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198891 91177308-0d34-0410-b5e6-96231b3b80d8
* The OpenCL specification states that images are allocated Pekka Jaaskelainen2014-01-09
| | | | | | | | | | | | | from the global address space (6.5.1 of the OpenCL 1.2 specification). This makes clang construct the image arguments in the global address space and generate the argument metadata with the correct address space descriptor. Patch by Pedro Ferreira! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198868 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix leak in lib/CodeGen/CGException.cpp, PR18318Kostya Serebryany2014-01-09
| | | | | | | | | | | | | | Summary: This fixes the leak described in http://llvm.org/bugs/show_bug.cgi?id=18318 Reviewers: chandlerc, dblaikie Reviewed By: chandlerc CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2474 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198857 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-abi] Refactor Microsoft Record LayoutWarren Hunt2014-01-09
| | | | | | | | | | | This patch refactors microsoft record layout to be more "natural". The most dominant change is that vbptrs and vfptrs are injected after the fact. This simplifies the implementation and the math for the offest for the first base/field after the vbptr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198818 91177308-0d34-0410-b5e6-96231b3b80d8
* Used the DataLayout methods instead of the Module methods.Rafael Espindola2014-01-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198815 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-applying r198699 after reverting r198461.Adrian Prantl2014-01-07
| | | | | | | | Debug info: Implement a cleaner version of r198461. For symmetry with C and C++ don't emit an extra lexical scope for the compound statement that is the body of an Objective-C method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198715 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Debug info: Ensure that the last stop point in a function is still ↵Adrian Prantl2014-01-07
| | | | | | | | within" This reverts commit r198461. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198714 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Debug info: Implement a cleaner version of r198461. For symmetry with"Adrian Prantl2014-01-07
| | | | | | This reverts commit 198699 so we can get a cleaner patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198713 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info: Implement a cleaner version of r198461. For symmetry withAdrian Prantl2014-01-07
| | | | | | | | | C and C++ don't emit an extra lexical scope for the compound statement that is the body of an Objective-C method. rdar://problem/15010825 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198699 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused include.Rafael Espindola2014-01-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198692 91177308-0d34-0410-b5e6-96231b3b80d8
* Update Clang for the move of headers in r198688.Chandler Carruth2014-01-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198689 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-07
| | | | | | | encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198686 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a -Wparentheses warning from GCC that caught a badly formed assert.Chandler Carruth2014-01-07
| | | | | | | I have no idea why Clang's warning doesn't fire here, looks like a Clang bug. I'll investigate that separately. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198677 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGen: Include llvm/Config/config.h for strtoll on WindowsJustin Bogner2014-01-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198672 91177308-0d34-0410-b5e6-96231b3b80d8
* update comment.Adrian Prantl2014-01-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198670 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a new -fstandalone-debug option. rdar://problem/15685848Adrian Prantl2014-01-07
| | | | | | | | | | | | | | It controls everything that -flimit-debug-info used to, plus the vtable type optimization. The old -fno-limit-debug-info option is now an alias to -fstandalone-debug and vice versa. Standalone is the default on Darwin until dtrace is updated to work with non-standalone debug info (rdar://problem/15758808). Note: I kept the LimitedDebugInfo name in CodeGenOptions::DebugInfoKind because NoStandaloneDebugInfo sounded even more confusing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198655 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGen: Sentences end with a periodJustin Bogner2014-01-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198649 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly sort CMake list. NFC.Ted Kremenek2014-01-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198645 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGen: Initial instrumentation based PGO implementationJustin Bogner2014-01-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198640 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-cxxabi] Improve vbtable name mangling accuracyReid Kleckner2014-01-03
| | | | | | | | | | | | | | | | | | | | | | Summary: This makes us more compatible with MSVC 2012+ and fixes PR17748 where we would give two tables the same name. Rather than doing a fresh depth-first traversal of the inheritance graph for every record's vbtables, now we memoize vbtable paths for each record. By doing memoization, we end up considering virtual bases of subobjects that come later in the depth-first traversal. Where previously we would have ignored a virtual base that we'd already seen, we now consider it for name mangling purposes without emitting a duplicate vbtable for it. Reviewers: majnemer CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2509 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198462 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info: Ensure that the last stop point in a function is still withinAdrian Prantl2014-01-03
| | | | | | | | | the lexical block formed by the compound statement that is the function body. rdar://problem/15010825 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198461 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused variable to fix clang warningReid Kleckner2014-01-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198382 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-cxxabi] Move VBTableBuilder from CodeGen over to AST/VTableBuilder.cppReid Kleckner2014-01-03
| | | | | | | | | | | | | | | | | | | | | Summary: No functionality change. This code should live here long-term because we should be able to use it to compute correct vftable names. It turns out that the most natural way to implement the naming algorithm is to use a caching layer similar to what we already have for virtual table info in VTableContext. Subsequent changes will take advantage of this to fix PR17748, where we have a vbtable name collision. Reviewers: majnemer CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2499 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198380 91177308-0d34-0410-b5e6-96231b3b80d8
* Verify that clang TargetInfo descriptions match DataLayout strings from LLVMAlp Toker2014-01-02
| | | | | | | The backend string is only verified when available as it's possible to run clang IRGen for targets that haven't been built or don't exist in LLVM. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198309 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate UnaryTypeTraitExprAlp Toker2014-01-01
| | | | | | | | | | | | | Remove UnaryTypeTraitExpr and switch all remaining type trait related handling over to TypeTraitExpr. The UTT/BTT/TT enum prefix and evaluation code is retained pending further cleanup. This is part of the ongoing work to unify type traits following the removal of BinaryTypeTraitExpr in r197273. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198271 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename isBuiltinCall() to getBuiltinCallee()Alp Toker2013-12-28
| | | | | | | | This better describes what the function does. Cleanup only. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198127 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up CGCXXABI creationAlp Toker2013-12-28
| | | | | | | | | | 'create' functions conventionally return a pointer, not a reference. Also use an OwningPtr to get replace the delete of a reference member. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198126 91177308-0d34-0410-b5e6-96231b3b80d8
* Bury leaked pointers in a global array to silence a leak detector in ↵Kostya Serebryany2013-12-27
| | | | | | | | | | | | | | | | --disable-free mode Summary: This is an alternative to http://llvm-reviews.chandlerc.com/D2475 suggested by Chandler. Reviewers: chandlerc, rnk, dblaikie CC: cfe-commits, earthdok Differential Revision: http://llvm-reviews.chandlerc.com/D2478 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198073 91177308-0d34-0410-b5e6-96231b3b80d8
* remove dead code.Adrian Prantl2013-12-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197916 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64]The compare to zero intrinsics should be implemented by 'icmp/fcmp' ↵Hao Liu2013-12-23
| | | | | | and 'sext' not 'zext'. Modify the implementation by replacing zext with sext. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197898 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix getCustomDiagID() usage in CodeGen and TextDiagnosticBufferAlp Toker2013-12-21
| | | | | | | | | | DiagIDs are a cached resource generally only constructed from compile-time constant or stable format strings. Escaping arbitrary messages and constructing DiagIDs from them didn't make sense. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197856 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the ItaniumVTableContext object from CodeGenVTablesReid Kleckner2013-12-20
| | | | | | | | | | | | | Now CodeGenVTables has only one VTableContext object, which is either Itanium or Microsoft. Fixes a FIXME with no functionality change intended. Ideally we could avoid the downcasts by pushing the things that reference the Itanium vtable context into ItaniumCXXABI.cpp, but we're not there yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197845 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Do not include implicit members (implicit special members, ↵David Blaikie2013-12-20
| | | | | | | | | | | | | | template instantiations, etc) in the list of members of a structure. These members will still be lazily added to the relevant DWARF DIEs in LLVM but when enumerating the members they will not appear. This allows DWARF type units to be more consistent - the type unit will never contain these special members (so all instances of the type should have the same DIEs without some having some special members and others having others) and the special members will be added to the skeletal declaration that appears in the relevant compile_unit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197844 91177308-0d34-0410-b5e6-96231b3b80d8
* Override the datalayout in a module with -triple.Rafael Espindola2013-12-20
| | | | | | | | | This matches llc's behavior. Before this patch clang would create a TargetInfo base on -triple but a llvm CodeGen based on the triple in the module. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197837 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the TargetMachine instance into EmitAssemblyHelperAlp Toker2013-12-20
| | | | | | Cleanup in preparation for enhanced DataLayout checking. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197832 91177308-0d34-0410-b5e6-96231b3b80d8
* Hosting a call to getAttr so that we don't call it multiple times for the ↵Aaron Ballman2013-12-19
| | | | | | same attribute. Also removes a hasAttr that's not required. No functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197675 91177308-0d34-0410-b5e6-96231b3b80d8
* Switched code from using hasAttr followed by getAttr to simply call getAttr ↵Aaron Ballman2013-12-19
| | | | | | | | directly and check the resulting value. No functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197652 91177308-0d34-0410-b5e6-96231b3b80d8
* Switched code from using hasAttr followed by getAttr to simply call getAttr ↵Aaron Ballman2013-12-19
| | | | | | | | directly and check the resulting value. No functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197650 91177308-0d34-0410-b5e6-96231b3b80d8
* Replacing calls to getAttr with calls to hasAttr for clarity. No functional ↵Aaron Ballman2013-12-19
| | | | | | change intended -- this only replaces Boolean uses of getAttr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197648 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info: (Bugfix) emit CRV qualifiers for pointers to member functions.Adrian Prantl2013-12-19
| | | | | | rdar://problem/15678916. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197641 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug info: Implement (rvalue) reference qualifiers for C++11 non-staticAdrian Prantl2013-12-18
| | | | | | | | member functions. Paired commit with LLVM. rdar://problem/15356637 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197612 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format parts of the file.Rafael Espindola2013-12-18
| | | | | | | I am about to send a patch for review touching these and clang-formating first makes the patch much easier to read. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197585 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the MSABI and SysVABI calling conventions for Objective-C method ↵Aaron Ballman2013-12-18
| | | | | | declarations. This appears to be an omission from r189644. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197584 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comment-code function name mismatchHans Wennborg2013-12-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197544 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-cxxabi] The 'most derived' ctor parameter usually comes lastReid Kleckner2013-12-17
| | | | | | | | | | | | | | Unlike Itanium's VTTs, the 'most derived' boolean or bitfield is the last parameter for non-variadic constructors, rather than the second. For variadic constructors, the 'most derived' parameter comes after the 'this' parameter. This affects constructor calls and constructor decls in a variety of places. Reviewers: timurrrr Differential Revision: http://llvm-reviews.chandlerc.com/D2405 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197518 91177308-0d34-0410-b5e6-96231b3b80d8
* ASTContext: Refactor implicit record creationAlp Toker2013-12-17
| | | | | | | | Tidy up built-in record creation to reduce code duplication. Continuation of r197336. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197452 91177308-0d34-0410-b5e6-96231b3b80d8
* Support EABIHF environment on ARM.Joerg Sonnenberger2013-12-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197406 91177308-0d34-0410-b5e6-96231b3b80d8