llvm-project/clang/test/CodeGenObjCXX
Richard Smith 0421ce7b22 Teach Expr::HasSideEffects about all the Expr types, and fix a bug where it
was mistakenly classifying dynamic_casts which might throw as having no side
effects.

Switch it from a visitor to a switch, so it is kept up-to-date as future Expr
nodes are added. Move it from ExprConstant.cpp to Expr.cpp, since it's not
really related to constant expression evaluation.

Since we use HasSideEffect to determine whether to emit an unused global with
internal linkage, this has the effect of suppressing emission of globals in
some cases.

I've left many of the Objective-C cases conservatively assuming that the
expression has side-effects. I'll leave it to someone with better knowledge
of Objective-C than mine to improve them.

llvm-svn: 161388
2012-08-07 04:16:51 +00:00
..
Inputs Add clang support for new Objective-C literal syntax for NSDictionary, NSArray, 2012-03-06 20:05:56 +00:00
2007-10-03-MetadataPointers.mm Migrate and update: 2011-08-20 00:25:36 +00:00
2010-08-04-Template.mm Migrate and update: 2011-08-20 00:25:36 +00:00
2010-08-06-X.Y-syntax.mm Migrate and update: 2011-08-20 00:25:36 +00:00
address-safety-attr.mm Move the code that sets the AddressSafety 2012-02-02 11:49:28 +00:00
arc-exceptions.mm When initializing a catch variable in ARC, be sure to emit retains 2012-01-17 20:16:56 +00:00
arc-globals.mm Make -fobjc-nonfragile-abi the -cc1 default, since it's the 2011-10-02 01:16:38 +00:00
arc-mangle.mm Make -fobjc-nonfragile-abi the -cc1 default, since it's the 2011-10-02 01:16:38 +00:00
arc-move.mm Update all tests other than Driver/std.cpp to use -std=c++11 rather than 2011-10-13 22:29:44 +00:00
arc-new-delete.mm Make -fobjc-nonfragile-abi the -cc1 default, since it's the 2011-10-02 01:16:38 +00:00
arc-pseudo-destructors.mm Make -fobjc-nonfragile-abi the -cc1 default, since it's the 2011-10-02 01:16:38 +00:00
arc-references.mm Make -fobjc-nonfragile-abi the -cc1 default, since it's the 2011-10-02 01:16:38 +00:00
arc-returns-inner-reference-ptr.mm Make -fobjc-nonfragile-abi the -cc1 default, since it's the 2011-10-02 01:16:38 +00:00
arc-special-member-functions.mm Make -fobjc-nonfragile-abi the -cc1 default, since it's the 2011-10-02 01:16:38 +00:00
arc.mm Don't crash *or* insert a bogus autorelease when emitting a 2012-07-31 00:33:55 +00:00
block-in-template-inst.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
block-var-layout.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
blocks.mm Don't try to do RVO on block variables that refer to an enclosing local. 2012-07-11 22:50:15 +00:00
catch-id-type.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
copy.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
copyable-property-object.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
debug-info.mm No need to go to object file, -emit-llvm is sufficient to see if clang 2012-02-21 22:25:20 +00:00
encode.mm Teach Expr::HasSideEffects about all the Expr types, and fix a bug where it 2012-08-07 04:16:51 +00:00
exceptions.mm Make -fobjc-nonfragile-abi the -cc1 default, since it's the 2011-10-02 01:16:38 +00:00
foreach-statement.mm Objective-c++ IR gen. 2010-05-27 16:05:06 +00:00
gc.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
implicit-copy-assign-operator.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
implicit-copy-constructor.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
ivar-objects.mm The emission of an Objective-C++'s class .cxx_destruct method should be 2011-03-22 07:05:39 +00:00
lambda-expressions.mm block literal irgen: several improvements on naming block 2012-06-26 16:06:38 +00:00
literals.mm Add clang support for new Objective-C literal syntax for NSDictionary, NSArray, 2012-03-06 20:05:56 +00:00
lvalue-reference-getter.mm obj-c++: Fix a IRGen crash when getter is a reference type. 2011-10-17 21:00:22 +00:00
mangle-blocks.mm block literal irgen: several improvements on naming block 2012-06-26 16:06:38 +00:00
mangle.mm Don't add objc method name mangling to locally declared function. 2011-06-09 19:25:01 +00:00
message-reference.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
method-local-extern-mangle.mm extern variable declared locally to objective-c++ method 2010-06-30 18:27:47 +00:00
nrvo.mm block literal irgen: several improvements on naming block 2012-06-26 16:06:38 +00:00
objc-container-subscripting-1.mm Add clang support for new Objective-C literal syntax for NSDictionary, NSArray, 2012-03-06 20:05:56 +00:00
objc-container-subscripting.mm Add clang support for new Objective-C literal syntax for NSDictionary, NSArray, 2012-03-06 20:05:56 +00:00
property-derived-to-base-conv.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
property-dot-copy.mm Make -fobjc-nonfragile-abi the -cc1 default, since it's the 2011-10-02 01:16:38 +00:00
property-dot-reference.mm Make -fobjc-nonfragile-abi the -cc1 default, since it's the 2011-10-02 01:16:38 +00:00
property-object-conditional-exp.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
property-object-reference-1.mm Fixes a code gen bug for setter code for a property of 2012-01-05 00:10:16 +00:00
property-object-reference-2.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
property-object-reference.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
property-objects.mm Make -fobjc-nonfragile-abi the -cc1 default, since it's the 2011-10-02 01:16:38 +00:00
property-reference.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
refence-assign-write-barrier.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
references.mm Warn for any kind of initialization if initializer does not 2011-04-08 18:25:29 +00:00
rtti.mm Mark VTables and RTTI data linkonce_odr instead of weak_odr, with the exception of explicit template instantiations, which have to be weak_odr. 2011-01-24 00:46:19 +00:00
selector-expr-lvalue.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00
write-barrier-global-assign.mm Restructure how the driver communicates information about the 2012-06-20 06:18:46 +00:00