summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExpr.cpp
AgeCommit message (Collapse)Author
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-11-01Split emission of -ftrapv checks and -fcatch-undefined-behavior checks intoRichard Smith
separate functions, since they share essentially no code. llvm-svn: 167259
2012-11-01-fcatch-undefined-behavior: Start checking loads and stores for null pointers.Richard Smith
We want the diagnostic, and if the load is optimized away, we still want to trap it. Stop checking non-default address spaces; that doesn't work in general. llvm-svn: 167219
2012-10-30Don't crash on bad atomic operations. PR14176.Eli Friedman
llvm-svn: 166992
2012-10-27Move two helper functions to AST so that sema can use them.Rafael Espindola
llvm-svn: 166853
2012-10-27Refactor some code into a new findMaterializedTemporary function.Rafael Espindola
llvm-svn: 166849
2012-10-27Refactor some code into a new skipRValueSubobjectAdjustments function.Rafael Espindola
llvm-svn: 166848
2012-10-27Delay codegen to after collecting all SubobjectAdjustment so that the collectionRafael Espindola
can be refactored and used in Sema. llvm-svn: 166847
2012-10-25-fcatch-undefined-behavior checking for appropriate vptr value: Clang ↵Richard Smith
CodeGen side. llvm-svn: 166661
2012-10-20DR1472: A reference isn't odr-used if it has preceding initialization,Richard Smith
initialized by a reference constant expression. Our odr-use modeling still needs work here: we don't yet implement the 'set of potential results of an expression' DR. llvm-svn: 166361
2012-10-15Move the Attributes::Builder outside of the Attributes class and into its ↵Bill Wendling
own class named AttrBuilder. No functionality change. llvm-svn: 165961
2012-10-15Attributes RewriteBill Wendling
Convert the uses of the Attributes class over to the new format. The Attributes::get method call now takes an LLVM context so that the attributes object can be uniquified and stored. llvm-svn: 165918
2012-10-11Add codegen support for __uuidof().Nico Weber
llvm-svn: 165710
2012-10-10Remove the final bits of Attributes being declared in the AttributeBill Wendling
namespace. Use the attribute's enum value instead. No functionality change intended. llvm-svn: 165611
2012-10-09-fcatch-undefined-behavior: store the type name directly at the end of a ↵Richard Smith
type descriptor. 5% binary size reduction due to fewer relocations. llvm-svn: 165572
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-09-08When a bad UTF-8 encoding or bogus escape sequence is encountered in aRichard Smith
string literal, produce a diagnostic pointing at the erroneous character range, not at the start of the literal. llvm-svn: 163459
2012-09-08-fcatch-undefined-behavior: Factor emission of the creation of, and branch to,Richard Smith
the trap BB out of the individual checks and into a common function, to prepare for making this code call into a runtime library. Rename the existing EmitCheck to EmitTypeCheck to clarify it and to move it out of the way of the new EmitCheck. llvm-svn: 163451
2012-08-31Change the representation of builtin functions in the ASTEli Friedman
(__builtin_* etc.) so that it isn't possible to take their address. Specifically, introduce a new type to represent a reference to a builtin function, and a new cast kind to convert it to a function pointer in the operand of a call. Fixes PR13195. llvm-svn: 162962
2012-08-24New -fcatch-undefined-behavior features:Richard Smith
* when checking that a pointer or reference refers to appropriate storage for a type, also check the alignment and perform a null check * check that references are bound to appropriate storage * check that 'this' has appropriate storage in member accesses and member function calls llvm-svn: 162523
2012-08-16Convert loads and stores of vec3 to vec4 to achieve better code generation. ↵Tanya Lattner
Add test case. llvm-svn: 162002
2012-08-08Fix an assertion failure with a C++ constructor initializing aEli Friedman
member of reference type in an anonymous struct. PR13154. llvm-svn: 161473
2012-07-15Update Clang to reflect the move of MDBuilder in r160237.Chandler Carruth
llvm-svn: 160238
2012-07-07Distinguish more carefully between free functions and C++ instance methodsJohn McCall
in the ABI arrangement, and leave a hook behind so that we can easily tweak CCs on platforms that use different CCs by default for C++ instance methods. llvm-svn: 159894
2012-07-03Silence warning in -Asserts buildMatt Beaumont-Gay
llvm-svn: 159635
2012-07-03Share ConvertUTF8toWide() between Lex and CodeGen.Nico Weber
llvm-svn: 159634
2012-07-02Significantly simplify CGExprAgg's logic about ignored results:John McCall
if we want to ignore a result, the Dest will be null. Otherwise, we must copy into it. This means we need to ensure a slot when loading from a volatile l-value. With all that in place, fix a bug with chained assignments into __block variables of aggregate type where we were losing insight into the actual source of the value during the second assignment. llvm-svn: 159630
2012-06-27Propagate lvalue alignment into bitfields. Per report on cfe-dev.Eli Friedman
llvm-svn: 159295
2012-06-23Support L__FUNCTION__ in microsoft mode, PR11789Nico Weber
Heavily based on a patch from Aaron Wishnick <aaron.s.wishnick@gmail.com>. I'll clean up the duplicated function in CodeGen as a follow-up, later today or tomorrow. llvm-svn: 159060
2012-06-15Make the ".*" operator work correctly when the base is a prvalue and the ↵Eli Friedman
field has a non-trivial copy constructor. PR13097. llvm-svn: 158578
2012-06-07User better API for vla in compund literals.Fariborz Jahanian
// rdar://11485774 llvm-svn: 158157
2012-06-07When emitting compund literal of vla pointer elements, make Fariborz Jahanian
sure to emit vla size to prevent an irgen crash. // rdar://11485774 llvm-svn: 158153
2012-05-22wire -fbounds-checking to the new LLVM bounds checking passNuno Lopes
llvm-svn: 157262
2012-05-22revert the usage of the objectsize intrinsic with 3 parameters (to match ↵Nuno Lopes
LLVM r157255) llvm-svn: 157256
2012-05-14Implement IRGen for C++11's "T{1, 2, 3}", where T is an aggregate and theRichard Smith
expression is treated as an lvalue. llvm-svn: 156781
2012-05-09update calls to objectsize intrinsic to match LLVM r156473Nuno Lopes
add a test for -fbounds-checking code generation llvm-svn: 156474
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-07remove code to add bound checks for simple array accesses, since those are ↵Nuno Lopes
already covered by the check with the objectsize builtin remove the comparison of objectsize with -1. since it's an unsigned comparison, it will always succeed if objectsize returns -1, which is enough to have the check removed llvm-svn: 156311
2012-05-01Push variable declaration into nested scope (the only place where it is ↵Ted Kremenek
used). Found by static analyzer. llvm-svn: 155922
2012-05-01Abstract the emission of global destructors into ABI-specific codeJohn McCall
and only consider using __cxa_atexit in the Itanium logic. The default logic is to use atexit(). Emit "guarded" initializers in Microsoft mode unconditionally. This is definitely not correct, but it's closer to correct than just not emitting the initializer. Based on a patch by Timur Iskhodzhanov! llvm-svn: 155894
2012-04-16Adjust for LLVM name tweaks requested by Chandler.Duncan Sands
llvm-svn: 154824
2012-04-16Propagate alignment on lvalues through EmitLValueForField. PR12395.Eli Friedman
llvm-svn: 154789
2012-04-15Use MDBuilder to help with metadata creation.Duncan Sands
llvm-svn: 154767
2012-04-14Rename "fpaccuracy" metadata to the more generic "fpmath". That's because I'mDuncan Sands
thinking of generalizing it to be able to specify other freedoms beyond accuracy (such as that NaN's don't have to be respected). I'd like the 3.1 release (the first one with this metadata) to have the more generic name already rather than having to auto-upgrade it in 3.2. llvm-svn: 154745
2012-04-13Step forward with supporting of ARM homogenous aggregates:Anton Korobeynikov
- Handle unions - Handle C++ classes llvm-svn: 154664
2012-04-13Implement __atomic_fetch_nand and __atomic_nand_fetch to complete our set ofRichard Smith
GNU __atomic builtins. llvm-svn: 154659
2012-04-13Implement the missing pieces needed to support libstdc++4.7's <atomic>:Richard Smith
__atomic_test_and_set, __atomic_clear, plus a pile of undocumented __GCC_* predefined macros. Implement library fallback for __atomic_is_lock_free and __c11_atomic_is_lock_free, and implement __atomic_always_lock_free. Contrary to their documentation, GCC's __atomic_fetch_add family don't multiply the operand by sizeof(T) when operating on a pointer type. libstdc++ relies on this quirk. Remove this handling for all but the __c11_atomic_fetch_add and __c11_atomic_fetch_sub builtins. Contrary to their documentation, __atomic_test_and_set and __atomic_clear take a first argument of type 'volatile void *', not 'void *' or 'bool *', and __atomic_is_lock_free and __atomic_always_lock_free have an argument of type 'const volatile void *', not 'void *'. With this change, libstdc++4.7's <atomic> passes libc++'s atomic test suite, except for a couple of libstdc++ bugs and some cases where libc++'s test suite tests for properties which implementations have latitude to vary. llvm-svn: 154640
2012-04-12Fix some i1/i8 confusion within _Atomic(bool) in IR generation, bothDouglas Gregor
in general (such an atomic has boolean representation) and specifically for IR generation of __c11_atomic_init. The latter also means actually using initialization semantics for this initialization, rather than just creating a store. On a related note, make sure we actually put in non-atomic-to-atomic conversions when performing an implicit conversion sequence. IR generation is far too kind here, but we still want the ASTs to make sense. llvm-svn: 154612