Commit Graph

49920 Commits

Author SHA1 Message Date
Ted Kremenek e9c16a6a79 Updated checker build.
llvm-svn: 59195
2008-11-12 23:26:57 +00:00
Dan Gohman 6cd8ad06d6 Revert the part of r59145 that changed the comment about
virtual registers possibly having multiple kills while still
being defined and killed in the same block. If LiveIntervals
is manually re-run after two-address lowering, it currently
does add extra kills to two-address instructions, but this
is considered a bug.

llvm-svn: 59194
2008-11-12 23:24:15 +00:00
Douglas Gregor b6acda0f36 Don't build identifiers for C++ constructors, destructors, or
conversion functions. Instead, we just use a placeholder identifier
for these (e.g., "<constructor>") and override NamedDecl::getName() to
provide a human-readable name.

This is one potential solution to the problem; another solution would
be to replace the use of IdentifierInfo* in NamedDecl with a different
class that deals with identifiers better. I'm also prototyping that to
see how it compares, but this commit is better than what we had
previously.

llvm-svn: 59193
2008-11-12 23:21:09 +00:00
Douglas Gregor c208f4617c Fix compilation on 64-bit targets
llvm-svn: 59192
2008-11-12 23:17:06 +00:00
Ted Kremenek 66312a3ff4 Move some diagnostic handling to PreprocessorLexer.
llvm-svn: 59191
2008-11-12 23:13:54 +00:00
Dan Gohman 88ba5f0b96 Move the code that inserts X87 FP_REG_KILL instructions from a
special-purpose hook to a new pass. Also, add check to see if any
x87 virtual registers are used, to avoid doing any work in the
common case that no x87 code is needed.

llvm-svn: 59190
2008-11-12 22:55:05 +00:00
Ted Kremenek 3060634fba Add virtual dtor to PreprocessorLexer.
llvm-svn: 59188
2008-11-12 22:48:57 +00:00
Ted Kremenek 9d39e377df Add LexIncludeFilename.
llvm-svn: 59187
2008-11-12 22:46:33 +00:00
Ted Kremenek 2f4f2dea82 Remove Lexer::LexIncludeFilename.
llvm-svn: 59186
2008-11-12 22:44:15 +00:00
Ted Kremenek 6c90efb923 Move LexIncludeFilename from Lexer to PreprocessorLexer.
PreprocessorLexer now has a virtual method "IndirectLex" which allows it to call the lex method of its subclasses.  This is not for performance intensive operations.

llvm-svn: 59185
2008-11-12 22:43:05 +00:00
Daniel Dunbar f32443cdcd Quick fix for crash in IRgen when we can tryEvaluate a condition to
something that is not an int.

 - Ignore these cases for now, added FIXME that we should also boolize
   them.

