Commit Graph

15234 Commits

Author SHA1 Message Date
Anders Carlsson a192947509 Change ActOnReturnStmt to not take a FullExprArg. Instead, Sema will wrap the return expr inside a CXXExprWithTemporaries if needed.
llvm-svn: 79342
2009-08-18 16:11:00 +00:00
Zhongxing Xu 7864b9ea0c Remove unused parameter BugReporter due to previous patch.
llvm-svn: 79328
2009-08-18 08:58:41 +00:00
Zhongxing Xu 4c76dbc758 Now we can get the CFG from the ProgramPoint. No need to pass in the
BugReporter.

llvm-svn: 79327
2009-08-18 08:46:04 +00:00
Daniel Dunbar d04405f036 Add test for finding bfin backend.
llvm-svn: 79326
2009-08-18 07:07:14 +00:00
Daniel Dunbar 5232203234 Convert CreateTargetInfo to use a Triple instead of manul string munging.
- Patch by Yonggang Luo (with some formatting tweaks by Eli and myself).

llvm-svn: 79320
2009-08-18 05:47:58 +00:00
Daniel Dunbar 2a4061929f Fix some made up triples.
llvm-svn: 79316
2009-08-18 05:30:27 +00:00
Ted Kremenek 9b2c79de59 Enhance static analyzer diagnostics by introducing a new 'EnhancedBugReporter'
which allows custom checks to register callback creator functions for creating
BugReporterVisitor objects. This allows various checks to include diagnostics
such as 'assuming value is null' with little extra work. Eventually this API
should be refactored to be cleaner and more simple.

llvm-svn: 79302
2009-08-18 01:05:30 +00:00
John McCall 5ed6e8f54c Teach Sema how to pop out of friend function definitions in nested classes.
llvm-svn: 79291
2009-08-18 00:00:49 +00:00
David Chisnall 26657ea8bc Fixed typo in last commit pointed out by Anton.
llvm-svn: 79290
2009-08-17 23:18:30 +00:00
David Chisnall de3a06933d Changes to TargetABIInfo to (hopefully) select the correct calling convention. This has been tested on FreeBSD, and now correctly generates GCC-compatible code for functions returning small structures. Please test it on other platforms!
llvm-svn: 79288
2009-08-17 23:08:21 +00:00
Jakob Stoklund Olesen 0de52f906d Support compilation for the blackfin back-end
llvm-svn: 79271
2009-08-17 20:08:44 +00:00
Fariborz Jahanian d172e91f2a Patch to 1) synthesizing non-trivial default destructor when
one is not provided by user. 2) More complete
emission of ctor prologue when it has no initializer
list or when it is synthesized.

llvm-svn: 79269
2009-08-17 19:04:50 +00:00
Anders Carlsson 49033712e4 Remove an ErrorUnsupported call.
llvm-svn: 79261
2009-08-17 18:24:57 +00:00
Daniel Dunbar 3a4fc4b2ec XFAIL this test for now. David/Steve, please sort out the correct fix.
llvm-svn: 79259
2009-08-17 18:01:54 +00:00
David Chisnall 9f57c29053 Initial patch to support definitions of id and Class from headers in Objective-C code.
This currently breaks test/SemaObjC/id-isa-ref.m and issues some spurious warnings when you attempt to assign a struct objc_class* value to a Class variable.  The test case probably should fail as it's written, because without the definition of Class the compiler should not assume struct objc_class* is a valid receiver type, but it's left broken because it would be nice if we could get that passing too for the special case of isa.

Approved by snaroff.

llvm-svn: 79248
2009-08-17 16:35:33 +00:00
Zhongxing Xu b562444cf8 adjust indentation.
llvm-svn: 79236
2009-08-17 14:13:14 +00:00
Zhongxing Xu a7a35bc2a6 Remove unused variable.
llvm-svn: 79229
2009-08-17 06:30:30 +00:00
Zhongxing Xu 5f078cb844 To make the analysis independent on the locally stored liveness and cfg
of GRStateManager and GRExprEngine, pass the initial location context
to the getInitialState() method.

llvm-svn: 79228
2009-08-17 06:19:58 +00:00
Erick Tryzelaar b90731117c Update lexer to work with the new APFloat string parsing.
llvm-svn: 79211
2009-08-16 23:36:28 +00:00
Anders Carlsson 81f0df9601 Improve handling of delete expressions.
llvm-svn: 79205
2009-08-16 21:13:42 +00:00
Anders Carlsson 115d6bfcac Whoops, did not mean to commit this
llvm-svn: 79201
2009-08-16 20:29:59 +00:00
Anders Carlsson a471db0dd4 Store the delete operator for delete expressions.
llvm-svn: 79200
2009-08-16 20:29:29 +00:00
Fariborz Jahanian d262eda6fc Patch toward synthesizing non-trivial destructors. WIP
llvm-svn: 79199
2009-08-16 19:36:17 +00:00
Mike Stump 996576f3aa Refine vbase offset calculations. WIP.
llvm-svn: 79198
2009-08-16 19:04:13 +00:00
Anders Carlsson 3b848940d7 Only do this for initializers of course.
llvm-svn: 79197
2009-08-16 17:54:29 +00:00
Anders Carlsson b80760bd78 Destroy bound temporaries.
llvm-svn: 79196
2009-08-16 17:50:25 +00:00
Chris Lattner 2ba5ca9d4f Improve the diagnostic emitted when an unused ObjC property getter
is found.  Instead of complaining about a generic "unused expr",
emit:
t.m:7:3: warning: property access result unused - getters should not have side effects

