Commit Graph

36171 Commits

Author SHA1 Message Date
Chris Lattner 5a5b35c07b make the sourcemgr available through ASTContext.
llvm-svn: 41906
2007-09-13 01:14:03 +00:00
Evan Cheng b2c42621df Added getNumDefs().
llvm-svn: 41901
2007-09-13 00:16:29 +00:00
Evan Cheng 100c8d6c8f Bug fixes.
llvm-svn: 41900
2007-09-13 00:06:00 +00:00
Evan Cheng 57ff158255 Remove dead code.
llvm-svn: 41899
2007-09-12 23:45:46 +00:00
Evan Cheng bb6a574def Yet another getTargetNode variant.
llvm-svn: 41898
2007-09-12 23:39:49 +00:00
Evan Cheng 59c39dc197 Initial support for multi-result patterns:
1.
[(set GR32:$dst, (add GR32:$src1, GR32:$src2)),
 (modify EFLAGS)]
This indicates the source pattern expects the instruction would produce 2 values. The first is the result of the addition. The second is an implicit definition in register EFLAGS.
2.
def : Pat<(parallel (addc GR32:$src1, GR32:$src2), (modify EFLAGS)), ()>
Similar to #1 except this is used for def : Pat patterns.

llvm-svn: 41897
2007-09-12 23:30:14 +00:00
Steve Naroff 3aa4efbdee Add ASTContext::StringMap<char> to unique selector names.
llvm-svn: 41894
2007-09-12 23:08:22 +00:00
Evan Cheng d8317967aa Fixed a typo that's causing a missing kill marker.
llvm-svn: 41893
2007-09-12 23:02:04 +00:00
Ted Kremenek 302def221c Minor space tightening.
Removed extraneous call to Observer->ObserveStmt when handling DeclRefExprs.

llvm-svn: 41890
2007-09-12 20:28:48 +00:00
Steve Naroff 437b4d8bda Remove a FIXME. Replace a couple asserts with an appropriate error
diagnostic for illegal initializers.

llvm-svn: 41889
2007-09-12 20:13:48 +00:00
Ted Kremenek fe1da5ec56 Fixed recursion bug: should call Visit on child instead of VisitStmt.
llvm-svn: 41888
2007-09-12 20:11:39 +00:00
Ted Kremenek b10f1d881e Fixed logic bug in recursion to visiting child statements.
llvm-svn: 41887
2007-09-12 20:08:31 +00:00
Ted Kremenek 439b19928f Added files CFGStmtVisitor and DataflowStmtVisitor to XCode project.
llvm-svn: 41886
2007-09-12 19:12:02 +00:00
Ted Kremenek 1147e36fe0 Migrated LiveVariables to use the new DataflowStmtVisitor interface. The code
is much simpler now.

llvm-svn: 41885
2007-09-12 19:10:52 +00:00
Ted Kremenek d160034330 Added extensions (subclasses) to the StmtVisitor class that
are useful for dataflow analysis: CFGStmtVisitor and DataflowStmtVisitor.

CFGStmtVisitor is the same as StmtVisitor is that it has separate visitors
for "root" statements in a CFGBlock (statements that have a designated
slot int the list of statements in a CFGBlock).  It also recognizes statements
that have implicit control-flow, and calls special visitor methods for those.

DataflowStmtVisitor extends CFGStmtVisitor to serve as a template for
implementing transfer functions.  It does a pre-/post-order traversal of
substatements depending on whether we are doing a forward/backward analysis.
It also has special handling for implicit-control-flow statements so that
they are visited only once.

llvm-svn: 41884
2007-09-12 19:09:12 +00:00
Chris Lattner 909ef0973b add a new BF->LLVM translator, contributed by Sterling Stein.
llvm-svn: 41881
2007-09-12 18:24:00 +00:00
Fariborz Jahanian cfb31fab5e Patch for building method declaration nodes. Also fixed a segfault in cocoa.m due
to use of @property.

