aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
AgeCommit message (Collapse)Author
2013-01-21CGDebugInfo.cpp: Fix a warning. [-Wunused-variable]NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173022 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21PR14472: Preserve qualifiers while unwrapping types for debug infoDavid Blaikie
Looks like r161368 fixed this for one case but not all. This change generalizes the solution over all the unwrapping cases. Now that preserving the qualifiers is done independent of the particular type being unwrapped I won't bother adding test cases for each one but at least demonstrate that this change was necessary & sufficient to fix the bug. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173002 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20Add top-level Clang flag -f(no-)sanitize-address-zero-base-shadow that makes ↵Alexey Samsonov
AddressSanitizer use bottom of the address space for the shadow memory. On Linux it can be used with -fPIE/-pie to improve performance. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172974 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20Implement OpenCL event_t as Clang builtin type, including event_t related ↵Guy Benyei
OpenCL restrictions (OpenCL 1.2 spec 6.9) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172973 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-20The last of PR14471: Debug info support for inline in-class initializer for ↵David Blaikie
float static members git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172942 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19Emit the function type of member function pointer types the same as member ↵David Blaikie
functions. Adding the pseudo first parameter to a member function pointer's function type and mark it as artificial. Combined with a fix to GDB ( http://sourceware.org/bugzilla/show_bug.cgi?id=14998 ) this fixes gdb.cp/member-ptr.exp with Clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172911 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-19Re-sort all the headers. Lots of regressions have crept in here.Chandler Carruth
Manually fix the order of UnwrappedLineParser.cpp as that one didn't have its associated header as the first header. This also uncovered a subtle inclusion order dependency as CLog.h didn't include LLVM.h to pick up using declarations it relied upon. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172892 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18Use the AttributeSet query method instead of the Attribute method.Bill Wendling
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172849 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-18[ubsan] Add support for -fsanitize-blacklistWill Dietz
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172808 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17[IRgen] Update modules autolink metadata to use module flags (as now specifiedDaniel Dunbar
in the LangRef). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172692 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17Implement C++11 semantics for [[noreturn]] attribute. This required splittingRichard Smith
it apart from [[gnu::noreturn]] / __attribute__((noreturn)), since their semantics are not equivalent (for instance, we treat [[gnu::noreturn]] as affecting the function type, whereas [[noreturn]] does not). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172691 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-17objC block layout: Patch reorders block layout to Fariborz Jahanian
produce more inline layout metadata. // rdar://12752901 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172683 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16Correct order of operands forwarding NEON vfma to LLVM fmaTim Northover
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172650 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16First step in implementation of mips16 and nomips16 attributes.Reed Kotler
Waiting for new llvm attribute code for the next step. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172626 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16Add -fmodules-autolink/-fno-modules-autolink (defaults to on) so thatDouglas Gregor
users can explicitly enable/disable modules autolinking. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172592 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-16Collect both normal and static data members of a class in sourceEric Christopher
order. Describe static data members to metadata using new interfaces. Part of PR14471. Patch by Paul Robinson! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172591 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15Fix signed/unsigned CompareDavid Greene
Do some casting to avoid a signed/unsigned compare. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172571 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15Avoid unsigned Compare to intDavid Greene
Cast arithmetic results to avoid comparison of an unsigned to an int. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172570 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15Fix Const CastDavid Greene
Do proper casting to avoid a cast-away-const error. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172559 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14Multiprecision subtraction builtins.Michael Gottesman
We lower these into 2x chained usub.with.overflow intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172476 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14Topologically sort the link options generated for modules based onDouglas Gregor
module-import dependencies, so we'll get the link order correct for those silly linkers that need it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172459 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14When forming the link options for an imported module, also include theDouglas Gregor
link options for the modules it imports. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172448 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14Switch autolinking metadata format over to actual linker options, e.g.,Douglas Gregor
!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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172441 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14This patch addresses varargs processing for small complex types underBill Schmidt
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172438 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14Implement parsing, AST, (de-)serialization, and placeholder globalDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172437 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-13CGBuiltin.cpp: Fix abuse of ArrayRef in EmitOverflowIntrinsic().NAKAMURA Takumi
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172352 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-13Added builtins for multiprecision adds.Michael Gottesman
We lower all of these intrinsics into a 2x chained usage of uadd.with.overflow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172341 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-12Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko
brought into 'clang' namespace by clang/Basic/LLVM.h git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11Enable the new (more C++-like, less broken) EH model when targeting the GNUstepDavid Chisnall
Objective-C runtime 1.7 or greater. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172207 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10c++ IRGen. In trivial cases that object is going into staticFariborz Jahanian
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172144 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10objectiveC++: When throwing c++ exception of Fariborz Jahanian
an objectiveC object, use objc_exception_throw to raise the exception. // rdar://12605907 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172091 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10Testing with a full OpenCL compiler (based on clang) reveals r71734 missedDavid Tweed
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172047 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-10Don't assert in codegen on static data members which have NoLinkage. FixesNick Lewycky
PR14825! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172031 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-09[ubsan] Make static check data non-const so it can be used for deduplication.Will Dietz
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171947 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07Extract the instance-method case for debug info out into a separate function.David Blaikie
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) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171809 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07[ubsan] Use correct type for compound assignment ops.Will Dietz
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171801 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07Simplify computing debug info type for static member functions.David Blaikie
No (intended) functional change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171800 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07Scalar shifts in the OpenCL specification (as of v. 1.2) are defined to beDavid Tweed
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171755 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07PR14759: Improve/correct support for debug info for C++ member pointers.David Blaikie
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171699 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-07Switch to asking the target machine to add any relevant analysis passsesChandler Carruth
rather than doing it ourselves. This reflects the API changes in r171681. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171683 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05PR14573: Unnamed parameters in debug info, Part 2David Blaikie
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171633 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05Companion patch to r171621 which changed the interface for creating TTIChandler Carruth
passes to a create-pass function instead of a direct constructor call. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171622 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05Emit debug info for unnamed parameters.David Blaikie
LLVM ignores this data for now - patch for that to follow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171605 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-05In my last patch initialize the destination to null (with a simple store) ↵Fariborz Jahanian
before doing a storeStrong to it. // rdar://12530881 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171572 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04objective-C arc: in copy helper function for Fariborz Jahanian
__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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171555 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04Debug Info: fix the line location for cleanup code of a block functionManman Ren
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171493 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04Fix fieldNo usage for lambdas. No behavior change since theEric Christopher
field number was 0 anyhow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171472 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-03Don't assert/crash on reference variables in lambdas bound to aEli Friedman
static local variable from the parent scope. PR14773. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171433 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth
reflect the migration in r171366. Re-sort the #include lines to reflect the new paths. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171369 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-02Re-sort #include lines using the llvm/utils/sort_includes.py script.Chandler Carruth
Removes a duplicate #include as well as cleaning up some sort order regressions since I last ran the script over Clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171364 91177308-0d34-0410-b5e6-96231b3b80d8