summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Simplify the CodeGenFunction::Build*Virtual*Call family of functionsTimur Iskhodzhanov2013-07-194-65/+40
| | | | llvm-svn: 186657
* OpenMP: basic support for #pragma omp parallelAlexey Bataev2013-07-191-0/+1
| | | | llvm-svn: 186647
* Update createCompileUnit call for llvm changes.Eric Christopher2013-07-191-5/+4
| | | | llvm-svn: 186638
* s/BuiltinLocation/ArtificialLocation/Adrian Prantl2013-07-183-10/+10
| | | | llvm-svn: 186557
* Instead of checking against some version of "isType()" go ahead andEric Christopher2013-07-181-14/+14
| | | | | | | use the conversion to bool to check if we've managed to get a type that isn't default constructed - as we meant to in the first place. llvm-svn: 186556
* Fix a compile error caught by bb-chapuni.Adrian Prantl2013-07-181-2/+3
| | | | llvm-svn: 186555
* Fix a compile error caught by bb-chapuni.Adrian Prantl2013-07-181-1/+1
| | | | llvm-svn: 186554
* Don't generate bogus line table entries for __copy_helper_block_ andAdrian Prantl2013-07-181-0/+4
| | | | | | __destroy_helper_block_, but do generate scope information. llvm-svn: 186553
* Replace llvm::DIBuilder::DisableDebugLocations() with two RAII interfacesAdrian Prantl2013-07-183-3/+75
| | | | | | | | | | | | | inspired by CodegenFunction::LexicalScope. - NoLocation temporarily turns off debug locations altogether. This is useful for emitting instructions that should be counted towards the function prologue. - BuiltinLocation temporarily switches to an artificial debug location that has a valid scope, but no line information. This is useful when emitting compiler-generated helper functions that have no source location associated with them. llvm-svn: 186552
* Clarified documentation.Adrian Prantl2013-07-181-1/+2
| | | | llvm-svn: 186551
* Simplify logic by using the appropriate function.Adrian Prantl2013-07-181-1/+1
| | | | llvm-svn: 186550
* 80-column fixes.Eric Christopher2013-07-171-1/+2
| | | | llvm-svn: 186542
* Propagate alignment for _ComplexJF Bastien2013-07-171-6/+20
| | | | | | | | _Complex load/store didn't have their alignment set properly, which was visible when GCC's torture tests use volatile _Complex. Update some existing tests to check for alignment, and add a new test which also has over-aligned volatile _Complex (since the imaginary part shouldn't be overaligned, only the real part). llvm-svn: 186490
* Make Expr::isConstantInitializer match IRGen.Eli Friedman2013-07-162-2/+6
| | | | | | | | | | Sema needs to be able to accurately determine what will be emitted as a constant initializer and what will not, so we get accurate errors in C and accurate -Wglobal-constructors warnings in C++. This makes Expr::isConstantInitializer match CGExprConstant as closely as possible. llvm-svn: 186464
* Fix crash on complex constant zero.Eli Friedman2013-07-161-3/+3
| | | | | | Fixes <rdar://problem/14442543>. llvm-svn: 186452
* ARM: implement low-level intrinsics for the atomic exclusive operations.Tim Northover2013-07-161-6/+58
| | | | | | | | | | | | This adds three overloaded intrinsics to Clang: T __builtin_arm_ldrex(const volatile T *addr) int __builtin_arm_strex(T val, volatile T *addr) void __builtin_arm_clrex() The intent is that these do what users would expect when given most sensible types. Currently, "sensible" translates to ints, floats and pointers. llvm-svn: 186394
* Use llvm::array_lengthof to replace sizeof(array)/sizeof(array[0]).Craig Topper2013-07-151-1/+1
| | | | llvm-svn: 186300
* Reformat line.Eric Christopher2013-07-141-2/+1
| | | | llvm-svn: 186294
* Move BlockLiteralGeneric earlier in CGDebugInfo and removeEric Christopher2013-07-142-8/+4
| | | | | | | BlockLiteralGenericSet and replace with a call to isType() on the BlockLiteralGeneric. llvm-svn: 186293
* Update a few comments and reformat a decl for clarity.Eric Christopher2013-07-141-3/+4
| | | | llvm-svn: 186292
* Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector ↵Craig Topper2013-07-141-1/+1
| | | | | | size. llvm-svn: 186284
* PR16214, PR14467: DebugInfo: use "RequireCompleteType" to decide when to ↵David Blaikie2013-07-136-35/+13
| | | | | | | | | | | | | | | emit the full definition of a type in -flimit-debug-info This simplifies the core benefit of -flimit-debug-info by taking a more systematic approach to avoid emitting debug info definitions for types that only require declarations. The previous ad-hoc approach (3 cases removed in this patch) had many holes. The general approach (adding a bit to TagDecl and callback through ASTConsumer) has been discussed with Richard Smith - though always open to revision. llvm-svn: 186262
* Correctly classify pack expansions as NON_CANONICAL_UNLESS_DEPENDENTDavid Blaikie2013-07-132-0/+2
| | | | | | | | | | | Test coverage for non-dependent pack expansions doesn't demonstrate a failure prior to this patch (a follow-up commit improving debug info will cover this commit specifically) but covers a related hole in our test coverage. Reviewed by Richard Smith & Eli Friedman. llvm-svn: 186261
* Changes so that a few tests do not fail when running under guarded malloc.Argyrios Kyrtzidis2013-07-121-5/+5
| | | | | | | Guarded malloc emits some messages at the beginning in stderr when enabled. These messages caused a few tests to fail. llvm-svn: 186219
* Use function attributes to pass along the stack protector buffer size ↵Bill Wendling2013-07-122-1/+2
| | | | | | instead of making it a target option. llvm-svn: 186218
* Compute 'this' correctly for block in lambda.Eli Friedman2013-07-121-8/+3
| | | | | | | | | Using CurFuncDecl is both correct and simple compared to crawling the DeclContexts of the block. Fixes <rdar://problem/14415072>. llvm-svn: 186210
* Fix build.Eli Friedman2013-07-111-2/+2
| | | | | | Sorry about that. llvm-svn: 186054
* Add a __builtin_addressof that performs the same functionality as the built-inRichard Smith2013-07-111-0/+2
| | | | | | | | | | | & operator (ignoring any overloaded operator& for the type). The purpose of this builtin is for use in std::addressof, to allow it to be made constexpr; the existing implementation technique (reinterpret_cast to some reference type, take address, reinterpert_cast back) does not permit this because reinterpret_cast between reference types is not permitted in a constant expression in C++11 onwards. llvm-svn: 186053
* Simplify atomic load/store IRGen.Eli Friedman2013-07-114-138/+47
| | | | | | Also fixes a couple minor bugs along the way; see testcases. llvm-svn: 186049
* Use a LexicalScope here since it is one and it will encapsulateEric Christopher2013-07-101-12/+2
| | | | | | the two sets of debug scope and cleanup scope. llvm-svn: 186030
* Get rid of dead/useless code for block mangling.Eli Friedman2013-07-101-3/+0
| | | | llvm-svn: 185989
* Apply BlackList -> SpecialCaseList rename in Clang.Peter Collingbourne2013-07-091-3/+3
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1095 llvm-svn: 185979
* Reapply an improved version of r180816/180817.Adrian Prantl2013-07-091-16/+0
| | | | | | | | | | | Do not generate VLAs as complex variables any more, as they are now correctly represented as breg+0 locations in the backend. (Paired commit with LLVM: r185966) rdar://problem/13658587 llvm-svn: 185967
* Simplify code. No functional change.Craig Topper2013-07-081-3/+1
| | | | llvm-svn: 185792
* Don't use mangleCXXRTTIName in TBAA for C code.Eli Friedman2013-07-051-9/+1
| | | | | | | | | | | | | | This changes the TBAA code so it doesn't use mangleCXXRTTIName in C, because it doesn't really make sense there. Also, as sort of a defense-in-depth change, fix the mangler so it handles C RecordDecls correctly. No tests because I don't know the TBAA code well enough to write a test, and I don't know how else to trigger mangling a local struct in C. Fixes a crash with r185450 reported by Joerg Sonnenberger. llvm-svn: 185721
* Use SmallVectorImpl& for function arguments instead of SmallVector.Craig Topper2013-07-054-5/+5
| | | | llvm-svn: 185715
* Add target hook CodeGen queries when generating builtin pow*.Eli Bendersky2013-07-033-7/+20
| | | | | | | | | | | Without fmath-errno, Clang currently generates calls to @llvm.pow.* intrinsics when it sees pow*(). This may not be suitable for all targets (for example le32/PNaCl), so the attached patch adds a target hook that CodeGen queries. The target can state its preference for having or not having the intrinsic generated. Non-PNaCl behavior remains unchanged; PNaCl-specific test added. llvm-svn: 185568
* Debug Info: clean up usage of Verify.Manman Ren2013-07-021-14/+14
| | | | | | | No functionality change. It should suffice to check the type of a debug info metadata, instead of calling Verify. llvm-svn: 185463
* Simplify linkage code for static local vars.Eli Friedman2013-07-013-55/+4
| | | | | | | | | The key insight here is that weak linkage for a static local variable should always mean linkonce_odr, because every file that needs it will generate a definition. We don't actually care about the precise linkage of the parent context. I feel a bit silly that I didn't realize this before. llvm-svn: 185381
* Fix mangling for block literals.Eli Friedman2013-07-013-14/+43
| | | | | | | | | | | | | | | Blocks, like lambdas, can be written in contexts which are required to be treated as the same under ODR. Unlike lambdas, it isn't possible to actually take the address of a block, so the mangling of the block itself doesn't matter. However, objects like static variables inside a block do need to be mangled in a consistent way. There are basically three components here. One, block literals need a consistent numbering. Two, objects/types inside a block literal need to be mangled using it. Three, objects/types inside a block literal need to have their linkage computed correctly. llvm-svn: 185372
* Restore r184205 and associated commits (after commit of r185290)Stephen Lin2013-06-3010-208/+135
| | | | | | This allows clang to use the backend parameter attribute 'returned' when generating 'this'-returning constructors and destructors in ARM and MSVC C++ ABIs. llvm-svn: 185291
* Remove dead code.Eli Friedman2013-06-281-55/+2
| | | | llvm-svn: 185231
* [ms-cxxabi] Move CodeGenVTables::needsVTTParameter to ItaniumCXXABI.Peter Collingbourne2013-06-286-31/+38
| | | | | | | | | This function only makes sense there. Eventually it should no longer be part of the CGCXXABI interface, as it is an Itanium-specific detail. Differential Revision: http://llvm-reviews.chandlerc.com/D821 llvm-svn: 185213
* Delete dead code.Eli Friedman2013-06-282-40/+16
| | | | llvm-svn: 185119
* Use the zero-argument DIBuilder::createNullPtrType in Clang.Peter Collingbourne2013-06-271-2/+1
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D1051 llvm-svn: 185115
* Ensure that debugger calls to signature-less functions default toJohn McCall2013-06-271-0/+7
| | | | | | | | | | | | | | | | | | | | | passing arguments in the fixed style. We have an abstraction for deciding this, but it's (1) deep in IR-generation, (2) necessarily tied to exact argument lists, and (3) triggered by unprototyped function types, which we can't legitimately make in C++ mode. So this solution, wherein Sema rewrites the function type to an exact prototype but leaves the variadic bit enabled so as to request x86-64-like platforms to pass the extra variadic info, is very much a hack, but it's one that works in practice on the platforms that LLDB will support in the medium term --- the only place we know of where it's a problem is instance methods in Windows, where variadic functions are implicitly cdecl. We may have a more abstracted base on which to build a solution by then. rdar://13731520 llvm-svn: 185112
* Rewrite record layout for ms_struct structs.Eli Friedman2013-06-264-95/+4
| | | | | | | | | | | | | | The old implementation of ms_struct in RecordLayoutBuilder was a complete mess: it depended on complicated conditionals which didn't really reflect the underlying logic, and placed a burden on users of the resulting RecordLayout. This commit rips out almost all of the old code, and replaces it with simple checks in RecordLayoutBuilder::LayoutBitField. This commit also fixes <rdar://problem/14252115>, a bug where class inheritance would cause us to lay out bitfields incorrectly. llvm-svn: 185018
* Remove misplaced commentEli Bendersky2013-06-251-1/+0
| | | | llvm-svn: 184862
* Make -vectorize-... proper cc1 flags instead of abusing -backend-option. FixesNick Lewycky2013-06-251-0/+3
| | | | | | usage of clang as a library. llvm-svn: 184812
* [AST] Introduce a new DecayedType sugar nodeReid Kleckner2013-06-242-0/+8
| | | | | | | | | | | | | | The goal of this sugar node is to be able to look at an arbitrary FunctionType and tell if any of the parameters were decayed from an array or function type. Ultimately this is necessary to implement Microsoft's C++ name mangling scheme, which mangles decayed arrays differently from normal pointers. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D1014 llvm-svn: 184763
OpenPOWER on IntegriCloud