Commit Graph

35960 Commits

Author SHA1 Message Date
Ted Kremenek 527ec81d8b Added support for __builtin_choose_expr (ChooseExpr) in CFGs.
llvm-svn: 41646
2007-08-31 17:03:41 +00:00
Dale Johannesen da7469f2b5 Revise per review of previous patch.
llvm-svn: 41645
2007-08-31 17:03:33 +00:00
Fariborz Jahanian 9fca6dfad3 Author: F. Jahanian
Log:
Implement parsing of objective-c's new @property declaration.

Modified:
include/clang/Basic/DiagnosticKinds.def
include/clang/Parse/Parser.h
Parse/ParseObjc.cpp
Parse/Parser.cpp

llvm-svn: 41644
2007-08-31 16:11:31 +00:00
Rafael Espindola e636fc05d6 Initial support for calling functions with byval arguments on x86-64
llvm-svn: 41643
2007-08-31 15:06:30 +00:00
Rafael Espindola bb8a5cff67 Align i64 and f64 at 8 byte on x86-64.
This is mandated table 3.1 at
http://www.x86-64.org/documentation/abi.pdf

llvm-svn: 41642
2007-08-31 12:23:58 +00:00
Evan Cheng 91becf4ffa Remove an unnecessary element, saving 4 bytes per LiveInterval.
llvm-svn: 41641
2007-08-31 08:26:44 +00:00
Evan Cheng 262596e76a Use std::map instead of a (potentially very sparse) array to track val# defined by copy from the other live range. Minor compile time win when number of val# is large.
llvm-svn: 41640
2007-08-31 08:04:17 +00:00
Evan Cheng 2e9d48aa0d Update test case to reflect Dale's change.
llvm-svn: 41639
2007-08-31 06:29:32 +00:00
Chris Lattner 319079c003 don't turn semantic errors into parse errors.
llvm-svn: 41638
2007-08-31 05:01:50 +00:00
Chris Lattner c6c66c461f fix some memory leaks when recovering.
llvm-svn: 41637
2007-08-31 04:58:34 +00:00
Anders Carlsson 4692db0e7e Add InitListExpr class.
llvm-svn: 41636
2007-08-31 04:56:16 +00:00
Chris Lattner 57c523f50c add actions for deleting expr/stmt nodes.
llvm-svn: 41635
2007-08-31 04:53:24 +00:00
Chris Lattner 9e47ead594 Implement codegen support for lowering "library builtins" like __builtin_isinf
to their corresponding library routines (e.g. isinf).  This allows us to handle
all the stuff in macos math.h, and other stuff as it's added to *Builtins.def.

llvm-svn: 41634
2007-08-31 04:44:06 +00:00
Chris Lattner 1eec6601d9 add the ability to get the llvm function corresponding to a library builtin.
llvm-svn: 41633
2007-08-31 04:31:45 +00:00
Dale Johannesen 3cf889f75e Enhance APFloat to retain bits of NaNs (fixes oggenc).
Use APFloat interfaces for more references, mostly
of ConstantFPSDNode.

llvm-svn: 41632
2007-08-31 04:03:46 +00:00
Chris Lattner 7e2e459c48 add some accessors for querying attributes of builtins. Add the new 'F' attribute.
llvm-svn: 41631
2007-08-31 03:44:20 +00:00
Steve Naroff 43b8f7fa4f Sema::ParseCastExpr() missing call to UsualUnaryConversions().
The following case now works...

void empty(void * a ) {}

void test()
{
    unsigned char A[4]; 
    empty( (void *) A); 
}

Thanks to Patrick Flannery for finding this...

