summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Add -fmodules-autolink/-fno-modules-autolink (defaults to on) so thatDouglas Gregor2013-01-161-1/+4
| | | | | | users can explicitly enable/disable modules autolinking. llvm-svn: 172592
* Collect both normal and static data members of a class in sourceEric Christopher2013-01-162-106/+173
| | | | | | | | | | order. Describe static data members to metadata using new interfaces. Part of PR14471. Patch by Paul Robinson! llvm-svn: 172591
* Fix signed/unsigned CompareDavid Greene2013-01-151-1/+2
| | | | | | Do some casting to avoid a signed/unsigned compare. llvm-svn: 172571
* Avoid unsigned Compare to intDavid Greene2013-01-151-1/+1
| | | | | | Cast arithmetic results to avoid comparison of an unsigned to an int. llvm-svn: 172570
* Fix Const CastDavid Greene2013-01-151-1/+2
| | | | | | Do proper casting to avoid a cast-away-const error. llvm-svn: 172559
* Multiprecision subtraction builtins.Michael Gottesman2013-01-141-2/+22
| | | | | | We lower these into 2x chained usub.with.overflow intrinsics. llvm-svn: 172476
* Topologically sort the link options generated for modules based onDouglas Gregor2013-01-142-67/+115
| | | | | | | module-import dependencies, so we'll get the link order correct for those silly linkers that need it. llvm-svn: 172459
* When forming the link options for an imported module, also include theDouglas Gregor2013-01-141-2/+7
| | | | | | link options for the modules it imports. llvm-svn: 172448
* Switch autolinking metadata format over to actual linker options, e.g.,Douglas Gregor2013-01-142-30/+33
| | | | | | | | | | | | | | | | | | | !0 = metadata !{metadata !"-lautolink"} !1 = metadata !{metadata !"-framework", metadata !"autolink_framework"} referenced from llvm.module.linkoptions, e.g., !llvm.module.linkoptions = !{!0, !1, !2, !3} This conceptually moves the logic for figuring out the syntax the linker will accept from LLVM into Clang. Moreover, it makes it easier to support MSVC's #pragma comment(linker, "some option") in the future, should anyone care to do so. llvm-svn: 172441
* This patch addresses varargs processing for small complex types underBill Schmidt2013-01-141-1/+39
| | | | | | | | | | | | | | | | | | | the 64-bit PowerPC ELF ABI. The ABI requires that the real and imaginary parts of a complex argument each occupy their own doubleword. Arguments smaller than 8 bytes are right-adjusted within the doubleword. Clang expects EmitVAARG() to return a pointer to a structure in which the real and imaginary parts are packed adjacently in memory. To accomplish this, we generate code to load the code appropriately from the varargs location and pack the values into a temporary variable in the form Clang expects, returning a pointer to that structure. The test case demonstrates correct code generation for all "small" complex types on PPC64: int, short, char, and float. llvm-svn: 172438
* Implement parsing, AST, (de-)serialization, and placeholder globalDouglas Gregor2013-01-142-2/+80
| | | | | | | | | | | | | | | | | | | | | | | | | metadata for linking against the libraries/frameworks for imported modules. The module map language is extended with a new "link" directive that specifies what library or framework to link against when a module is imported, e.g., link "clangAST" or link framework "MyFramework" Importing the corresponding module (or any of its submodules) will eventually link against the named library/framework. For now, I've added some placeholder global metadata that encodes the imported libraries/frameworks, so that we can test that this information gets through to the IR. The format of the data is still under discussion. llvm-svn: 172437
* CGBuiltin.cpp: Fix abuse of ArrayRef in EmitOverflowIntrinsic().NAKAMURA Takumi2013-01-131-2/+1
| | | | | | | | | | | | | | | | | | | | In ArrayRef<T>(X), X should not be temporary value. It could be rewritten more redundantly; llvm::Type *XTy = X->getType(); ArrayRef<llvm::Type *> Ty(XTy); llvm::Value *Callee = CGF.CGM.getIntrinsic(IntrinsicID, Ty); Since it is safe if both XTy and Ty are temporary value in one statement, it could be shorten; llvm::Value *Callee = CGF.CGM.getIntrinsic(IntrinsicID, ArrayRef<llvm::Type*>(X->getType())); ArrayRef<T> has an implicit constructor to create uni-entry of T; llvm::Value *Callee = CGF.CGM.getIntrinsic(IntrinsicID, X->getType()); MSVC-generated clang.exe crashed. llvm-svn: 172352
* Added builtins for multiprecision adds.Michael Gottesman2013-01-131-0/+70
| | | | | | | We lower all of these intrinsics into a 2x chained usage of uadd.with.overflow. llvm-svn: 172341
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-1216-47/+45
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Enable the new (more C++-like, less broken) EH model when targeting the GNUstepDavid Chisnall2013-01-112-0/+17
| | | | | | Objective-C runtime 1.7 or greater. llvm-svn: 172207
* c++ IRGen. In trivial cases that object is going into staticFariborz Jahanian2013-01-101-0/+17
| | | | | | | | | | storage and thus is implicitly zero-initialized, no need to do C++11 memory model. This patch unconditionally detects such condition and zeroinitializer's the variable. Patch has been commented on and OKed by Doug off-line. // rdar://12897704 llvm-svn: 172144
* objectiveC++: When throwing c++ exception of Fariborz Jahanian2013-01-104-10/+32
| | | | | | | an objectiveC object, use objc_exception_throw to raise the exception. // rdar://12605907 llvm-svn: 172091
* Testing with a full OpenCL compiler (based on clang) reveals r71734 missedDavid Tweed2013-01-101-2/+6
| | | | | | | difference between type widths of a vector and the width of one of its elements in the case of vector shifts. Use correct witdth in the vector case. llvm-svn: 172047
* Don't assert in codegen on static data members which have NoLinkage. FixesNick Lewycky2013-01-101-4/+2
| | | | | | PR14825! llvm-svn: 172031
* [ubsan] Make static check data non-const so it can be used for deduplication.Will Dietz2013-01-091-1/+1
| | | | llvm-svn: 171947
* Extract the instance-method case for debug info out into a separate function.David Blaikie2013-01-072-10/+12
| | | | | | | | | | This is in preparation for using this to construct the function type for pointers to member functions to include the implicit/artificial 'this' parameter in that case as well. (feedback from GDB indicates that this might be all that's necessary to get it to behave well with Clang's pointer-to-member function debug output) llvm-svn: 171809
* [ubsan] Use correct type for compound assignment ops.Will Dietz2013-01-071-2/+2
| | | | llvm-svn: 171801
* Simplify computing debug info type for static member functions.David Blaikie2013-01-071-26/+27
| | | | | | No (intended) functional change. llvm-svn: 171800
* Scalar shifts in the OpenCL specification (as of v. 1.2) are defined to beDavid Tweed2013-01-071-11/+20
| | | | | | | | | | with respect to the lower "left-hand-side bitwidth" bits, even when negative); see OpenCL spec 6.3j. This patch both implements this behaviour in the code generator and "constant folding" bits of Sema, and also prevents tests to detect undefinedness in terms of the weaker C99 or C++ specifications from being applied. llvm-svn: 171755
* PR14759: Improve/correct support for debug info for C++ member pointers.David Blaikie2013-01-071-32/+2
| | | | | | | | | | Using added LLVM functionality in r171698. This works in GDB for member variable pointers but not member function pointers. See the LLVM commit and GDB bug 14998 for details. Un-xfailing cases in the GDB 7.5 test suite will follow. llvm-svn: 171699
* Switch to asking the target machine to add any relevant analysis passsesChandler Carruth2013-01-071-19/+8
| | | | | | rather than doing it ourselves. This reflects the API changes in r171681. llvm-svn: 171683
* PR14573: Unnamed parameters in debug info, Part 2David Blaikie2013-01-051-2/+2
| | | | | | | | Catch some cases I'd missed in r171605 related to unnamed parameters of record type. This resolves all remaining cases of PR14573 suppression in the GDB 7.5 test suite. Fix to the test suite to follow. llvm-svn: 171633
* Companion patch to r171621 which changed the interface for creating TTIChandler Carruth2013-01-051-14/+10
| | | | | | passes to a create-pass function instead of a direct constructor call. llvm-svn: 171622
* Emit debug info for unnamed parameters.David Blaikie2013-01-051-17/+15
| | | | | | LLVM ignores this data for now - patch for that to follow. llvm-svn: 171605
* In my last patch initialize the destination to null (with a simple store) ↵Fariborz Jahanian2013-01-051-0/+2
| | | | | | | | before doing a storeStrong to it. // rdar://12530881 llvm-svn: 171572
* objective-C arc: in copy helper function for Fariborz Jahanian2013-01-041-0/+5
| | | | | | | | | __strong __block variables, perform objc_storeStrong on source and destination instead of direct move. This is done with -O0 and to improve some analysis. // rdar://12530881 llvm-svn: 171555
* Debug Info: fix the line location for cleanup code of a block functionManman Ren2013-01-041-0/+3
| | | | | | | | | | The line information was changed when emitting debug information for all the DeclRefExprs and we should change it back to get ready for PopClenupBlocks called from FinishFunction. rdar://11562117 llvm-svn: 171493
* Fix fieldNo usage for lambdas. No behavior change since theEric Christopher2013-01-041-2/+2
| | | | | | field number was 0 anyhow. llvm-svn: 171472
* Don't assert/crash on reference variables in lambdas bound to aEli Friedman2013-01-032-9/+2
| | | | | | static local variable from the parent scope. PR14773. llvm-svn: 171433
* Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth2013-01-0240-102/+102
| | | | | | | | reflect the migration in r171366. Re-sort the #include lines to reflect the new paths. llvm-svn: 171369
* Re-sort #include lines using the llvm/utils/sort_includes.py script.Chandler Carruth2013-01-022-2/+2
| | | | | | | Removes a duplicate #include as well as cleaning up some sort order regressions since I last ran the script over Clang. llvm-svn: 171364
* Simplify vector splat code. No functionality change.Benjamin Kramer2013-01-011-18/+2
| | | | llvm-svn: 171350
* Remove the Function::getFnAttributes method in favor of using the AttributeSetBill Wendling2012-12-302-2/+4
| | | | | | | | | directly. This is in preparation for removing the use of the 'Attribute' class as a collection of attributes. That will shift to the AttributeSet class instead. llvm-svn: 171254
* Add proper support for -fsanitize-blacklist= flag for TSan and MSan. Clang part.Alexey Samsonov2012-12-281-4/+8
| | | | llvm-svn: 171184
* Add intel_ocl_bicc calling convention as a function attribute to clang. The ↵Guy Benyei2012-12-251-0/+4
| | | | | | calling convention is already implemented in LLVM. llvm-svn: 171056
* Support -fsanitize-memory-track-origins.Evgeniy Stepanov2012-12-241-1/+4
| | | | llvm-svn: 171020
* CGClass.cpp: [PR14335] Remove comma-separated \param, for now. [-Wdocumentation]NAKAMURA Takumi2012-12-241-4/+0
| | | | | | /// \param argBegin,argEnd the arguments to evaluate and pass to the constructor llvm-svn: 171015
* CGDecl.cpp: Prune three descriptions in two methods, ↵NAKAMURA Takumi2012-12-241-8/+0
| | | | | | | | | | CodeGenFunction::pushIrregularPartialArrayCleanup() and CodeGenFunction::pushRegularPartialArrayCleanup(). [-Wdocumentation] /// \param array - a value of type elementType* /// \param destructionKind - the kind of destruction required /// \param initializedElementCount - a value of type size_t* holding the number of successfully-constructed elements llvm-svn: 171013
* CGValue.h: Update one \param to Addr in MakeBitfield(). [-Wdocumentation]NAKAMURA Takumi2012-12-241-1/+1
| | | | llvm-svn: 171011
* Reinstate r170806, reverted in r170835, with a fix use i1 instead of i8 for ↵Richard Smith2012-12-212-8/+5
| | | | | | a value-initialized bool! llvm-svn: 170837
* Revert r170806, "Fix some bugs where we would sometimes use 0, not -1, when ↵NAKAMURA Takumi2012-12-212-5/+8
| | | | | | | | emitting a null constant of type pointer-to-data-member." It broke stage2. llvm-svn: 170835
* Don't eagerly emit a global static merged with a local extern.Rafael Espindola2012-12-212-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | When we are visiting the extern declaration of 'i' in static int i = 99; int foo() { extern int i; return i; } We should not try to handle it as if it was an function static. That is, we must consider the written storage class. Fixing this then exposes that the assert in EmitGlobalVarDeclLValue and the if leading to its call are not completely accurate. They were passing before because the second decl was marked as having external storage. I changed them to check the linkage, which I find easier to understand. Last but not least, there is something strange going on with cuda and opencl. My guess is that the linkage computation for these languages needs to be audited, but I didn't want to change that in this patch so I just updated the storage classes to keep the current behavior. Thanks to Reed Kotler for reporting this. llvm-svn: 170827
* Fix some bugs where we would sometimes use 0, not -1, when emitting a null ↵Richard Smith2012-12-202-8/+5
| | | | | | constant of type pointer-to-data-member. llvm-svn: 170806
* Rename llvm::Attributes to llvm::Attribute.Bill Wendling2012-12-2012-85/+85
| | | | llvm-svn: 170722
* Revert r170500. It over-zealously converted *ALL* things named Attributes, ↵Bill Wendling2012-12-2012-85/+85
| | | | | | which is wrong here. llvm-svn: 170721
OpenPOWER on IntegriCloud