summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
AgeCommit message (Collapse)Author
2012-12-09Unbreak the clang build after r169712.Benjamin Kramer
llvm-svn: 169713
2012-12-04Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth
uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
2012-12-04Have clang use LLVM IR's fast-math flags when in FastMath or FiniteMathOnly ↵Michael Ilseman
modes. Test cases included. llvm-svn: 169191
2012-12-04remove trailing whitespaceMichael Ilseman
llvm-svn: 169187
2012-12-02[ubsan] Add flag to enable recovery from checks when possible.Will Dietz
llvm-svn: 169114
2012-11-15Simplify code. No functionality change.Benjamin Kramer
llvm-svn: 168047
2012-11-14When evaluating variably modified types for function parameters, dig out theEli Friedman
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 Smith
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 Smith
llvm-svn: 167261
2012-10-25Cleanup some clang code to use new type functions instead of using cast<>.Micah Villmow
llvm-svn: 166684
2012-10-23Switch CodeGenOptions over to a .def file, like we do with LangOptions.Douglas Gregor
llvm-svn: 166497
2012-10-16Transform pattern:Alexey Samsonov
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 Smith
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 Wendling
attribute object and add it appropriately. No functionality change. llvm-svn: 165596
2012-10-10Tidy up formatting.Richard Smith
llvm-svn: 165584
2012-10-10-fcatch-undefined-behavior: catch a VLA bound which evalutes to a ↵Richard Smith
non-positive value. llvm-svn: 165583
2012-10-09-fcatch-undefined-behavior: emit calls to the runtime library whenever one ↵Richard Smith
of the checks fails. llvm-svn: 165536
2012-10-08Move TargetData to DataLayout.Micah Villmow
llvm-svn: 165395
2012-10-04If we flow off the end of a value-returning function:Richard Smith
- 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 Trieu
APSInt::isSameValue() when comparing different sized APSInt's. llvm-svn: 160641
2012-07-15Update Clang to reflect the move of MDBuilder in r160237.Chandler Carruth
llvm-svn: 160238
2012-07-11Add OpenCL metadata for kernel arg names. This output is controlled via a ↵Tanya Lattner
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 Lattner
llvm-svn: 159965
2012-06-26block literal irgen: several improvements on naming blockFariborz Jahanian
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 Dennett
* 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 Lopes
llvm-svn: 157262
2012-05-08add -fbounds-checking option.Nuno Lopes
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 Samsonov
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 Smith
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 Sands
llvm-svn: 154851
2012-04-16Generate fpmath metadata when -ffast-math. Note that no optimizations are hookedDuncan Sands
up to this yet. llvm-svn: 154835
2012-04-16Propagate alignment on lvalues through EmitLValueForField. PR12395.Eli Friedman
llvm-svn: 154789
2012-03-14[frontend] Add support for disabling the "inline" keyword using Chad Rosier
-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 Blaikie
(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 Friedman
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 Friedman
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 Rosier
llvm-svn: 150855
2012-02-17Rework the Sema/AST/IRgen dance for the lambda closure type'sDouglas Gregor
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 Friedman
llvm-svn: 150649
2012-02-14Remove useless if statement.Eli Friedman
llvm-svn: 150459
2012-02-11Basic support for referring to captured variables from lambdas. Some simple ↵Eli Friedman
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 Kramer
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 Lattner
CodeGenModule. llvm-svn: 149943
2012-01-11Fixed VLA code generation.Abramo Bagnara
llvm-svn: 147933
2012-01-07Fixed TypeofExpr AST and code generation.Abramo Bagnara
llvm-svn: 147730
2011-12-28Small refactoring and simplification of constant evaluation and some of itsRichard Smith
clients. No functionality change. llvm-svn: 147318
2011-11-10Enter the cleanups for a block outside the enclosingJohn McCall
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 Smith
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 Kramer
llvm-svn: 142803
2011-10-21Fix PR11073 by adding the argument type information to the decl we constructEric Christopher
for the function type. Update a testcase accordingly. Patch initially by Anders Waldenborg! llvm-svn: 142700