llvm-svn: 41880
2007-09-12 18:23:47 +00:00
Chris Lattner 7b412cb823 Change llvm.gcroot to not init the root to null at runtime, this prevents
using it for live-in values etc.

llvm-svn: 41879
2007-09-12 17:53:10 +00:00
Hartmut Kaiser 0249104aa5 Removed clang solution file for VC++, which didn't work properly because of hard coded paths in the llvm project files.
Changed windows detection to use LLVM pp constant.

llvm-svn: 41878
2007-09-12 15:39:04 +00:00
Steve Naroff 6109140b00 Fix the following bug submitted by Ted Kremenek:
void func() {
int xx = xx; // incorrectly diagnosed 'xx' as an undeclared identifier.
}

This smallish bug resulted in a largish fix. Here are some highlights:

- Needed to make sure ParseDeclarator is called *before* parsing any
initializer. Removed the "Init" argument to ParseDeclarator.
- Added AddInitializerToDecl() to the Action & Sema classes.
In Sema, this hook is responsible for validating the initializer and
installing it into the respective decl.
- Moved several semantic checks from ParseDeclarator() to 
FinalizeDeclaratorGroup(). Previously, this hook was only responsible for 
reversing a list. Now it plays a much larger semantic role. 

All of the above changes ended up simplifying ParseDeclarator(), which
is goodness...

llvm-svn: 41877
2007-09-12 14:07:44 +00:00
Dale Johannesen 100410af13 Generated files for previous patch.
llvm-svn: 41876
2007-09-12 03:31:28 +00:00
Dale Johannesen 028084efe5 Revise previous patch per review comments.
Next round of x87 long double stuff.
Getting close now, basically works.

llvm-svn: 41875
2007-09-12 03:30:33 +00:00
Dale Johannesen 521988b604 Compensate for partCount change in Bogus definition
(could break hash table in ConstantFP)

llvm-svn: 41874
2007-09-12 01:22:05 +00:00
Bill Wendling 66c22e8fd6 Enable indirect encoding for the personality function
llvm-svn: 41873
2007-09-11 23:55:40 +00:00
Daniel Berlin a3bba5ce20 Move dump out of class, use "\n" instead of endl
llvm-svn: 41872
2007-09-11 22:58:27 +00:00
Evan Cheng c16847b157 Sometimes a MI can define a register as well as defining a super-register at the
same time. Do not mark the "smaller" def as dead.

llvm-svn: 41871
2007-09-11 22:34:47 +00:00
Anton Korobeynikov 9811eb3d07 Fix date :)
llvm-svn: 41870
2007-09-11 22:20:27 +00:00
Anton Korobeynikov 38f9e2a4b6 Testcase for recent pragma pack stuff
llvm-svn: 41869
2007-09-11 22:12:26 +00:00
Ted Kremenek 3a5aa768c6 Added static method "CFG::hasImplicitControlFlow".
This method is used to determine if an expression contains implicit
control-flow, and thus appears in a distinct statement slot in the CFG.

For example:

  (1) x = ... ? ... ? ...

  logically becomes:

  (1) ... ? ... : ...  (a unique statement slot for the ternary ?)
  (2) x = [E1]         (where E1 is actually the ConditionalOperator*)

A client of the CFG, when walking the statement at (2), will encounter
E1.  In this case, hasImplicitControlFlow(E1) == true, and the client
will know that the expression E1 is explicitly placed into its own statement
slot to capture the implicit control-flow it has.

llvm-svn: 41868
2007-09-11 22:08:24 +00:00
Ted Kremenek 3dd952ba72 Fixed bug where ternary expressions and GCC-style conditional expressions
where not reversing the order of their subexpression blocks.

Added feature where CallExprs are placed in their own statement slot in
a CFGBlock.  Thus we have a designated "return site" within a CFGBlock when
reasoning about function calls.

llvm-svn: 41866
2007-09-11 21:29:43 +00:00
Steve Naroff f2fb4ad08e - Add an ObjcIvarDecl AST node (a subclass of FieldDecl).
- Instantiate the node in Sema::ParseField(), based on the type of the TagDecl.
- Add Sema::ObjcAddInstanceVariable(), responsible for adorning/adding the ObjcIvarDecl.

