- Aug 14, 2007
-
-
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
-
Chris Lattner authored
llvm-svn: 40959
-
Chris Lattner authored
This allows us to dump: typedef short S; int test(S X, long long Y) { return X < ((100)); } as: typedef short S; int test(S X, long long Y) (CompoundStmt 0x2905d40 (ReturnStmt 0x2905d30 (BinaryOperator 0x2905d10 'int' '<' (ImplicitCastExpr 0x2905d00 'int' (DeclRefExpr 0x2905c80 'S':'short' Decl='X' 0x2905c20)) (ParenExpr 0x2905ce0 'int' (ParenExpr 0x2905cc0 'int' (IntegerLiteral 0x2905ca0 'int' 100)))))) llvm-svn: 40956
-
Chris Lattner authored
the AST in a structural, non-pretty, form useful for understanding the AST. It isn't quite done yet, but is already somewhat useful. For this example: int test(short X, long long Y) { return X < ((100)); } we get (with -parse-ast-dump): int test(short X, long long Y) (CompoundStmt 0x2905ce0 (ReturnStmt 0x2905cd0 (BinaryOperator 0x2905cb0 '<' (ImplicitCastExpr 0x2905ca0 (DeclRefExpr 0x2905c20 Decl='X' 0x2905bb0)) (ParenExpr 0x2905c80 (ParenExpr 0x2905c60 (IntegerLiteral 0x2905c40 100)))))) llvm-svn: 40954
-
Steve Naroff authored
llvm-svn: 40951
-
- Aug 08, 2007
-
-
Chris Lattner authored
EmitUsualArithmeticConversions. llvm-svn: 40931
-
Steve Naroff authored
it is used by "tgmath.h" (so we need to support it). It might also come in handy when developing the overloaded function macros for OpenCU. Next check-in will make this an integer constant expression... llvm-svn: 40930
-
Chris Lattner authored
EmitExprWithUsualUnaryConversions. llvm-svn: 40929
-
Steve Naroff authored
Move the function/array conversion for ParmVarDecl's from Sema::ParseIdentifierExpr() to Sema::ParseParamDeclarator(). After discussing this with Chris, we decided this approach has more immediate benefit (though we loose some information in the AST). The comment below should describe more (if interested). llvm-svn: 40907
-
- Aug 07, 2007
-
-
Chris Lattner authored
llvm-svn: 40901
-
- Aug 05, 2007
-
-
Steve Naroff authored
Remove a space from "typeof" printing. It was causing the following error... [dylan:clang/test/Parser] admin% ../../../../Debug/bin/clang -parse-ast-check typeof.c Warnings expected but not seen: Line 21: incompatible types assigning 'typeof(*pi) const' to 'int *' Warnings seen but not expected: Line 21: incompatible types assigning 'typeof(*pi) const' to 'int *' Also corrected a typo from my previous commit. llvm-svn: 40832
-
Steve Naroff authored
Make sure the good old "function/array conversion" is done to function parameters. This resulted in the following error... [dylan:clang/test/Parser] admin% cat parmvardecl_conversion.c // RUN: clang -parse-ast-check %s void f (int p[]) { p++; } [dylan:clang/test/Parser] admin% clang -parse-ast-check parmvardecl_conversion.c Errors seen but not expected: Line 3: cannot modify value of type 'int []' With this fix, the test case above succeeds. llvm-svn: 40831
-
- Aug 04, 2007
-
-
Chris Lattner authored
struct X { int A; }; void foo() { struct X s; int i; i = __builtin_choose_expr(0, s, i); } compiles to: %tmp = load i32* %i ; <i32> [#uses=1] store i32 %tmp, i32* %i wow :) llvm-svn: 40801
-
Chris Lattner authored
llvm-svn: 40800
-
Chris Lattner authored
llvm-svn: 40799
-
Chris Lattner authored
llvm-svn: 40798
-
Steve Naroff authored
Chris suggested this, since it simplifies the code generator. If this features is needed (and we don't think it is), we can revisit. The following test case now produces an error. [dylan:~/llvm/tools/clang] admin% cat t.c typedef __attribute__(( ocu_vector_type(4) )) float float4; static void test() { float4 vec4; vec4.rg.g; vec4.rg[1]; } [dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang t.c t.c:8:12: error: vector component access limited to variables vec4.rg.g; ^~ t.c:9:12: error: vector component access limited to variables vec4.rg[1]; ^~~ 2 diagnostics generated. llvm-svn: 40795
-
- Aug 03, 2007
-
-
Steve Naroff authored
Implement __builtin_choose_expr. llvm-svn: 40794
-