- Oct 10, 2007
-
-
Steve Naroff authored
Make sure methods with no return type default to "id". This fixes a crasher in Sema::MatchTwoMethodDeclarations(), identified by selector-overload.m (just added). Added Action::ActOnTranslationUnitScope() and renamed Action::PopScope to ActOnPopScope. Added a Translation Unit Scope instance variable to Sema (will be very useful to ObjC-related actions, since ObjC declarations are always file-scoped). llvm-svn: 42817
-
- Aug 31, 2007
-
-
Chris Lattner authored
llvm-svn: 41635
-
- Aug 10, 2007
-
-
Ted Kremenek authored
KnownFunctionIDs. This allows us to test for a printf-like function that accepts a va_arg argument using a range comparison. llvm-svn: 41006
-
Chris Lattner authored
"I've coded up some support in clang to flag warnings for non-constant format strings used in calls to printf-like functions (all the functions listed in "man fprintf"). Non-constant format strings are a source of many security exploits in C/C++ programs, and I believe are currently detected by gcc using the flag -Wformat-nonliteral." llvm-svn: 41003
-
- Jun 16, 2007
-
-
Chris Lattner authored
out of the llvm namespace. This makes the clang namespace be a sibling of llvm instead of being a child. The good thing about this is that it makes many things unambiguous. The bad things is that many things in the llvm namespace (notably data structures like smallvector) now require an llvm:: qualifier. IMO, libsystem and libsupport should be split out of llvm into their own namespace in the future, which will fix this issue. llvm-svn: 39659
-
- May 19, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: An important, but truly mind numbing change. Added 6 flavors of Sema::Diag() that take 1 or two SourceRanges. Considered adding 3 flavors (using default args), however this wasn't as clear. Removed 2 flavors of Sema::Diag() that took LexerToken's (they weren't used). Changed all the typechecking routines to pass the appropriate range(s). Hacked the diagnostic machinery and driver to acccommodate the new data. What's left? A FIXME in clang.c to use the ranges. Chris offered to do the honors:-) Which includes taking us to the end of an identifier:-) llvm-svn: 39456
-
- May 16, 2007
-
-
Chris Lattner authored
the version that takes a string. llvm-svn: 39450
-
Chris Lattner authored
QualType::getAsString() that returns a string, which is much easier for clients to use. Convert clients to use it. llvm-svn: 39449
-
Chris Lattner authored
llvm-svn: 39448
-
- May 13, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: Two bug fixes to CheckIncrementDecrementOperand: - removed "constantOne" usage and simply use Context.IntTy. - fix the last constraint check...the lvalue test needs to be on the expression, not the type! (duh). llvm-svn: 39442
-
- May 07, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: - Unified CheckSimpleAssignmentOperands/CheckCompoundAssignmentOperands into one function, named CheckAssignmentOperands. One less function to maintain. - Converted the unary check functions (ParseUnaryOp and friends) to have the same API as their binary counterparts. - Implemented CheckIndirectionOperand (was stubbed). While testing, noticed that Expr::isModifiableLvalue was incomplete (fixed and referenced draft). - Added constantOne instance variable to Sema. - Removed CheckArithmeticOperand (the code was so simple that it is now part of ParseUnaryOp). The name wasn't great anyway:-) llvm-svn: 39435
-
- Apr 06, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: -Changed the name of TypeRef to QualType. Many diffs. -Changed the QualType constructor to require Quals be passed. This makes the code a bit more verbose, however will make the code easier to work on. Given the complexity of types, this should help spot bogosities. -Changed the Expr constructor to require a QualType. Same motivation. llvm-svn: 39395
-
- Mar 30, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: Implement ++/-- typechecking for pre/post unary expressions. This includes: - added isLvalue, isModifiableLvalue (on TypeRef, Type, and RecordType). - added isRealType, isRealFloatingType, isComplexType. - hacked Diag to take a TypeRef (I was sick of writing the 2 line "setup":-) In addition, this will likely lead to less bugs...I already had written code that was doing a getAsString on "Type" (which is wrong...since it doesn't include any qualifiers). - Changed UnaryOperator to take a TypeRef...pass it the right stuff. - Removed redundant ternary expressions in several predicates. - A couple diagnostics. llvm-svn: 39369
-
- Mar 23, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: Type Checking...round 2. This checkin "breaks" parsing carbon.h. I imagine that this will be true for the next week or so. Nevertheless, this round of changes includes the following: - Hacked various Expr classes to pass the appropriate TypeRef. Still have a few more classes to touch. - Implement type checking for ParseArraySubscriptExpr and ParseMemberReferenceExpr. - Added a debug hook to derive the class name for Stmt/Expr nodes. Currently a linear search...could easily optimize if important. - Changed the name of TaggedType->TagType. Now we have TagType and TagDecl (which are easier to remember). - Fixed a bug in StringLiteral conversion I did a couple weeks ago. hadError was not initialized (oops). - changed Sema::Diag to return true. This streamlines the type checking code considerably. - Added many diagnositics. This should be it! llvm-svn: 39361
-
- Mar 06, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: More code to parse numeric constants. This checkin includes: - Feedback from Chris. - Support for parsing floating point constants. - Moved the code to "Sema". Changed API in Action. - More/better error diagnostics. At this point, the parsing support should be largely complete. Next step is to work on filling in sensible values (in IntegerLiteral/FloatLiteral). llvm-svn: 39349
-
- Feb 28, 2007
-
-
Steve Naroff authored
Go back to having the clang driver create ASTContext explicitly, passing it to Sema/ASTStreamer (separating the lifetime of ASTContext from the lifetime of Sema). One day it might be useful to consider creating a context object implicitly if one isn't provided (using default arguments in Sema's constructor). At this point, adding this convenience isn't necessary. llvm-svn: 39346
-
Steve Naroff authored
the prerocessor will be available via ASTContext). - Removed the public data member "PP" in ASTContext. - Changed ASTContext's contructor to take TargetInfo/IdentifierTable explicitly. - Implicitly create an ASTContext in Sema's constructor. This simplifies the clients job (and makes ASTContext more private). --As a side effect, added a "PrintStats" hook to Sema. To support this level of encapsulation, ASTContext is always dynamically allocated (by Sema). Previously, ASTContext was being allocated on the stack. I don't believe this should be a performance issue (since ASTContext is fairly course grain and tied to the lifetime of Sema currently). llvm-svn: 39345
-
- Nov 20, 2006
-
-
Chris Lattner authored
int A() { return X(); } llvm-svn: 39194
-
- Nov 10, 2006
-
-
Chris Lattner authored
llvm-svn: 39161
-
Chris Lattner authored
to SemaDecl.cpp llvm-svn: 39159
-
Chris Lattner authored
llvm-svn: 39157
-
Chris Lattner authored
llvm-svn: 39156
-
Chris Lattner authored
llvm-svn: 39155
-
Chris Lattner authored
interface exported by libast. llvm-svn: 39154
-
- Nov 09, 2006
-
-
Chris Lattner authored
llvm-svn: 39153
-
Chris Lattner authored
fundamentally requires having an AST around, so move all sema to the AST library. This is the first step, later steps will be needed to clean up libast. llvm-svn: 39150
-
- Nov 05, 2006
-
-
Chris Lattner authored
llvm-svn: 39121
-
Chris Lattner authored
llvm-svn: 39120
-
- Nov 04, 2006
-
-
Chris Lattner authored
llvm-svn: 39119
-
Chris Lattner authored
llvm-svn: 39116
-
Chris Lattner authored
llvm-svn: 39113
-
Chris Lattner authored
and should be implemented with an ASTBuilder subclass anyway. llvm-svn: 39107
-
- Nov 03, 2006
-
-
Chris Lattner authored
llvm-svn: 39095
-
- Oct 28, 2006
-
-
Chris Lattner authored
llvm-svn: 39075
-
- Oct 25, 2006
-
-
Chris Lattner authored
llvm-svn: 39051
-
Chris Lattner authored
llvm-svn: 39050
-
Chris Lattner authored
llvm-svn: 39049
-
Chris Lattner authored
llvm-svn: 39048
-
Chris Lattner authored
llvm-svn: 39046
-
Chris Lattner authored
llvm-svn: 39045
-