While objc property getters *could* have side effects, according to
the language best practices, they *shouldn't*.  Hopefully the
diagnostic now gets this across.

llvm-svn: 79192
2009-08-16 16:57:27 +00:00
Chris Lattner d37f61c1c6 fix my previous commit.
llvm-svn: 79191
2009-08-16 16:51:50 +00:00
Chris Lattner d8b800ad31 This is an attempt to improve loc info for 'unused result' expression
warnings, but it fails because we don't have the location of the .
and I don't understand ObjCKVCRefExpr.  I'll revisit this later.

llvm-svn: 79190
2009-08-16 16:45:18 +00:00
Anders Carlsson 5b106a7545 Add an IsInitializer flag to EmitAnyExpr. This is used to prevent temporaries from being destroyed when they're bound to a reference variable.
llvm-svn: 79179
2009-08-16 07:36:22 +00:00
Anders Carlsson 157c321b7c No need to append extra padding now that we don't create packed structs for simple cases like the constant string.
llvm-svn: 79178
2009-08-16 05:55:31 +00:00
Anders Carlsson 250aada4b9 AddInitializerToDecl can't take a FullExprArg. Make it take an ExprArg, and create the CXXExprWithTemporaries before setting the initializer on the VarDecl.
llvm-svn: 79176
2009-08-16 05:13:48 +00:00
Anders Carlsson e80ccac2cb Call MaybeBindToTemporary for overloaded binary and unary operators.
llvm-svn: 79173
2009-08-16 04:11:06 +00:00
Anders Carlsson 1c83debc36 Call MaybeBindToTemporary when constructing functino call operator calls.
llvm-svn: 79172
2009-08-16 03:53:54 +00:00
Anders Carlsson 8c84c206d9 Add MaybeBindToTemporary calls for member call expressions.
llvm-svn: 79171
2009-08-16 03:42:12 +00:00
Anders Carlsson f898401305 Make sure to call MaybeBindToTemporary when creating CallExprs.
llvm-svn: 79168
2009-08-16 03:06:32 +00:00
Mike Stump 94bc52c03b Use the -NEXT feature of FileCheck.
llvm-svn: 79166
2009-08-16 02:40:14 +00:00
Anders Carlsson bc4c107836 Move builtin call checking out into a separate function, make CheckFunctionCall and CheckBlockCall return bool instead. No intended functionality change.
llvm-svn: 79157
2009-08-16 01:56:34 +00:00
Mike Stump 22ea1f8a30 Cleanups and fixups for calculating the virtual base offsets. WIP.
llvm-svn: 79156
2009-08-16 01:46:26 +00:00
Anders Carlsson f86a8d1030 BuildCXXConstructExpr doesn't need to take an ASTContext.
llvm-svn: 79149
2009-08-15 23:41:35 +00:00
Eli Friedman ea56303b09 Add an explicit constructor to ActiveTemplateInstantiation which
initializes all the members; this fixes a valgrind error in the 
regression tests.

llvm-svn: 79148
2009-08-15 22:50:33 +00:00
Anders Carlsson 445af45c29 Add a simple test for temporaries.
llvm-svn: 79147
2009-08-15 22:30:50 +00:00
Eli Friedman c80ca68423 Fix test failure due to uninitialized member.
llvm-svn: 79145
2009-08-15 22:23:00 +00:00
Eli Friedman c96d4963eb Implement __is_empty. Patch by Sean Hunt.
llvm-svn: 79143
2009-08-15 21:55:26 +00:00
Eli Friedman e99c9c5b60 Ignore -Wno-import.
llvm-svn: 79128
2009-08-15 19:28:53 +00:00
Eli Friedman da8d4def72 Don't perform integer promotions on the operand to a cast; this
simplifies the AST, and can matter in some rare cases involving 
casts to vector types. Patch by Enea Zaffanella.

llvm-svn: 79126
2009-08-15 19:02:19 +00:00
Fariborz Jahanian 0aed0225b4 Improved on ir-gen for synthesis of non-trivial default
constructor body whose class has non-static data-members which
required non-trivial construction.

llvm-svn: 79125
2009-08-15 18:55:17 +00:00
Eli Friedman 2be79b3608 Add an additional C++ hardcoded search path.
llvm-svn: 79075
2009-08-15 03:45:14 +00:00
Eli Friedman b360412582 Make test more precise.
llvm-svn: 79074
2009-08-15 03:40:49 +00:00
Eli Friedman c0f6d44ef6 Make test a bit more precise.
llvm-svn: 79073
2009-08-15 03:35:55 +00:00