Commit Graph

40391 Commits

Author SHA1 Message Date
Steve Naroff 6936a08704 Minor cleanup from yesterday's -fms-extension commit. Move __int* MS keywords to predefined macros. This removes some of the MS-madness from Parser::ParseDeclarationSpecifiers().
llvm-svn: 46852
2008-02-07 15:26:07 +00:00
Ted Kremenek e187d0511f Added some more opcode pretty-printing.
Minor cleanups with generating nodes for NULL-pointer dereferences.

llvm-svn: 46851
2008-02-07 15:20:13 +00:00
Evan Cheng a20a773654 Fix a x86-64 codegen deficiency. Allow gv + offset when using rip addressing mode.
Before:
_main:
        subq    $8, %rsp
        leaq    _X(%rip), %rax
        movsd   8(%rax), %xmm1
        movss   _X(%rip), %xmm0
        call    _t
        xorl    %ecx, %ecx
        movl    %ecx, %eax
        addq    $8, %rsp
        ret
Now:
_main:
        subq    $8, %rsp
        movsd   _X+8(%rip), %xmm1
        movss   _X(%rip), %xmm0
        call    _t
        xorl    %ecx, %ecx
        movl    %ecx, %eax
        addq    $8, %rsp
        ret

Notice there is another idiotic codegen issue that needs to be fixed asap:
xorl    %ecx, %ecx
movl    %ecx, %eax

llvm-svn: 46850
2008-02-07 08:53:49 +00:00
Evan Cheng 1bc1cae318 In some cases, e.g. ADD32ri, no transformation is made. Guide against it.
llvm-svn: 46849
2008-02-07 08:29:53 +00:00
Nick Lewycky 7c1d787977 Don't make up new directives. (".set_foobar")
llvm-svn: 46848
2008-02-07 06:36:26 +00:00
Ted Kremenek d74da0838f Added proof-of-concept NULL pointer diagnostics to GRConstants.
Modified the driver to pass the Diagnostic object to GRConstants.

llvm-svn: 46847
2008-02-07 06:33:19 +00:00
Ted Kremenek 149512c013 Added support to distinguish between both implicit and explicit null dereferences.
llvm-svn: 46846
2008-02-07 06:04:18 +00:00
Chris Lattner 3b5054dda0 Implement support for the extremely atrocious MS /##/ extension,
which pastes together a comment.  This is only enabled with 
-fms-extensions of course.

llvm-svn: 46845
2008-02-07 06:03:59 +00:00
Chris Lattner f96e8d0925 these aren't tokens.
llvm-svn: 46844
2008-02-07 05:57:50 +00:00
Ted Kremenek e324704e62 Added recording of "implicit" NULL dereferences of symbolic pointers.
llvm-svn: 46843
2008-02-07 05:48:01 +00:00
Eli Friedman 69d56cff31 Add a FIXME for alternate address spaces.
llvm-svn: 46841
2008-02-07 05:24:51 +00:00
Chris Lattner 6bd4c7f94f get the tree building again
llvm-svn: 46840
2008-02-07 05:01:42 +00:00
Ted Kremenek 88da1de048 Added several guards in transfer functions for "InvalidValues".
Fixed bug in RemoveDeadBindings by implementing a simple "mark-and-sweep"
cleaner over the bindings, starting from the Decls and block-level expressions
that are considered "live" by the Liveness analysis.

Fixed bug in isa<> implementation for class LValue.

Added "VisitDeclRefExpr" to GRConstants so that we explicitly bind the current
value of variable to the Block-level Expression (i.e., when the DeclRefExpr is
at the CFGBlock level).

llvm-svn: 46839
2008-02-07 04:16:04 +00:00
Steve Naroff b2c80c7c7b Implement -fms-extensions. This allows us to fuzzy parse non-standard MS constructs used in "windows.h".
llvm-svn: 46838
2008-02-07 03:50:06 +00:00
Ted Kremenek a56c08a2e4 Fixed bug in LiveVariables analysis where Block-level exprs appearing
as the initializers for DeclStmts were not being registered as being
live at the start of the DeclStmt.

llvm-svn: 46837
2008-02-07 02:38:55 +00:00
Dan Gohman b3efe03672 Fix a typo in a comment.
llvm-svn: 46836
2008-02-07 02:30:40 +00:00
Ted Kremenek 43523e0fe8 Added transfer function logic for ReturnStmts.
Fixed insidious bug in handling dereferences.

llvm-svn: 46835
2008-02-07 01:08:27 +00:00
Dan Gohman 4f26eb7270 Add support to FoldingSet for hashing APInt objects.
llvm-svn: 46833
2008-02-06 23:09:15 +00:00
Ted Kremenek 4aa77cee11 Minor reordering of the serialization of the fields of MemberExpr to result
in a smaller encoding on disk.

llvm-svn: 46832
2008-02-06 23:03:14 +00:00
Ted Kremenek cdd0be1dc1 Major code refactoring/cleanup with transfer function logic. Now the
code structure is more suitable for additional symbolic analysis.

llvm-svn: 46831
2008-02-06 22:50:25 +00:00
Eli Friedman 1242fff6ec Make sure to propagate qualifiers through the member operator.
llvm-svn: 46830
2008-02-06 22:48:16 +00:00
Dan Gohman 2d489b5081 Re-apply the memory operand changes, with a fix for the static
initializer problem, a minor tweak to the way the
DAGISelEmitter finds load/store nodes, and a renaming of the
new PseudoSourceValue objects.