llvm-svn: 59184
2008-11-12 22:37:10 +00:00
Ted Kremenek 50b4f48225 Use PushIncludeMacroStack() instead of manually manipulating the include stack.
llvm-svn: 59181
2008-11-12 22:21:57 +00:00
Ted Kremenek 50b84bb5f6 Unbreak last commit.
llvm-svn: 59180
2008-11-12 22:19:18 +00:00
Ted Kremenek f5518cc95b Add Preprocessor::PushIncludeMacroStack() and Preprocessor::PopIncludeMacroStack(), two utility methods for manipulating the Preprocessor stack. These will be used to remove manually manipulation of IncludeMacroStack from the rest of the Preprocessor implementation.
llvm-svn: 59179
2008-11-12 22:10:22 +00:00
Ted Kremenek 65dd30fdea Update CFGStmtVisitor to recognize that ObjCForCollectionStmts are special block-level "expressions".
llvm-svn: 59176
2008-11-12 21:58:46 +00:00
Daniel Dunbar a461e6d124 Disable some debug prints.
llvm-svn: 59174
2008-11-12 21:52:46 +00:00
Douglas Gregor 63eb9386b7 Slightly improve type hash
llvm-svn: 59173
2008-11-12 21:52:20 +00:00
Evan Cheng 287a25d636 Remove the incorrect assertion. We don't have enough information before relocation to set U bit.
llvm-svn: 59170
2008-11-12 21:37:59 +00:00
Ted Kremenek 7cd62457c4 Add skeleton for PTH lexer.
llvm-svn: 59169
2008-11-12 21:37:15 +00:00
Ted Kremenek 3a460b1106 Move pieces of Lexer that the Preprocessor mutates to a new base class 'PreprocessorLexer'. This will also be the base class of the new Preprocessed-Token-Header (PTH) lexer. No functionality change.
llvm-svn: 59168
2008-11-12 21:33:59 +00:00
Chris Lattner 6515bcc3c6 Fix a FIXME by improving a diagnostic, add a testcase for PR3048
llvm-svn: 59167
2008-11-12 21:25:45 +00:00
Sebastian Redl 15b7160a17 64-bit test fixes.
llvm-svn: 59165
2008-11-12 21:19:11 +00:00
Chris Lattner ffb31a23a5 make TryFixInvalidVariablyModifiedType a static function.
llvm-svn: 59163
2008-11-12 21:17:48 +00:00
Ted Kremenek df31792a66 Shore up transfer function for ObjCForCollectionStmt.
llvm-svn: 59162
2008-11-12 21:12:46 +00:00
Ted Kremenek 97450fe0a1 Use Stmt* instead of Expr* for block-level expression.
llvm-svn: 59161
2008-11-12 21:12:18 +00:00
Ted Kremenek 6d8b46e71d ObjCForCollectionStmts are block-level expressions.
llvm-svn: 59160
2008-11-12 21:11:49 +00:00
Oscar Fuentes 0c6b786ab2 CMake: when bulding shared libraries on non-WIN32 systems, link dl to
LLVMSystem.

llvm-svn: 59159
2008-11-12 20:40:56 +00:00
Oscar Fuentes 38d6c9a817 Tell GenLibDeps.pl to inspect .so and .dylib shared files.
llvm-svn: 59158
2008-11-12 20:39:06 +00:00
Chris Lattner b5da7a342c Restructure code to encourage fallthrough, no functionality change.
llvm-svn: 59157
2008-11-12 19:48:13 +00:00
Chris Lattner e7d1cdb6fd fix PR3048. I'm going to do some more work before closing it off and
adding a testcase.

llvm-svn: 59156
2008-11-12 19:45:49 +00:00
Ted Kremenek 1781080c34 Add (preliminary) transfer function support for ObjCForCollectionStmt. Still need to flesh out some logic.
When processing DeclStmt, use the new interface to StateManager::BindDecl.  Conjuring of symbols is now done in VisitDeclStmt.

llvm-svn: 59155
2008-11-12 19:24:17 +00:00
Ted Kremenek 9999d72fe2 Conjured symbols now bind to Stmt* instead of Expr*.
llvm-svn: 59154
2008-11-12 19:22:47 +00:00
Ted Kremenek 60d46414f4 Update method names involving GRStateRef. No functionality change.
llvm-svn: 59153
2008-11-12 19:22:09 +00:00
Ted Kremenek b94d72a0e3 GRStateRef:
- Rename SetSVal to BindLoc
- Add BindDecl
- Add BindExpr

GRState:
- Environment now binds to Stmt* instead of Expr*.  This is needed for processing ObjCForCollectionStmt (essentially the declaration of the the 'element' variable can have an SVal attached to it).
- BindDecl no longer accepts Expr* for the initialization value; use SVal* instead.

llvm-svn: 59152
2008-11-12 19:21:30 +00:00
Ted Kremenek cd639218e4 StoreManager::BindDecl now takes an SVal* for the initialization value instead of an Expr* (which can be null). Lazy symbolication of conjured symbols is now the sole responsibility of GRExprEngine.
llvm-svn: 59151
2008-11-12 19:18:35 +00:00
Dale Johannesen 6467858be1 Fix unsigned char->ppcf128 conversion.
llvm-svn: 59150
2008-11-12 18:38:44 +00:00
Douglas Gregor a11693bc37 Implement support for operator overloading using candidate operator
functions for built-in operators, e.g., the builtin

  bool operator==(int const*, int const*)

