- Aug 21, 2007
-
-
Chris Lattner authored
llvm-svn: 41202
-
Steve Naroff authored
Added Parser::ParseStructDeclaration() as a result of refactoring Parser::ParseStructUnionBody(). Motivation: Objective-C can now share this rule. It also makes Parser::ParseStructUnionBody() a bit smaller/cleaner.. llvm-svn: 41201
-
- Aug 20, 2007
-
-
Steve Naroff authored
Start parsing ObjC classes/categories! Next step, refactor Parser::ParseStructUnionBody() so that struct declarations can be shared with Objective-C (for declaring instance variables). llvm-svn: 41200
-
Anders Carlsson authored
llvm-svn: 41188
-
Ted Kremenek authored
for the following C++ casts: static_cast, reinterpret_cast, and const_cast. llvm-svn: 41181
-
Ted Kremenek authored
to getBase and getIdx. getBase and getIdx now return a "normalized" view of the expression (e.g., always "A[4]" instead of possibly "4[A]"). getLHS and getRHS return the expressions with syntactic fidelity to the original source code. Also modified client code of ArraySubscriptExpr, including the AST dumper and pretty printer, the return-stack value checker, and the LLVM code generator. llvm-svn: 41180
-
- Aug 18, 2007
-
-
Ted Kremenek authored
auto storage, but this routine would incorrectly return false. llvm-svn: 41162
-
Ted Kremenek authored
llvm-svn: 41147
-
Anders Carlsson authored
llvm-svn: 41145
-
- Aug 17, 2007
-
-
Ted Kremenek authored
"return of stack addresses." ParseReturnStmt now calls CheckReturnStackAddr to determine if the expression in the return statement evaluates to an address of a stack variable. If so, we issue a warning. llvm-svn: 41141
-
Anders Carlsson authored
llvm-svn: 41140
-
Anders Carlsson authored
llvm-svn: 41136
-
- Aug 16, 2007
-
-
Steve Naroff authored
Fixed Sema::CheckEqualityOperands() and Sema::CheckRelationalOperands() to deal more thoughtfully with incompatible pointers. This includes: - Emit a diagnostic when two pointers aren't compatible! - Promote one of the pointers/integers so we maintain the invariant expected by the code generator (i.e. that the left/right types match). - Upgrade the pointer/integer comparison diagnostic to include the types. llvm-svn: 41127
-
Ted Kremenek authored
"A[4]" are equivalent to "4[A]", and that a test that the expression returned by "getBase()" has a pointer type is required to resolve which subexpression is the "true" base expression of the array index. llvm-svn: 41113
-
- Aug 15, 2007
-
-
Ted Kremenek authored
canonicalized queries of a variable's storage: hasAutoStorage - Does a variable have (implicit) auto storage? hasStaticStorage - Does a variable have (implicit) static storage? hasLocalStorage - Is the variable a non-static local variable? hasGlobalStorage - Is the variable a global variable or a static local variable? Additional comments documenting these functions are included in the source. llvm-svn: 41092
-
- Aug 14, 2007
-
-
Ted Kremenek authored
llvm-svn: 41079
-
Ted Kremenek authored
family of functions. Previous functionality only included checking to see if the format string was a string literal. Now we check parse the format string (if it is a literal) and perform the following checks: (1) Warn if: number conversions (e.g. "%d") != number data arguments. (2) Warn about missing format strings (e.g., "printf()"). (3) Warn if the format string is not a string literal. (4) Warn about the use se of '%n' conversion. This conversion is discouraged for security reasons. (5) Warn about malformed conversions. For example '%;', '%v'; these are not valid. (6) Warn about empty format strings; e.g. printf(""). Although these can be optimized away by the compiler, they can be indicative of broken programmer logic. We may need to add additional support to see when such cases occur within macro expansion to avoid false positives. (7) Warn if the string literal is wide; e.g. L"%d". (8) Warn if we detect a '\0' character WITHIN the format string. Test cases are included. llvm-svn: 41076
-
Ted Kremenek authored
getStrData() are not null-terminated, and the lengths of these strings should be determined using getByteLength(). llvm-svn: 41055
-
- Aug 11, 2007
-
-
Chris Lattner authored
llvm-svn: 41015
-
Chris Lattner authored
aggregate value and scalar expression computation are very different, this gets them away from each other. This causes a temporary regression on some complex number examples. llvm-svn: 41014
-
- Aug 10, 2007
-
-
Chris Lattner authored
llvm-svn: 41011
-
Ted Kremenek authored
by CheckPrintfArguments to determine if a given printf function accepts a va_arg argument. llvm-svn: 41008
-
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
llvm-svn: 41004
-
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
-
Chris Lattner authored
llvm-svn: 41002
-
Chris Lattner authored
preprocessor state, causing bogus diagnostics when the file is parsed for real. This implements Misc/diag-checker.c. Thanks to Ted for noticing this. llvm-svn: 41000
-
Steve Naroff authored
Make sure the arithmetic conversion are done for relation and equality operators. This fixes the following... eypedef short S; int test(S X, long long Y) { return X < Y; } Before... (CompoundStmt 0x2905d00 (ReturnStmt 0x2905cf0 (BinaryOperator 0x2905cd0 'int' '<' (ImplicitCastExpr 0x2905cc0 'int' (DeclRefExpr 0x2905c80 'S':'short' Decl='X' 0x2905c20)) (DeclRefExpr 0x2905ca0 'long long' Decl='Y' 0x2905c50)))) After... (CompoundStmt 0x2b05c30 (ReturnStmt 0x2b05c20 (BinaryOperator 0x2b05c00 'int' '<' (ImplicitCastExpr 0x2b05bf0 'long long' (DeclRefExpr 0x2b05bb0 'S':'short' Decl='X' 0x2b05b50)) (DeclRefExpr 0x2b05bd0 'long long' Decl='Y' 0x2b05b80)))) llvm-svn: 40999
-
Chris Lattner authored
llvm-svn: 40996
-
Chris Lattner authored
llvm-svn: 40995
-
Chris Lattner authored
llvm-svn: 40994
-
Chris Lattner authored
codegen for: _Complex double bar(int); void test(_Complex double*); void test2(int c) { _Complex double X; X = bar(1); test(&X); } llvm-svn: 40993
-
Chris Lattner authored
bitcast. llvm-svn: 40992
-
- Aug 09, 2007
-
-
Chris Lattner authored
llvm-svn: 40969
-
Chris Lattner authored
llvm-svn: 40968
-
Chris Lattner authored
llvm-svn: 40967
-
Chris Lattner authored
llvm-svn: 40966
-
Chris Lattner authored
llvm-svn: 40964
-
Chris Lattner authored
llvm-svn: 40963
-
Chris Lattner authored
llvm-svn: 40962
-