llvm-svn: 41630
2007-08-31 00:32:44 +00:00
Raul Herbster ab871baaf8 Instruction formats added used to generate multiply instructions of V5TE.
llvm-svn: 41629
2007-08-30 23:34:14 +00:00
Raul Herbster ff32b62942 Unused relocation type reloc_arm_absolute removed.
llvm-svn: 41628
2007-08-30 23:31:35 +00:00
Raul Herbster 1457b2b3b1 Comments added. It now generates V5TE multiply instructions. However, it is still necessary to model PUWLSH bits more clearly.
llvm-svn: 41627
2007-08-30 23:29:26 +00:00
Raul Herbster 73489273ae ARM instruction table was modified by adding information to generate multiply instruction of V5TE.
llvm-svn: 41626
2007-08-30 23:25:47 +00:00
Raul Herbster ae1b924c79 JITInfo now resolves function addrs and also relocations. It always emits a stub.
llvm-svn: 41625
2007-08-30 23:21:27 +00:00
Steve Naroff d57fa94148 Final phase of array cleanup (for now), removing a FIXME from yesterday.
Moved several array constraints checks from Sema::VerifyConstantArrayType() to
Sema::GetTypeForDeclarator(). VerifyConstantArrayType() is now very simple, and
could be removed eventually.

Now, we get the following (correct) messages for BlockVarDecls:-)

