Commit Graph

885 Commits

Author SHA1 Message Date
Chris Lattner 0d799d3957 Add some missing #includes for GCC mainline, patch by Shantonu Sen!
llvm-svn: 48153
2008-03-10 17:04:53 +00:00
Chris Lattner 7570e9c518 simplify all the type info accessors in TargeTInfo to return scalars,
which is simpler to use and provide.

llvm-svn: 48051
2008-03-08 08:52:55 +00:00
Chris Lattner 2dca6ff505 Fix a fixme by allowing pointers in different address spaces to have
different widths.  Start simplifying TargetInfo accessor methods.

llvm-svn: 48050
2008-03-08 08:34:58 +00:00
Gabor Greif 3a8edd8536 fix typos
llvm-svn: 47995
2008-03-06 10:40:09 +00:00
Chris Lattner 37e0587839 remove the source location arguments to various target query methods.
llvm-svn: 47954
2008-03-05 18:54:05 +00:00
Chris Lattner 855d024a83 Remove the first layer of support for "portability" warnings. This is
theoretically useful, but not useful in practice.  It adds a bunch of 
complexity, and not much value.  It's best to nuke it.  One big advantage
is that it means the target interfaces will soon lose their SLoc arguments
and target queries can never emit diagnostics anymore (yay).  Removing this
also simplifies some of the core preprocessor which should make it slightly
faster.

Ted, I didn't simplify TripleProcessor, which can now have at most one
triple, and can probably just be removed.  Please poke at it when you have
time.

llvm-svn: 47930
2008-03-05 01:18:20 +00:00
Ted Kremenek c76a83f1b6 CallExprs are now no longer block-level expressions in the CFG by construction.
llvm-svn: 47913
2008-03-04 22:29:40 +00:00
Ted Kremenek fcf6863f09 Minor CFG optimization: don't create separate block-level expressions for DeclStmt initializers when the initializer is a literal.
llvm-svn: 47771
2008-02-29 22:32:24 +00:00
Ted Kremenek 36748da5a6 When AST-dumping ObjCMessageExpr, output the selector.
llvm-svn: 47769
2008-02-29 22:04:05 +00:00
Ted Kremenek 41dd9d0bee Removed VarDecl::hasStaticStorage() (redundant with hasGlobalStorage())
Removed VarDecl::hasAutoStorage() (only used by hasLocalStorage())

Merged logic from VarDecl::hasAutoStorage() into VarDecl::hasLocalStorage(),
and expanded (fixed) the logic of hasLocalStorage() to handle Extern and PrivateExtern.

Renamed Expr::hasStaticStorage() to Expr::hasGlobalStorage().

llvm-svn: 47681
2008-02-27 18:39:48 +00:00
Ted Kremenek 40d876376d Fixed edge-case in CFG construction where goto jumps would not always get
properly back-patched.

llvm-svn: 47675
2008-02-27 17:33:02 +00:00
Ted Kremenek a1523a38f9 Bug fix in CFG construction: Properly register the loop head as the implicit
successor of blocks created above it.

llvm-svn: 47666
2008-02-27 07:20:00 +00:00
Ted Kremenek 39321aa199 Fixed CFG construction bug that occurred when a condition for a loop spanned
multiple basic blocks (which can happen when they contain '&&', '||', '?'). The
bug was that the loop backedge when to the last block in the loop condition, not
the first.

llvm-svn: 47649
2008-02-27 00:28:17 +00:00
Ted Kremenek 5affb58dd6 Do include ParenExpr in the CFG; only include their subexpression.
llvm-svn: 47588
2008-02-26 02:37:08 +00:00
Chris Lattner b7e656b177 add parsing, ast building and pretty printing support for C++ throw expressions.
Patch by Mike Stump!

llvm-svn: 47582
2008-02-26 00:51:44 +00:00
Ted Kremenek f699882a76 Fixed bug in CFG construction when a CompoundStmt ended with a NullStmt.
This caused the whole body to get dropped from the CFG.

llvm-svn: 47579
2008-02-26 00:22:58 +00:00
Eli Friedman 0992b38a78 Fix a little typo... per cfe-dev, this was apparently causing test
failures on OS X in some cases.  (Thank you valgrind.)

llvm-svn: 47568
2008-02-25 22:11:40 +00:00
Chris Lattner eb85ab44f2 convert tabs to spaces, patch by Mike Stump!
llvm-svn: 47560
2008-02-25 21:04:36 +00:00
Eli Friedman 401675b0de Minor code cleanup.
llvm-svn: 47530
2008-02-23 07:32:49 +00:00
Ted Kremenek 652d18e37c Patch from Argiris Kirtzidis:
The patch fixes some debug assertions that the msvcrt throws:

