Daniel Dunbar [Tue, 24 Aug 2010 21:39:55 +0000 (21:39 +0000)]
tests: Use REQUIRES: instead of XFAIL: for crash recovery tests; running them on
Windows breaks things (because it pops up dialogs) since we don't have crash
recovery support there (yet).
Chris Lattner [Tue, 24 Aug 2010 21:09:16 +0000 (21:09 +0000)]
Implement -iwithsysroot, an apple extension which is a close cousin of -isystem.
Instead of implementing -isystem, I accidentally implemented this cousin. Next
up is to implement -isystem right.
Tom Care [Tue, 24 Aug 2010 21:09:07 +0000 (21:09 +0000)]
Improvements to IdempotentOperationChecker and its use of PseudoConstantAnalysis
- Added wasReferenced function to PseudoConstantAnalysis to determine if a variable was ever referenced in a function (outside of a self-assignment)
- BlockDeclRefExpr referenced variables are now explicitly added to the non-constant list
- Remove unnecessary ignore of implicit casts
- Generalized parameter self-assign detection to detect deliberate self-assigns of variables to avoid unused variable warnings
- Updated test cases with deliberate self-assignments
- Fixed bug with C++ references and pseudoconstants
- Added test case for C++ references and pseudoconstants
Douglas Gregor [Tue, 24 Aug 2010 20:21:13 +0000 (20:21 +0000)]
Implement preprocessor code completion where a macro name is expected,
e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname>
expression in a preprocessor conditional.
Fix a bug in nonfragile-abi2 when attempting to diagnose
previous use of a synthesized 'ivar' with property of same name
declared as @dynamic. In this case, 'ivar' is in the
inherited class and no diagnostics should be issued.
Daniel Dunbar [Tue, 24 Aug 2010 16:47:49 +0000 (16:47 +0000)]
Driver/Clang: Forward -Wa, and -Xassembler to clang -cc1 when using the
integrated assembler. For now this mostly just means that we will error out if
someone tries to use this mechanism to send an argument to the assembler.
John McCall [Tue, 24 Aug 2010 08:50:51 +0000 (08:50 +0000)]
More header elimination. The goal of all this is to allow Parser to
#include Sema.h while keeping all the AST declarations opaque. That may
not be reasonably attainable, though.
John McCall [Tue, 24 Aug 2010 06:29:42 +0000 (06:29 +0000)]
OwningExprResult -> ExprResult. This patch brought to you by
M-x query-replace-regexp
\(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result
Move ExecuteCompilerInvocation to a new library FrontendTool
r110903 introduced a dependency from Frontend to every library that
declared an Action by introducing Action references that previously
resided in the driver in the file ExecuteCompilerInvocation.cpp.
This patch moves ExecuteCompilerInvocation to a new library named
FrontendTool which is intended to bear these dependencies.
Douglas Gregor [Mon, 23 Aug 2010 23:51:41 +0000 (23:51 +0000)]
When calling a function or messaging a method marked "sentinel", add
the ", nil", ", NULL", or ", (void*)0" to the end of the code
completion, since it always has to be there anyway.
Chris Lattner [Mon, 23 Aug 2010 23:50:42 +0000 (23:50 +0000)]
fix PR7953 - Windows filename are case insensitive:
#pragma once wasn't working on win32 if the header file was included
using a different case.
I tracked down the problem to the fact that clang::FileManager was
caching files using case sensitive string (UniqueFiles) on Windows.
I changed FileManager to cache filename in lower case only.
Doesn't affect UNIX because UNIX uses Inode to uniquely identify files.
Douglas Gregor [Mon, 23 Aug 2010 23:00:57 +0000 (23:00 +0000)]
Introduce new libclang API functions that determine the availability
of a cursor or code-completion result, e.g., whether that result
refers to an unavailable, deleted, or deprecated declaration.
Handling remaining rule for synthesize bitfields in
class extensions (nonfragile-abi2).For every class @interface and class
extension @interface, if the last ivar is a bitfield of any type,
then add an implicit `char :0` ivar to the end of that interface.
Daniel Dunbar [Mon, 23 Aug 2010 22:35:37 +0000 (22:35 +0000)]
Driver: Move Clang "triple" computation routines to method on the
ToolChain. This fixes a potenial bad cast when running Clang on PPC code, since
the tool chain in effect is not a subclass of the Darwin one, but we were
treating it like it was.
- This introduces some gross code duplication, but the right fix for it is to
just move the Driver to start depending on the targets in libBasic, so I am
not planning on fixing it immediately.
Douglas Gregor [Mon, 23 Aug 2010 21:17:50 +0000 (21:17 +0000)]
Introduce a code-completion hook for the Objective-C collection
argument in a for-each statement (e.g., "for (id x in <blah>)"), which
restricts the expression completions provided to Objective-C types (or
class types in C++).
Dan Gohman [Mon, 23 Aug 2010 21:15:56 +0000 (21:15 +0000)]
Reinstate the code for emitting an initial debug type for a struct,
to handle the case where the struct is only forward-declared. In
this case, a temporary MDNode is not needed and not desired.
Tom Care [Mon, 23 Aug 2010 19:51:57 +0000 (19:51 +0000)]
Several small changes to PseudoConstantAnalysis and the way IdempotentOperationChecker uses it.
- Psuedo -> Pseudo (doh...)
- C++ reference support
- Added pseudoconstant test case for __block vars
- Separated out static local checking from pseudoconstant analysis and generalized to non-local checking
- Added missing test cases for storage false positives
Douglas Gregor [Mon, 23 Aug 2010 18:23:48 +0000 (18:23 +0000)]
Introduce a new code-completion point when we're parsing a
declarator. Here, we can only see a few things (e.g., cvr-qualifiers,
nested name specifiers) and we do not want to provide other non-macro
completions. Previously, we would end up in recovery mode and would
provide a large number of non-relevant completions.
Douglas Gregor [Mon, 23 Aug 2010 14:50:27 +0000 (14:50 +0000)]
Emit an error noting that Clang does not support code generation for
the ternary operator without a left-hand side in C++ (PR7726), from
Jean-Daniel Dupas!
Chandler Carruth [Mon, 23 Aug 2010 07:55:51 +0000 (07:55 +0000)]
Relax the construction of a definition for implicit, trivial default
constructors. We perform semantic checking when creating the definition, and
this isn't needed in certain contexts (value initialization) but is in others
(default initialization). This fixes PR7948.
We add explicit code to the default initialization path to ensure the
definition is both present and valid.
Doug, please review. I think this follows your latest suggestion, and it ended
up remarkably cleaner than I anticipated. Also let me know if similar logic
should be followed for destructors and copy-constructors.
Chris Lattner [Mon, 23 Aug 2010 05:26:13 +0000 (05:26 +0000)]
fix rdar://8340348, a miscompile of boost that was exposed by r109848.
That revision started classifying truly empty structs like "Y" and "X"
as being NoClass/NoClass and turning them into 'ignore'. The call code
turns around and allocates space for the ignored argument with
GetUndefRValue. The bug is that GetUndefRValue would return the address
as undef, instead of returning an object with a defined address but
undefined contents.
John McCall [Mon, 23 Aug 2010 01:21:21 +0000 (01:21 +0000)]
Abstract out everything having to do with member pointers into the ABI
class; they should just be completely opaque throughout IR gen now,
although I haven't really audited that.
Fix a bug apparently inherited from gcc-4.2 where we failed to null-check
member data pointers when performing derived-to-base or base-to-derived
conversions on them.
John McCall [Sun, 22 Aug 2010 21:01:12 +0000 (21:01 +0000)]
Go back to asking CodeGenTypes whether a type is zero-initializable.
Make CGT defer to the ABI on all member pointer types.
This requires giving CGT a handle to the ABI.
It's way easier to make that work if we avoid lazily creating the ABI.
Make it so.
Douglas Gregor [Sun, 22 Aug 2010 16:15:35 +0000 (16:15 +0000)]
When performing value-initialization for a class with a non-trivial,
implicitly-defined default constructor, zero-initialize the memory
before calling the default constructor. Previously, we would only
zero-initialize in the case of a trivial default constructor.
Also, simplify the hideous logic that determines when we have a
trivial default constructor and, therefore, don't need to emit any
call at all.
John McCall [Sun, 22 Aug 2010 10:59:02 +0000 (10:59 +0000)]
Experiment with using first-class aggregates to represent member function
pointers. I find the resulting code to be substantially cleaner, and it
makes it very easy to use the same APIs for data member pointers (which I have
conscientiously avoided here), and it avoids a plethora of potential
inefficiencies due to excessive memory copying, but we'll have to see if it
actually works.
John McCall [Sat, 21 Aug 2010 22:46:04 +0000 (22:46 +0000)]
The ARM C++ ABI is sufficiently different from the Itanium C++ ABI that
it deserves its own enumerator. Obviously the implementations should
closely follow the Itanium ABI except in cases of divergence.
Zhongxing Xu [Sat, 21 Aug 2010 11:00:26 +0000 (11:00 +0000)]
Remove a special case for OSAtomic functions. We can already bind and retrieve
with the same binding key. The only trick here is that sometimes the Symbolic
region is stored in with an LocAsInteger wrapper. We unwrap that in
SVal::getAsLocSymbol().