aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
AgeCommit message (Collapse)AuthorFilesLines
2012-11-15Simplify code. No functionality change.Benjamin Kramer1-18/+12
llvm-svn: 168047
2012-11-14When evaluating variably modified types for function parameters, dig out theEli Friedman1-1/+10
type as written from the ParmVarDecl; it's unclear whether the standard (C99 6.9.1p10) requires this, but we're following the precedent set by gcc, and hopefully nobody will ever ask about this again. PR9559 / <rdar://problem/12621983>. llvm-svn: 167985
2012-11-05Use the individual -fsanitize=<...> arguments to control which of the UBSanRichard Smith1-4/+7
checks to enable. Remove frontend support for -fcatch-undefined-behavior, -faddress-sanitizer and -fthread-sanitizer now that they don't do anything. llvm-svn: 167413
2012-11-01Simplify: replace getContext().getLangOpts() with just getLangOpts().Richard Smith1-5/+5
llvm-svn: 167261
2012-10-25Cleanup some clang code to use new type functions instead of using cast<>.Micah Villmow1-2/+1
llvm-svn: 166684
2012-10-23Switch CodeGenOptions over to a .def file, like we do with LangOptions.Douglas Gregor1-1/+1
llvm-svn: 166497
2012-10-16Transform pattern:Alexey Samsonov1-2/+2
if (CGM.getModuleDebugInfo()) DebugInfo = CGM.getModuleDebugInfo() into a call: maybeInitializeDebugInfo(); This is a simplification for a possible future fix of PR13942. llvm-svn: 166019
2012-10-15At -O0, emit an @llvm.trap() call at the end of a value-returning function whichRichard Smith1-0/+2
fails to return a value, to make debugging this issue easier. llvm-svn: 165914
2012-10-10Have 'addFnAttr' take the attribute enum value. Then have it build the ↵Bill Wendling1-2/+2
attribute object and add it appropriately. No functionality change. llvm-svn: 165596
2012-10-10Tidy up formatting.Richard Smith1-2/+1
llvm-svn: 165584
2012-10-10-fcatch-undefined-behavior: catch a VLA bound which evalutes to a ↵Richard Smith1-1/+18
non-positive value. llvm-svn: 165583
2012-10-09-fcatch-undefined-behavior: emit calls to the runtime library whenever one ↵Richard Smith1-1/+3
of the checks fails. llvm-svn: 165536
2012-10-08Move TargetData to DataLayout.Micah Villmow1-1/+1
llvm-svn: 165395
2012-10-04If we flow off the end of a value-returning function:Richard Smith1-0/+14
- outside C++, return undef (behavior is not undefined unless the value is used) - in C++, with -fcatch-undefined-behavior, perform an appropriate trap - in C++, produce an 'unreachable' (behavior is undefined immediately) llvm-svn: 165273
2012-07-23Change APInt to APSInt in one instance. Also change a call to operator==() toRichard Trieu1-2/+2
APSInt::isSameValue() when comparing different sized APSInt's. llvm-svn: 160641
2012-07-15Update Clang to reflect the move of MDBuilder in r160237.Chandler Carruth1-1/+1
llvm-svn: 160238
2012-07-11Add OpenCL metadata for kernel arg names. This output is controlled via a ↵Tanya Lattner1-0/+30
flag as noted in the OpenCL Spec. Includes a test case. llvm-svn: 160092
2012-07-09Patch by Anton Lokhmotov to add OpenCL work group size attributes.Tanya Lattner1-8/+46
llvm-svn: 159965
2012-06-26block literal irgen: several improvements on naming blockFariborz Jahanian1-2/+3
literal helper functions. All helper functions (global and locals) use block_invoke as their prefix. Local literal helper names are prefixed by their enclosing mangled function names. Blocks in non-local initializers (e.g. a global variable or a C++11 field) are prefixed by their mangled variable name. The descriminator number added to end of the name starts off with blank (for first block) and _<N> (for the N+2-th block). llvm-svn: 159206
2012-06-15Documentation cleanup:James Dennett1-1/+1
* Escaped Objective-C @keywords in Doxygen comments; * Documented more accurate \params; * Exposed some more summaries using \brief. llvm-svn: 158559
2012-05-22wire -fbounds-checking to the new LLVM bounds checking passNuno Lopes1-1/+0
llvm-svn: 157262
2012-05-08add -fbounds-checking option.Nuno Lopes1-0/+1
When enabled, clang generates bounds checks for array and pointers dereferences. Work to follow in LLVM's backend. OK'ed by Chad; thanks for the review. llvm-svn: 156431
2012-05-04This patch adds a new Clang compiler flag "-gline-tables-only".Alexey Samsonov1-1/+2
It reduces the amount of emitted debug information: 1) DIEs in .debug_info have types DW_TAG_compile_unit, DW_TAG_subprogram, DW_TAG_inlined_subroutine (for opt builds) and DW_TAG_lexical_block only. 2) .debug_str contains only function names. 3) No debug data for types/namespaces/variables is emitted. 4) The data in .debug_line is enough to produce valid stack traces with function names and line numbers. Reviewed by Eric Christopher. llvm-svn: 156160
2012-04-22PR12571: Objects of type clang::ConstantArrayType aren't always emitted withRichard Smith1-10/+26
type llvm::ArrayType -- sometimes we emit them as packed structs. Don't assert if such a global array has an element type with a non-trivial destructor. llvm-svn: 155305
2012-04-16Remove support for -fast-math metadata for the moment.Duncan Sands1-4/+0
llvm-svn: 154851
2012-04-16Generate fpmath metadata when -ffast-math. Note that no optimizations are hookedDuncan Sands1-1/+6
up to this yet. llvm-svn: 154835
2012-04-16Propagate alignment on lvalues through EmitLValueForField. PR12395.Eli Friedman1-2/+6
llvm-svn: 154789
2012-03-14[frontend] Add support for disabling the "inline" keyword using Chad Rosier1-7/+8
-fno-inline-functions. This behaves much like -fno-inline in gcc, but based on a discussion with Daniel it was decided that -fno-inline-functions should subsume -fno-inline. Please speak up if you object. The -fno-inline flag remains ignored. Final part of rdar://10972766 llvm-svn: 152754
2012-03-11Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie1-5/+5
(Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
2012-03-01Implement "optimization" for lambda-to-block conversion which inlines the ↵Eli Friedman1-2/+1
generated block literal for lambdas which are immediately converted to block pointer type. This simplifies the AST, avoids an unnecessary copy of the lambda and makes it much easier to avoid copying the result onto the heap. Note that this transformation has a substantial semantic effect outside of ARC: it gives the converted lambda lifetime semantics similar to a block literal. With ARC, the effect is much less obvious because the lifetime of blocks is already managed. llvm-svn: 151797
2012-02-25Work-in-progress for lambda conversion-to-block operator. Still need to ↵Eli Friedman1-1/+2
implement the retain+autorelease outside of ARC, and there's a bug that causes the generated code to crash in ARC (which I think is unrelated to my code, although I'm not completely sure). llvm-svn: 151428
2012-02-18Remove redundant check.Chad Rosier1-3/+2
llvm-svn: 150855
2012-02-17Rework the Sema/AST/IRgen dance for the lambda closure type'sDouglas Gregor1-7/+9
conversion to function pointer. Rather than having IRgen synthesize the body of this function, we instead introduce a static member function "__invoke" with the same signature as the lambda's operator() in the AST. Sema then generates a body for the conversion to function pointer which simply returns the address of __invoke. This approach makes it easier to evaluate a call to the conversion function as a constant, makes the linkage of the __invoke function follow the normal rules for member functions, and may make life easier down the road if we ever want to constexpr'ify some of lambdas. Note that IR generation is responsible for filling in the body of __invoke (Sema just adds a dummy body), because the body can't generally be expressed in C++. Eli, please review! llvm-svn: 150783
2012-02-16Start of IRGen for lambda conversion operators.Eli Friedman1-0/+9
llvm-svn: 150649
2012-02-14Remove useless if statement.Eli Friedman1-19/+14
llvm-svn: 150459
2012-02-11Basic support for referring to captured variables from lambdas. Some simple ↵Eli Friedman1-7/+27
examples seem to work. Tests coming up soon. llvm-svn: 150293
2012-02-08CodeGen: Move EHPersonality from CGException.h into the cpp file, it has no ↵Benjamin Kramer1-1/+0
other users. While at it make it value-initializable to get rid of static ctors. llvm-svn: 150070
2012-02-07simplify a bunch of code to use the well-known LLVM IR types computed by ↵Chris Lattner1-4/+2
CodeGenModule. llvm-svn: 149943
2012-01-11Fixed VLA code generation.Abramo Bagnara1-14/+22
llvm-svn: 147933
2012-01-07Fixed TypeofExpr AST and code generation.Abramo Bagnara1-5/+19
llvm-svn: 147730
2011-12-28Small refactoring and simplification of constant evaluation and some of itsRichard Smith1-7/+5
clients. No functionality change. llvm-svn: 147318
2011-11-10Enter the cleanups for a block outside the enclosingJohn McCall1-1/+9
full-expression. Naturally they're inactive before we enter the block literal expression. This restores the intended behavior that blocks belong to their enclosing scope. There's a useful -O0 / compile-time optimization that we're missing here with activating cleanups following straight-line code from their inactive beginnings. llvm-svn: 144268
2011-10-29Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it willRichard Smith1-1/+1
implicitly perform an lvalue-to-rvalue conversion if used on an lvalue expression. Also improve the documentation of Expr::Evaluate* to indicate which of them will accept expressions with side-effects. llvm-svn: 143263
2011-10-24Fix mismatched new[]/delete[].Benjamin Kramer1-1/+1
llvm-svn: 142803
2011-10-21Fix PR11073 by adding the argument type information to the decl we constructEric Christopher1-3/+10
for the function type. Update a testcase accordingly. Patch initially by Anders Waldenborg! llvm-svn: 142700
2011-10-13Recommit:Eric Christopher1-0/+3
Start handling debug line and scope information better: Migrate most of the location setting within the larger API in CGDebugInfo and update a lot of callers. Remove the existing file/scope change machinery in UpdateLineDirectiveRegion and replace it with DILexicalBlockFile usage. Finishes off the rest of rdar://10246360 after fixing a few bugs that were exposed in gdb testsuite testing. llvm-svn: 141893
2011-10-06Support for C1x _Atomic specifier (see testcase). This is primarily being ↵Eli Friedman1-0/+8
committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic. Thanks to Jeffrey Yasskin for the thorough review! llvm-svn: 141330
2011-10-06CUDA: IR generation support for device stubsPeter Collingbourne1-0/+5
llvm-svn: 141304
2011-09-27de-tmpify clang.Benjamin Kramer1-1/+1
llvm-svn: 140637
2011-09-19Throw the switch to convert clang to the new exception handling model!Bill Wendling1-1/+4
This model uses the 'landingpad' instruction, which is pinned to the top of the landing pad. (A landing pad is defined as the destination of the unwind branch of an invoke instruction.) All of the information needed to generate the correct exception handling metadata during code generation is encoded into the landingpad instruction. The new 'resume' instruction takes the place of the llvm.eh.resume intrinsic call. It's lowered in much the same way as the intrinsic is. llvm-svn: 140049