can be used for the expression "x1 == x2" given:

  struct X {
    operator int const*();
  } x1, x2;

The scheme for handling these built-in operators is relatively simple:
for each candidate required by the standard, create a special kind of
candidate function for the built-in. If overload resolution picks the
built-in operator, we perform the appropriate conversions on the
arguments and then let the normal built-in operator take care of it. 

There may be some optimization opportunity left: if we can reduce the
number of built-in operator overloads we generate, overload resolution
for these cases will go faster. However, one must be careful when
doing this: GCC generates too few operator overloads in our little
test program, and fails to compile it because none of the overloads it
generates match.

Note that we only support operator overload for non-member binary
operators at the moment. The other operators will follow.

As part of this change, ImplicitCastExpr can now be an lvalue.

llvm-svn: 59148
2008-11-12 17:17:38 +00:00
Dan Gohman 0df957e09d Do the LiveVariables update before printing the instruction in
the debug output, so that the updated liveness flags are
reflected in the debug output.

llvm-svn: 59147
2008-11-12 17:15:19 +00:00
Dan Gohman 5efcb61337 Remove some debugging code made redundant by the change to do
coalescing as a separate pass rather than inside of
LiveIntervalAnalysis.

llvm-svn: 59146
2008-11-12 17:09:23 +00:00
Dan Gohman da82aa3e0d Update VarInfo's comments to reflect the current code. LiveVar
no longer records a unique defining instruction, and virtual
registers may have multiple kills while still being defined
and killed in the same block.

llvm-svn: 59145
2008-11-12 17:02:24 +00:00
Dan Gohman 8a46117376 Correct a function name in a comment.
llvm-svn: 59143
2008-11-12 16:53:40 +00:00
Tanya Lattner 129f4febd2 Add test case for ptr annotation.
llvm-svn: 59142
2008-11-12 16:12:27 +00:00
Mikhail Glushenkov a2909684b6 Check the return value of std::getenv.
When constructing std::strings from C strings, we should check the input
value to be not NULL so that the std::string constructor does not
segfault.
Fixes #3047.

llvm-svn: 59131
2008-11-12 12:41:18 +00:00
Daniel Dunbar 2889780436 Start a README.txt of possible optimizations to do in IRgen.
llvm-svn: 59130
2008-11-12 12:31:28 +00:00
Daniel Dunbar bf3c22e51d Handle ?: in EmitBranchOnBoolExpr.
llvm-svn: 59129
2008-11-12 10:30:32 +00:00
Daniel Dunbar d2a53a7b77 Rename ?: operator blocks to cond.true and cond.false (I don't know
what "cond.?" means, and this avoids quoting).

llvm-svn: 59128
2008-11-12 10:13:37 +00:00
Daniel Dunbar 682712cda0 Comment/indentation fix.
llvm-svn: 59127
2008-11-12 10:12:14 +00:00
Duncan Sands d85a1669b9 Correct these links.
llvm-svn: 59126
2008-11-12 10:10:25 +00:00
Eli Friedman 9a156e5c1e Some additions to tryEvaluate I've had sitting around for a while.
This pushes it a lot closer to being able to deal with most of the stuff 
CodeGen's constant expression evaluator knows how to deal with.  This 
also fixes PR3003.

The test could possibly use some improvement, but this'll work for now.  
Test 6 is inspired by PR3003; the other tests are mostly just designed
to exercise the new code.  The reason for the funny structure of the 
tests is that type fixing for arrays inside of structs is the only place 
in Sema that calls tryEvaluate, at least for the moment.

llvm-svn: 59125
2008-11-12 09:44:48 +00:00
Chris Lattner 3fd91f83fd Lower ?: into select when the selected values are cheap and side-effect-free.
This cuts another 200 lines off expr.ll, forming 23 selects.

llvm-svn: 59124
2008-11-12 08:55:54 +00:00