Chris Lattner [Sun, 8 Mar 2009 08:16:41 +0000 (08:16 +0000)]
add \n characters to the scratch buffer *before* returned tokens.
This prevents caret diagnostics from the scratch buffer from
including other tokens in the scratch buffer that occurred beforei
them.
Chris Lattner [Sun, 8 Mar 2009 08:11:22 +0000 (08:11 +0000)]
generalize the "end of line" checking logic to stop at any \0 at the
end of line instead of just the end of buffer. Scratch buffers contain
embedded \0's between tokens which are logic line separators. If a
normal text buffer contains \0's, it doesn't make a lot of sense to include
them in the caret diag output anyway.
Chris Lattner [Sun, 8 Mar 2009 08:08:45 +0000 (08:08 +0000)]
simplify some logic by making ScratchBuffer handle the application of trailing
\0's to created tokens instead of making all clients do it. No functionality
change.
Chris Lattner [Sun, 8 Mar 2009 07:26:58 +0000 (07:26 +0000)]
Update DeclNodes.def to reflect the move of ObjCCategoryImpl
from being a NamedDecl to being and ObjCImplDecl. This fixes
some valgrind issues where ObjCCategoryImpl's were being cast
to NamedDecl and then stuck on name lookup datastructures.
Chris Lattner [Sun, 8 Mar 2009 06:51:10 +0000 (06:51 +0000)]
refine the "use of unary operator that may be intended as compound assignment (+=)"
warning to only trigger when there is whitespace or something else after the + as
suggested by Eli.
Eli Friedman [Sat, 7 Mar 2009 20:17:55 +0000 (20:17 +0000)]
Make constant emission for @encode use the common string emission code.
This is a bit cleaner, and also "fixes" bad code that compares the
addresses of the string constants.
Eli Friedman [Sat, 7 Mar 2009 07:01:10 +0000 (07:01 +0000)]
Don't discard increment/decrement on function pointers. It's kind of
difficult to come up with a testcase because the code generation for this
construct is broken.
Mike Stump [Sat, 7 Mar 2009 06:16:52 +0000 (06:16 +0000)]
Remove last FIXME for block literal codegen that I know about and turn
on all the new code by default. There is still plenty of testing to
do and issues I'm sure need resolving. Let me know if you find
anything.
Eli Friedman [Sat, 7 Mar 2009 03:57:15 +0000 (03:57 +0000)]
Back out the patch in r66302, and re-fix it properly. We assume for
performance that the type of the returned llvm::Value for an expression
matches the converted type of the clang::Expr; mismatches will cause all
sorts of errors and silent miscompilations.
Daniel Dunbar [Sat, 7 Mar 2009 01:42:16 +0000 (01:42 +0000)]
Cleanup/comment IdentifierInfo::get.
- Shaves off a few instructions on x86_64.
One notable change: this intentionally stops setting the II->Entry
field of IdentifierInfo's retrieved by the ExternalLookup method. This
is to maintain the invariant that .getName() has a constant value for
any given IdentifierInfo. IRgen currently relies on this; which is
quite questionable but will be cleaned up in time.
Apologies for the lack of a test case; there really isn't a good way
to make one. As IRgen will eventually be fixed to not rely on this, we
can survive without one.
Ted Kremenek [Sat, 7 Mar 2009 01:22:02 +0000 (01:22 +0000)]
Selector: (changes made after discussing this more with Steve Naroff)
- Make Selector::getAsIdentifierInfo() private. Using IdentifierInfo* in
Selector is an implementation detail that clients shouldn't think about.
- Modify diagnostic emission in Sema::ProcessPropertyDecl to not use
Selector::getAsIdentifierInfo() (which could crash when IdentifierInfo* is
null) and instead use Selector::getAsString().
- Tidy up Selector::getAsString() implementation.
Ted Kremenek [Fri, 6 Mar 2009 23:58:11 +0000 (23:58 +0000)]
Create PathDiagnosticPiece subclasses PathDiagnosticEventPiece and
PathDiagnosticControlFlowPiece to distinguish (in the class hierarchy) between
events and control-flow diagnostic pieces. Clients must now use these directly
when constructing PathDiagnosticPieces.
Douglas Gregor [Fri, 6 Mar 2009 23:41:27 +0000 (23:41 +0000)]
Downgrade complaints about the use of variable-sized types within a
struct to an extension warning to match the behavior of GNU C, which
addresses the Sema part of PR3671.
Douglas Gregor [Fri, 6 Mar 2009 22:43:54 +0000 (22:43 +0000)]
Implement GNU C semantics for K&R function definitions that follow a
prototype of the same function, where the promoted parameter types in
the K&R definition are not compatible with the types in the
prototype. Fixes PR2821.
Daniel Dunbar [Fri, 6 Mar 2009 22:13:30 +0000 (22:13 +0000)]
(LLVM svn up) Generalize RuntimeFunctions to RuntimeGlobals and add
CodeGenModule::CreateRuntimeVariable.
- No real functionality change; although we now assert on silly
things like:
--
int objc_exception_throw;
void f0() { @throw(@"A"); }
--
instead of accepting it.
Daniel Dunbar [Fri, 6 Mar 2009 20:45:54 +0000 (20:45 +0000)]
Handle #pragma pack(0). I left this out of diagnostic because users should
really use pack() instead.
- <rdar://problem/6650243> clang warns about '#pragma pack(0)'
Sebastian Redl [Fri, 6 Mar 2009 17:41:35 +0000 (17:41 +0000)]
Implement the machinery that can process TableGenerated warning options.
Manually write a table and some ad-hoc code to provide feature parity with the current code.
Chris Lattner [Fri, 6 Mar 2009 06:46:31 +0000 (06:46 +0000)]
capitalize for consistency, a crash in regalloc now looks like this:
Stack dump:
0. Program arguments: clang pr3399.c -S -O3
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Linear Scan Register Allocator' on function '@foo'
Abort
Daniel Dunbar [Thu, 5 Mar 2009 22:59:19 +0000 (22:59 +0000)]
Don't mangle names of local variables.
- For one thing, this adds unneeded overhead; for another, this
routine can be used to emit unnamed decls which we shouldn't try to
mangle.
Ted Kremenek [Thu, 5 Mar 2009 16:31:07 +0000 (16:31 +0000)]
BasicStore:
- Store bindings using a MemRegion -> SVal binding instead of VarDecl -> SVal
binding. This mirrors some of the idea of RegionStore, but is far simpler and
not nearly as functional. This leads to some code simplification and
some potential for some minor precision hacks.
Along the way...
- constify the use of MemRegion* in a few places
- add operator<<(llvm::raw_ostream, const MemRegion*)
Steve Naroff [Thu, 5 Mar 2009 15:45:01 +0000 (15:45 +0000)]
Tweak diag for <rdar://problem/5982579> [clang on xcode] (using arch=x86_64): synthesized property 'sdkPath' must either be named the same as a compatible ivar or must explicitly name an ivar.
Chris Lattner [Thu, 5 Mar 2009 08:04:57 +0000 (08:04 +0000)]
if we die in IR generation of a compound statement, include
it in the stack trace, giving us stuff like:
Stack dump:
0. Program arguments: clang t.c -emit-llvm
1. <eof> parser at end of file
2. t.c:1:5: LLVM IR generation of declaration 'a'
3. t.c:1:9: LLVM IR generation of compound statement ('{}')
4. t.c:2:3: LLVM IR generation of compound statement ('{}')
Abort
Chris Lattner [Thu, 5 Mar 2009 08:00:35 +0000 (08:00 +0000)]
rename PrettyStackTraceDecl -> PrettyStackTraceActionsDecl.
Introduce a new PrettyStackTraceDecl.
Use it to add the top level LLVM IR generation stuff in
Backend.cpp to stack traces. We now get crashes like:
Stack dump:
0. Program arguments: clang t.c -emit-llvm
1. <eof> parser at end of file
2. t.c:1:5: LLVM IR generation of declaration 'a'
Abort