llvm-svn: 41864
2007-09-11 21:17:26 +00:00
Evan Cheng 3e18e504ae Remove (somewhat confusing) Imp<> helper, use let Defs = [], Uses = [] instead.
llvm-svn: 41863
2007-09-11 19:55:27 +00:00
Evan Cheng 50b6730ae4 Added status flags register: EFLAGS.
llvm-svn: 41862
2007-09-11 19:53:28 +00:00
Evan Cheng c7852a689a Allow set operators with multiple destinations, i.e. (set x, y, (op a, b)).
llvm-svn: 41861
2007-09-11 19:52:18 +00:00
Fariborz Jahanian cfc3e4d346 Change ObjcMethodDecl class derivation.
llvm-svn: 41860
2007-09-11 18:45:55 +00:00
Dale Johannesen 216788aacb Generated files for previous patch.
llvm-svn: 41859
2007-09-11 18:33:39 +00:00
Dale Johannesen 245dceb06d Add APInt interfaces to APFloat (allows directly
access to bits).  Use them in place of float and
double interfaces where appropriate.
First bits of x86 long double constants handling 
(untested, probably does not work).

llvm-svn: 41858
2007-09-11 18:32:33 +00:00
Daniel Berlin 32ef96186f Convert to use ilist and non-pointer lists for extra goodness
llvm-svn: 41855
2007-09-11 17:42:22 +00:00
Bill Wendling beb541544d Add accessor method.
llvm-svn: 41854
2007-09-11 17:24:38 +00:00
Ted Kremenek 2f1a79d329 For looking at "dead stores" in declarations, we now check to see
if the assigned value is a constant expression, e.g.:

int x = 0;

We then check to see if "x" is ever reassigned later.  If so, we don't
emit a warning.  This is because programmers frequently use defensive
programming to make sure a variable has a defined value.

llvm-svn: 41853
2007-09-11 17:24:14 +00:00
Bill Wendling 74fb0f1a1c Add a bool to indicate if we should set the "indirect encoding" bit in the Dwarf
information for EH.

llvm-svn: 41852
2007-09-11 17:20:55 +00:00
Chris Lattner 69c1b10993 Reenable libgc and libprofile is explicitly requested.
llvm-svn: 41851
2007-09-11 17:12:32 +00:00
Chris Lattner e09791c399 remove an obsolete library.
llvm-svn: 41850
2007-09-11 17:10:52 +00:00
Chris Lattner 9190ffe62e update this to use llvm-config, patch by Jose M. Moya
llvm-svn: 41849
2007-09-11 17:09:54 +00:00
Ted Kremenek ca6c2b750b Fixed potential NULL dereference when iterating over a chain of Decls.
llvm-svn: 41848
2007-09-11 17:00:40 +00:00
Gabor Greif 412af03cee get rid of ugly "warning: no newline at end of file"
warnings that some compilers diagnose

llvm-svn: 41847
2007-09-11 15:32:40 +00:00
Duncan Sands 94580c7522 Test that a call to a trampoline is turned into a call to
the underlying nested function.

llvm-svn: 41846
2007-09-11 15:07:50 +00:00
Duncan Sands d781335d39 Two ParamAttrsVectors which differ by a permutation
of their elements do not yield the same ParamAttrsList,
though they should.  On the other hand, everyone seems
to pass such vectors with elements ordered by increasing
index, so rather than sorting the elements simply assert
that the elements are ordered in this way.

llvm-svn: 41845
2007-09-11 14:40:04 +00:00
Duncan Sands 9204663bcb Turn calls to trampolines into calls to the underlying
nested function.

llvm-svn: 41844
2007-09-11 14:35:41 +00:00
Duncan Sands 86e0119822 Fold the adjust_trampoline intrinsic into
init_trampoline.  There is now only one
trampoline intrinsic.

llvm-svn: 41841
2007-09-11 14:10:23 +00:00