1)
-    if (isprint(value) && value < 256) {
+    if (value < 256 && isprint(value)) {

isprint() does an assertion check of its own for value < 256; check value before calling it to prevent it.


2)
-    Stmt->Names.push_back(std::string(&data[0], data.size()));
+    if (data.size() == 0)
+      Stmt->Names.push_back(std::string());
+    else
+      Stmt->Names.push_back(std::string(&data[0], data.size()));

If data.size() == 0 then data[0] throws "out of range" assertion.

llvm-svn: 47512
2008-02-23 00:52:04 +00:00
Gabor Greif 5c27a96967 Change variable name to Tq (from TQ)
because silly gcc 3.4.6 barfs on this
construct.
Type.h defines an "enum TQ", which makes
the parser to err.

llvm-svn: 47438
2008-02-21 17:40:55 +00:00
Chris Lattner 3b418d8446 implement codegen support for sizeof(void), fixing PR2080.
llvm-svn: 47429
2008-02-21 05:45:29 +00:00
Chris Lattner 445fcabff7 Alternate address spaces work:
rename QualType::getQualifiers to getCVRQualifiers.
Add some fixme's and clean up some code relevant to qualifiers.
Change ASQualType to contain a Type* instead of a QualType.  
Any CVR qualifiers should be on the outer qual type.

llvm-svn: 47398
2008-02-20 20:55:12 +00:00
Steve Naroff f631ae2cf8 Tweak fix for http://llvm.org/bugs/show_bug.cgi?id=2000 to work across typedefs.
llvm-svn: 47269
2008-02-18 15:14:59 +00:00
Anders Carlsson 6b5b42be41 More bitfield improvements.
llvm-svn: 47260
2008-02-18 07:13:09 +00:00
Anders Carlsson 9195e08e5e Fix bug where we would report the wrong value for __alignof__ with an expr that is not a type.
llvm-svn: 47259
2008-02-18 07:10:45 +00:00
Eli Friedman f7e92acaba Implemnt isVariablyModifiedType correctly.
llvm-svn: 47233
2008-02-17 00:59:11 +00:00
Anders Carlsson 6e3ace5205 Better handling of the aligned attribute.
llvm-svn: 47216
2008-02-16 19:51:27 +00:00
Anders Carlsson acea415ec5 More comments from Chris.
llvm-svn: 47210
2008-02-16 03:37:41 +00:00
Anders Carlsson 3ea23a45d9 Make sizeof and __alignof work correctly with packed structs.
llvm-svn: 47202
2008-02-16 01:20:23 +00:00
Anders Carlsson e5070069c8 Store attributes in a global hash map instead.
llvm-svn: 47191
2008-02-15 23:30:50 +00:00
Eli Friedman bd258284e0 Split out incomplete arrays from VariableArrayType into
IncompleteArrayType.  This should make code dealing with both incomplete 
and variable length arrays much more readable, plus it allows properly 
making the distinction between isVariableArrayType() and 
isVariablyModifiedType().  The patch is a little big, but it's 
strightforward. so I don't think there should be any issues.

llvm-svn: 47165
2008-02-15 18:16:39 +00:00
Eli Friedman a682d39639 Remove useless parameter from isConstantSizeType.
llvm-svn: 47156
2008-02-15 12:20:59 +00:00
Anders Carlsson 1a84106117 Get rid of AttributeList in the AST and use the new Attr class instead
llvm-svn: 47155
2008-02-15 07:04:12 +00:00
Eli Friedman a01cfa75eb Partial fix for struct compatibility; there's still something messy
going on with mixing scopes, though.

llvm-svn: 47152
2008-02-15 06:03:44 +00:00
Ted Kremenek 654c78fd2d When creating the CFGBlocks for a switch statement, we now have the "default"
branch ALWAYS be the last successor for a switch-terminated block. This allows
clients to distinguish cases like the following:

switch(...)
  case XXX:
    switch(...) {
      case YYY: ...
    }
    
  case ZZZ: ..
}

In this case, the block with "case ZZZ:" is the default block for the inner
switch statement, but that case is associated with the outer switch statement,
and not the inner one. Clients can test for this behavior by checking if a
successor block is the last one (and thus just assume that this is the "default"
case).

llvm-svn: 47088
2008-02-13 22:05:39 +00:00
Ted Kremenek 9682be18ae Fixed bug in CFG construction when processing switch statements that contain no
"default" case. In such cases, we now correctly add the CFGBlock representing
the code after the switch statement as a successor to the block terminated by
the switch statement.

llvm-svn: 47087
2008-02-13 21:46:34 +00:00
Eli Friedman 2be9af9556 Fix a minor bug in isNullPointerConstant triggered by the linux
tgmath.h.

Note that there is another issue with tgmath.h, so mandel.c still 
doesn't work.

llvm-svn: 47069
2008-02-13 17:29:58 +00:00
Chris Lattner f26609686f Move IgnoreParenCasts to be a method on Expr.
llvm-svn: 47040
2008-02-13 01:02:39 +00:00
Eli Friedman a7bf7ed476 Make typechecking for enum+int compatibility stricter.
llvm-svn: 47005
2008-02-12 08:46:17 +00:00
Eli Friedman 2b90b0d09e Add wchar_t type to ASTContext. Will be needed for wide strings, since
they are of type wchar_t[].

llvm-svn: 47004
2008-02-12 08:29:21 +00:00
Eli Friedman 16f909670e Fix type compatibility between constant and variable arrays.
llvm-svn: 47003
2008-02-12 08:23:06 +00:00
Steve Naroff 1018ea35b7 Refine bug fix to Expr::isLvalue (commit r46917).
llvm-svn: 46919
2008-02-10 01:39:04 +00:00
Steve Naroff 43c50866f1 Change Expr::isLvalue() to allow the "void" type. This fixes bz2000 submitted by Neil Booth.
Neil, can you point me to the place in the C99 spec that says this is allowed? I thought Expr::isLvalue() conformed to the spec, which says "C99 6.3.2.1: an lvalue is an expression with an object type or an incomplete type other than void.". Please advise.

llvm-svn: 46917
2008-02-10 00:30:18 +00:00
Anders Carlsson 5c6c05956e Put back the top-level asm code; all tests pass now.
llvm-svn: 46868
2008-02-08 00:33:21 +00:00
Anders Carlsson 0fae4f56df Back out 46855 for now, it causes test failures on Darwin.
llvm-svn: 46867
2008-02-08 00:23:11 +00:00
Anders Carlsson bcc3a4bf64 Handle top-level asm declarations.
llvm-svn: 46855
2008-02-07 17:19:11 +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
Eli Friedman 1242fff6ec Make sure to propagate qualifiers through the member operator.
llvm-svn: 46830
2008-02-06 22:48:16 +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