Commit Graph

49932 Commits

Author SHA1 Message Date
Daniel Dunbar df21c6e203 Supply finished flag to EmitBlock for common statements which use
landing pads.
 - Primarily a cleanliness issue instead of a performance issue (this
   eliminates all blocks w/o predecessors on 176.gcc/expr.c), but this
   also allows subsequent code to recognize it is unreachable and
   potentially avoid IRgen.

llvm-svn: 59211
2008-11-13 01:54:24 +00:00
Daniel Dunbar a612e79be4 Normalize many BasicBlock names.
- Use dotted notation for blocks related to a particular statement
   type.
 - Use .end for landing pads.

No functionality change in NDEBUG mode. :)

llvm-svn: 59210
2008-11-13 01:38:36 +00:00
Ted Kremenek 83844100fb Revert to older checker build.
llvm-svn: 59209
2008-11-13 01:30:19 +00:00
Devang Patel 3dd51c5c62 Really remove all debug information.
llvm-svn: 59208
2008-11-13 01:28:40 +00:00
Daniel Dunbar fcac22eac1 Add IsFinished arg to EmitBlock.
- Indicates that caller is done with the block and it can be dropped
   if it has no predecessors. Useful for callers who need to make
   landing pads but which may not be reached.

No functionality change.

llvm-svn: 59207
2008-11-13 01:24:05 +00:00
Ted Kremenek d0e32791d5 Update checker build.
llvm-svn: 59206
2008-11-13 01:23:50 +00:00
Bill Wendling 1a0f1d88ff Regenerated
llvm-svn: 59204
2008-11-13 01:03:00 +00:00
Bill Wendling a813017b41 Update docs for ssp and sspreq function attributes.
llvm-svn: 59203
2008-11-13 01:02:51 +00:00
Bill Wendling ccb67a3d85 Implement stack protectors as function attributes: "ssp" and "sspreq".
llvm-svn: 59202
2008-11-13 01:02:14 +00:00
Daniel Dunbar f75c823e5c For if blocks with no else, name the join block ifend instead of the
more confusing ifelse.

Use dotted names for if blocks (if.then vs ifthen).

llvm-svn: 59201
2008-11-13 00:47:57 +00:00
Ted Kremenek ce9082ad5c Fix bug where the body block of an ObjCForCollectionStmt would not properly get expanded as a series of basic blocks.
llvm-svn: 59197
2008-11-13 00:06:59 +00:00
Daniel Dunbar c7ec5fcf24 Fix bug in constant evaluation exposed by 176.gcc.
- Evaluation of , operator used bogus assumption that LHS could be
   evaluated as an integral expression even though its type is
   unspecified.

This change is making isICE very permissive of the LHS in non-evaluated 
contexts because it is not clear what predicate we would use to reject 
code here. The standard didn't offer me any guidance; opinions?

llvm-svn: 59196
2008-11-13 00:03:19 +00:00
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