llvm-svn: 46827
2008-02-06 22:27:42 +00:00
Evan Cheng 127b41500c It's PR1925, not PR1609.
llvm-svn: 46825
2008-02-06 22:07:17 +00:00
Chris Lattner 871e0ceffb explicitly document that return statement argument does not necessarily follow the result type of the function. Add testcase.
llvm-svn: 46823
2008-02-06 21:20:34 +00:00
Bill Wendling c676a0329c Temporarily reverting:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20080128/057882.html

This is causing a miscompilation on PPC G5 and just now seeing it on iMac x86-64.

llvm-svn: 46822
2008-02-06 20:03:07 +00:00
Evan Cheng 1ec748c784 Fix a number of local register allocator issues: PR1609.
llvm-svn: 46821
2008-02-06 19:16:53 +00:00
Anders Carlsson 377ad02de5 Use the subprocess module instead of os.system. Patch by Sam Bishop.
llvm-svn: 46819
2008-02-06 19:03:27 +00:00
Chris Lattner 47ce2b2d22 some more notes.
llvm-svn: 46818
2008-02-06 18:32:06 +00:00
Chris Lattner 0ec3504e95 make it clear :)
llvm-svn: 46817
2008-02-06 18:00:48 +00:00
Chris Lattner cdc44ed525 add a bunch of random notes and fix some issues noticed by Gabor.
This is not ready for review or hacking, this is a work in progress :)

llvm-svn: 46816
2008-02-06 18:00:06 +00:00
Ted Kremenek afa5f492e5 Added main transfer function support for unary operator "!".
llvm-svn: 46815
2008-02-06 17:56:00 +00:00
Ted Kremenek 17b65b557b Added assumption logic for symbolic non-lvalues when used in conditions such as
"if(x)". On the true branch we know the value is != 0, and on the false branch
we know it is 0.

llvm-svn: 46814
2008-02-06 17:32:17 +00:00
Evan Cheng 8291ab4449 RegAllocaLocal still *requires* LiveVariables since it runs PHIElimination, followed by TwoAddress which requires LiveVariables. We cannot run LiveVariables on non-SSA code.
llvm-svn: 46813
2008-02-06 08:00:32 +00:00
Anders Carlsson d3b06cda3c Add pointer + int (and vice versa) to the constant emitter.
llvm-svn: 46812
2008-02-06 07:23:14 +00:00
Anders Carlsson 093f1a099f Generate code for the various __builtin_ctz functions.
llvm-svn: 46811
2008-02-06 07:19:27 +00:00
Chris Lattner 7422bce18a a starter shell for 2.2 release notes
llvm-svn: 46810
2008-02-06 06:30:34 +00:00
Chris Lattner b818af539f now that ConvertTagDeclType is nice and simple, use it from UpdateCompletedType.
llvm-svn: 46809
2008-02-06 06:06:49 +00:00
Chris Lattner d11482ea22 simplify and speed up type refinement logic. No functionality change.
llvm-svn: 46808
2008-02-06 06:03:51 +00:00
Chris Lattner a64dde6b48 only convert the type name once, not each type it is refined.
llvm-svn: 46807
2008-02-06 05:48:29 +00:00
Eli Friedman 220ee41011 Fix the codegen of structs with flexible array members.
llvm-svn: 46806
2008-02-06 05:33:51 +00:00
Chris Lattner 3340b92582 simplify a bunch of code.
llvm-svn: 46805
2008-02-06 05:29:46 +00:00
Chris Lattner 56096f3020 rename TypeHolderMap to TypeCache, which more aptly describes what it is.
llvm-svn: 46804
2008-02-06 05:21:55 +00:00
Chris Lattner ee9fafd533 split tagged decl layout into its own method.
llvm-svn: 46803
2008-02-06 05:18:32 +00:00
Chris Lattner f6e3669eb2 only update the llvm type for a struct when we used the struct
previously in an opaque context.  If we didn't do this, 
computing its layout could be wasted: just be lazy.

llvm-svn: 46802
2008-02-06 05:12:09 +00:00
Chris Lattner 68be60694e sink more of the type related code into CodeGenTypes.
llvm-svn: 46801
2008-02-06 05:08:19 +00:00
Chris Lattner 8b945ee058 codegen static variables in a function into a different namespace from
static variables outside functions.

llvm-svn: 46800
2008-02-06 04:54:32 +00:00
Eli Friedman d49a720d52 Be a bit stricter about array type compatibility.
llvm-svn: 46799
2008-02-06 04:53:22 +00:00
Chris Lattner a5e4d30942 Finish off the refactoring of type handling stuff. Now we recompile every
tag decl after it has been completed

llvm-svn: 46798
2008-02-06 04:51:19 +00:00
Ted Kremenek 73451846a7 Fixed bug in '=' transfer function: RHS does not have to be a non-LValue.
llvm-svn: 46797
2008-02-06 04:41:14 +00:00
Ted Kremenek d17f05435a Fixed signedness bug in cast transfer function when casting integers to pointers.
Removed lval::SymIntConstraintVal; wrappers for symbolic constraints are not lvalues (only integers that evaluate to !0 or 0).

llvm-svn: 46796
2008-02-06 04:31:33 +00:00