aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
AgeCommit message (Collapse)Author
2013-03-29Add RDSEED intrinsic support defined in AVX2 extensionMichael Liao
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178331 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27UBSan: Don't diagnose inf/nan conversions between floating-point types. It's ↵Richard Smith
far from clear whether these have undefined behavior, and these checks are helping no-one. Keep the double->float overflow warnings, though, since those are useful in practice, even though it's unclear whether such operations have defined behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178194 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27If we're unable to create the TargetMachine, then just quit producing theChad Rosier
backend output; there's no need to report a fatal error. This reverts r178042. Part of rdar://13295753 and rdar://13401547 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178102 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26Remove magic number usage from CGDebugInfo with new ↵David Blaikie
DICompositeType::setContainingType git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178092 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26Debug Info: remove use of magic numbers to tweak specific debug info ↵David Blaikie
metadata fields git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178079 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26Remove useGlobalsForAutomaticVariables.Rafael Espindola
It is unused since pic support went away. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178055 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26Fix uninitialized read of CalleeWithThisReturn.Manman Ren
Initialize CalleeWithThisReturn to 0 in the constructor. Also revert r170815 since checking CalleeWithThisReturn is faster. PR15598 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178053 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26Fix a crasher by reporting a fatal error if we're unable to create the targetChad Rosier
machine and one is required. Part of rdar://13295753 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178042 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26Fix uninitialized read of CalleeWithThisReturn.Evgeniy Stepanov
CalleeWithThisReturn can be left initialized if HasThisReturn() is false. This change reverses the order of checks in EmitFunctionEpilog such that CalleeWithThisReturn is only examined when it has a meaningful value. Found with MemorySanitizer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178015 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26The IRReader header is now part of its own library. Update the includeChandler Carruth
line and the library dependencies to reflect this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177972 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25IR-gen should not generate an MMX types unless the code is explicitly using MMXChad Rosier
intrinsics. rdar://13213542 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177911 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-24Simplify code. No functionality change.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177842 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-24Generate metadata to implement the -cl-kernel-arg-info option.Guy Benyei
OpenCL 1.2 spec. 5.7.3. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177839 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23Make clang to mark static stack allocations with lifetime markers to enable ↵Nadav Rotem
a more aggressive stack coloring. Patch by John McCall with help by Shuxin Yang. rdar://13115369 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177819 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-23Under ARC, when we're passing the address of a strong variableJohn McCall
to an out-parameter using the indirect-writeback conversion, and we copied the current value of the variable to the temporary, make sure that we register an intrinsic use of that value with the optimizer so that the value won't get released until we have a chance to retain it. rdar://13195034 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177813 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22[ms-cxxabi] Implement member data pointers for non-dynamic classesReid Kleckner
Summary: For non-dynamic classes (no virtual bases), member data pointers are simple offsets from the base of the record. Dynamic classes use an aggregate for member data pointers and are therefore currently unsupported. Unlike Itanium, the ms ABI uses 0 to represent null for polymorphic classes. Non-polymorphic classes use -1 like Itanium, since 0 is a valid field offset. Reviewers: rjmccall CC: timurrrr, cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D558 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177753 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22[cxxabi] Get ptrdiff_t from the CodeGenModule instead of caching itReid Kleckner
As the comment says, it's a little silly to cache it in the ABI code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177738 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22OpenMP threadprivate directive parsing and semantic analysisAlexey Bataev
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177705 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22ubsan: Pass floating-point arguments to the runtime by value if they fit theRichard Smith
value argument. If not, be sure we don't accidentally use a dynamic alloca. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177690 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20Exploit this-return of a callsite in a this-return function.Manman Ren
For constructors/desctructors that return 'this', if there exists a callsite that returns 'this' and is immediately before the return instruction, make sure we are using the return value from the callsite. We don't need to keep 'this' alive through the callsite. It also enables optimizations in the backend, such as tail call optimization. Updated from r177211. rdar://12818789 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177541 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20The flag "-coverage-function-names-in-data" is actually backwards -- we doNick Lewycky
emit function names in .gcda files by default, and the flag turns that off! Rename the flag to make it match what it actually does. This keeps the default format compatible with gcc 4.2. Also add a test for this flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177475 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-20Make clang emit linkage names in debug info for subprograms when coverage infoNick Lewycky
is enabled. Also add a new -test-coverage cc1 flag which makes testing coverage possible and add our first clang-side coverage test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177470 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19Don't try to set attributes in alias, they have none.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177402 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19Revert r177329.Rafael Espindola
If this should not happen, we should have an assert. If it should happen, we should have a test and remove the comment. In no case should we have this self inconsistent code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177399 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19PR15383: When -fsanitize=float-cast-overflow checks a float-to-int conversion,Richard Smith
it wasn't taking into account that the float should be truncated *before* the range check happens. Thus (unsigned)-0.99 and (unsigned char)255.9 have defined behavior and should not be trapped. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177362 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18This code works around what appears to be a bug in another part of clang.Reed Kotler
I have filed http://llvm.org/bugs/show_bug.cgi?id=15538 against clang. This code is safer anyway because "cast" assumes you really know that it's okay to make the cast. In this case isa should not be false and dyn_cast should not return null as far as I understand. But everything else is valid so I did not want to revert my previous patch for attributes mips16/nomips16 or use an llvm_unreachable here which would make a number of our tests fail for mips. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177329 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-16revert r177211 due to its potential issuesManman Ren
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177222 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-16Exploit this-return of a callsite in a this-return function.Manman Ren
For constructors/desctructors that return 'this', if there exists a callsite that returns 'this' and is immediately before the return instruction, make sure we are using the return value from the callsite. We don't need to keep 'this' alive through the callsite. It also enables optimizations in the backend, such as tail call optimization. rdar://12818789 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177211 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-15Force column info only for direct inlined functions. This should strikeAdrian Prantl
the balance between expected behavior and compatibility with the gdb testsuite. (GDB gets confused if we break an expression into multiple debug stmts so we enable this behavior only for inlined functions. For the full experience people can still use -gcolumn-info.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177164 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-14Always declare the .block_descriptor parameter, not just the local copy.Adrian Prantl
Un-breaks gdb's invoke-block behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177118 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-14Allocate stack storage for .block_descriptor and captured self at -O0.Adrian Prantl
This way the register allocator will not optimize away the debug info for captured variables. Fixes rdar://problem/12767564 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177086 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-14Update GCOVProfiling pass creation for API change in r177002. No ↵Nick Lewycky
functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177004 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-13Have these attriubtes set to 'true' or 'false'.Bill Wendling
The back-end cannot differentiate between functions that are from a .ll file and those generated from the front-end. We cannot then take the non-precense of these attributes as a "false" value. Have the front-end explicitly set the value to 'true' or 'false' depending upon what is actually set. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176985 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-13Cause the mips16/nomips16 attribute to be passed to LLVM from ClangReed Kotler
in the LLVM assembly language output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176971 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-13Remove trailing comma in enum list.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176926 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-13Tighten up the rules for precise lifetime and documentJohn McCall
the requirements on the ARC optimizer. rdar://13407451 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176924 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12Force column info to be generated for call expressions so we canAdrian Prantl
differentiate multiple inlined call sites on the same line in the debug info. Fixes rdar://problem/13036237 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176895 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-11Improve the caching of debuginfo Objective C interface types.Adrian Prantl
Generate forward declarations that are RAUW'd by finalize(). We thus avoid outputting the same type several times in multiple stages of completion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176820 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-10Fix indirect byval passing of records in address spaced memory. Allocate ↵Guy Benyei
memory on stack, and memcpy the actual value before the call. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176786 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-09Make helper function static.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176767 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.Jordan Rose
No (intended) functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176726 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08Add support for the OpenCL attribute 'vec_type_hint'.Joey Gouly
Patch by Murat Bolat! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176686 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07Promote atomic type sizes up to a power of two, capped byJohn McCall
MaxAtomicPromoteWidth. Fix a ton of terrible bugs with _Atomic types and (non-intrinsic-mediated) loads and stores thereto. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176658 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07Move the atomics code into its own file.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176657 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07Change hasAggregateLLVMType, which conflates complex andJohn McCall
aggregate types in a profoundly wrong way that has to be worked around in every call site, to getEvaluationKind, which classifies and distinguishes between all of these cases. Also, normalize the API for loading and storing complexes. I'm working on a larger patch and wanted to pull these changes out, but it would have be annoying to detangle them from each other. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176656 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07Evaluate compound literals directly into the result aggregateJohn McCall
when that aggregate isn't potentially aliased. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176654 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07Remove temporary std::vectors that ca be replaced with ArrayRef's magic.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176653 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07Fix build with clang, this was supposed to be part of r176617.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176619 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06Ensure that DIType is regenerated after we visit an implementationAdrian Prantl
that adds ivars to an interface. Fixes rdar://13175234 This is an update to r176116 that performs a smart caching of interfaces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176584 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06[Sanitize] Don't emit function attribute sanitize_address/thread/memory if ↵Alexey Samsonov
the function is blacklisted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176550 91177308-0d34-0410-b5e6-96231b3b80d8