[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang x.c -pedantic
x.c:4:20: error: size of array has non-integer type 'float'
  int size_not_int[f];
                   ^
x.c:5:21: error: array size is negative
  int negative_size[1-2];
                    ^~~
x.c:6:17: warning: zero size arrays are an extension
  int zero_size[0];
                ^
3 diagnostics generated.

llvm-svn: 41624
2007-08-30 22:35:45 +00:00
Ted Kremenek fc7aafcef0 Minor cleanups to pretty-printing for loops in CFGs.
llvm-svn: 41623
2007-08-30 21:28:02 +00:00
Ted Kremenek 55e91e8bdd Fixed a bug in constructing CFG blocks for case statement fall-through
introduced by moving "CaseStmt" pointers out of the list of statements
and into the explicit "label" associated with a CFGBlock.  --This
line, and those below, will be ignored--

M    AST/CFG.cpp

llvm-svn: 41622
2007-08-30 18:48:11 +00:00
Steve Naroff 09b0fd24a7 Diff is self small & self explanatory...
llvm-svn: 41621
2007-08-30 18:45:57 +00:00
Ted Kremenek e961050104 Fixed bug in CFG construction where we failed to handle loop bodies with
no statements (or just full of ';' statements).

llvm-svn: 41620
2007-08-30 18:39:40 +00:00
Ted Kremenek f9b1756029 Fixed bug in CFG construction involving use of labels and "empty"
blocks involving only ';' statements.  We now correctly handle the following:

void empty_label() { l1: ; }

llvm-svn: 41619
2007-08-30 18:20:57 +00:00
Steve Naroff cadebd086f Fix a comment.
llvm-svn: 41618
2007-08-30 18:14:25 +00:00
Ted Kremenek bbad8ce2e7 Fixed bug where the CFG would fail to build when an 'if' statement had
an empty then or else block (or contained only ';' statements).

For example, we now handle the following:

int empty_else() { if (0) { int a; } else ; }
int empty_then() { if (0) ; else { int a; } }

Thanks to Nico Weber for spotting this problem.

llvm-svn: 41617
2007-08-30 18:13:31 +00:00
Steve Naroff 90dfdd5774 Polish yesterday's Array/ConstantArray/VariableArray rewrite, removing a couple FIXME's.
Refactored Array/VariableArray, moving SizeModifier/IndexTypeQuals back up to Array. These
attributes are not specific to VLA's. Most of them are specific to array parameter types.

llvm-svn: 41616
2007-08-30 18:10:14 +00:00
Chris Lattner 98dbf0a3b8 implement pretty printing of offsetof
llvm-svn: 41615
2007-08-30 17:59:59 +00:00
Chris Lattner 8718fcf35e a new testcase
llvm-svn: 41614
2007-08-30 17:51:09 +00:00
Chris Lattner f17bd423c2 implement initial sema support for __builtin_offsetof
llvm-svn: 41613
2007-08-30 17:45:32 +00:00
Chris Lattner e4ee2dfcf5 Pass the location of the type.
llvm-svn: 41612
2007-08-30 17:08:45 +00:00
Chris Lattner 55343038f4 Fix 80 col violations.
llvm-svn: 41611
2007-08-30 17:08:17 +00:00
Ted Kremenek ed99b8a2a8 Added Graphviz escaping for the '|' character.
llvm-svn: 41610
2007-08-30 17:01:41 +00:00
Ted Kremenek 14f0d1a85a Fixed bug for CaseStmt where the child_begin/child_end methods were not
including the expressions in the case statement itself (not the body of
the case).

This required moving SubStmt out of SwitchCase into CaseStmt and DefaultStmt
respectively.  getSubStmt() now is a virtual call for SwitchCase, but is
a direct (static) call for CaseStmt and DefaultStmt.

llvm-svn: 41609
2007-08-30 16:50:46 +00:00
Tanya Lattner ffb806cf0e Do not run on darwin.
llvm-svn: 41608
2007-08-30 16:07:20 +00:00
Chris Lattner 5ad4f46fd6 make sure to parse postfix expression suffixes after builtin
primary expressions.

llvm-svn: 41607
2007-08-30 15:52:49 +00:00
Chris Lattner 687d609f04 add an action callback for __builtin_offsetof
llvm-svn: 41606
2007-08-30 15:51:11 +00:00
Chris Lattner fec2519b4b -C mode doesn't return comments on "#" lines, so the diag checker doesn't pick them up.
Test this the hard way.

llvm-svn: 41605
2007-08-30 06:38:49 +00:00
Chris Lattner e41d2d3b22 When relexing the file to find expected warnings/errors, make sure
to turn off all lexer-related warnings.

llvm-svn: 41604
2007-08-30 06:34:23 +00:00
Chris Lattner 1e43547a53 fix a bug that is causing CodeGen/complex.c to be grumpy.
llvm-svn: 41603
2007-08-30 06:19:11 +00:00
Chris Lattner 11e30d355e Teach the stmtdumper to dump location/range info when a SourceMgr is available.
For example, -parse-ast-dump now prints:

static inline int __inline_isinff(float __x)
(CompoundStmt 0x2409a20
  (ReturnStmt 0x2409a10
    (BinaryOperator 0x24099f0 'int' <///usr/include/architecture/i386/math.h:183:63, col:102> '=='
      (CallExpr 0x24098f0 'float' <col:63, col:82>
        (ImplicitCastExpr 0x24098e0 'float (*)(float)' <col:63>
          (DeclRefExpr 0x2409880 'float (float)' <col:63> Decl='__builtin_fabsf' 0x2409840))
        (DeclRefExpr 0x24098a0 'float' <col:79> Decl='__x' 0x2409810))
      (CallExpr 0x24099c0 'float' <col:87, col:102>
        (ImplicitCastExpr 0x2409870 'float (*)(void)' <col:87>
          (DeclRefExpr 0x2409980 'float (void)' <col:87> Decl='__builtin_inff' 0x2409940))))))

where it only prints filename/line# if it changes from the previous value.  We 
really need loc info on stmts though, like we have on exprs.

llvm-svn: 41602
2007-08-30 06:17:34 +00:00
Chris Lattner 270228599d Fix a regression on test/Sema/unused-expr.c by fixing the type predicates
to test for the right type class.

llvm-svn: 41601
2007-08-30 06:10:41 +00:00
Chris Lattner 257fa2ae22 constify a method.
llvm-svn: 41600
2007-08-30 05:59:30 +00:00
Evan Cheng ebb8540067 Added support to fold X86 load / store instructions. This allow rematerialized loads to be folded into their uses.
llvm-svn: 41599
2007-08-30 05:54:07 +00:00
Evan Cheng 32a0a995c6 Try fold re-materialized load instructions into its uses.
llvm-svn: 41598
2007-08-30 05:53:02 +00:00
Evan Cheng 9a25d98c86 Add a variant of foldMemoryOperand to fold any load / store, not just load / store from / to stack slots.
llvm-svn: 41597
2007-08-30 05:52:20 +00:00