summaryrefslogtreecommitdiffstats
path: root/clang/AST/StmtPrinter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-854/+0
| | | | | | | | | | lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
* add parsing, ast building and pretty printing support for C++ throw expressions.Chris Lattner2008-02-261-0/+9
| | | | | | Patch by Mike Stump! llvm-svn: 47582
* Patch from Argiris Kirtzidis:Ted Kremenek2008-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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
* Implement first round of feedback on __builtin_overloadNate Begeman2008-01-301-2/+2
| | | | llvm-svn: 46572
* Fixed misc. issues raised by Chris L. on @synchronized implementation.Fariborz Jahanian2008-01-301-7/+4
| | | | llvm-svn: 46558
* Bunch of type defs, etc. for @synchronized.Fariborz Jahanian2008-01-291-0/+11
| | | | llvm-svn: 46520
* Implement basic overload support via a new builtin, __builtin_overload.Nate Begeman2008-01-171-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | __builtin_overload takes 2 or more arguments: 0) a non-zero constant-expr for the number of arguments the overloaded functions will take 1) the arguments to pass to the matching overloaded function 2) a list of functions to match. The return type of __builtin_overload is inferred from the function whose args match the types of the arguments passed to the builtin. For example: float a; float sinf(float); int sini(int); float b = __builtin_overload(1, a, sini, sinf); Says that we are overloading functions that take one argument, and trying to pass an argument of the same type as 'a'. sini() does not match since it takes and argument of type int. sinf does match, so at codegen time this will turn into float b = sinf(a); llvm-svn: 46132
* Substituted all instances of the string "Objc" for "ObjC". This fixesTed Kremenek2008-01-071-9/+9
| | | | | | | some naming inconsistencies in the names of classes pertaining to Objective-C support in clang. llvm-svn: 45715
* New declarations/defs for Objc2's foreach-statement. This is work in progress.Fariborz Jahanian2008-01-021-0/+19
| | | | llvm-svn: 45511
* Don't attribute in file headers anymore. See llvmdev for theChris Lattner2007-12-291-2/+2
| | | | | | discussion of this change. llvm-svn: 45410
* Removed dependence on #including iostream.Ted Kremenek2007-11-261-3/+2
| | | | llvm-svn: 44338
* Fixed StmtPrinter to handle GCC extension to the ternary operator "?:" whereTed Kremenek2007-11-261-3/+10
| | | | | | the LHS subexpression can be NULL. Patch provided by Nuno Lopes! llvm-svn: 44328
* Keep track of whether the asm is volatile or not.Anders Carlsson2007-11-231-1/+6
| | | | llvm-svn: 44297
* Store output and input operands as well as clobber information in the ↵Anders Carlsson2007-11-221-0/+51
| | | | | | AsmStmt. Ted, could you please review the serialization/deserialization code? llvm-svn: 44266
* Store inline asm code in the AST.Anders Carlsson2007-11-201-1/+3
| | | | llvm-svn: 44255
* Make sure Sema::ParsedFreeStandingDeclSpec() returns a decl representing the ↵Steve Naroff2007-11-171-1/+9
| | | | | | | | type. Adding basic printing to StmtPrinter::PrintRawDecl(). llvm-svn: 44208
* Patch to do statically typed ivar references.Fariborz Jahanian2007-11-121-0/+4
| | | | llvm-svn: 44028
* Implement instance variable references.Steve Naroff2007-11-121-0/+4
| | | | llvm-svn: 44016
* AST for objective-c's @throw statement and its pretty-printing.Fariborz Jahanian2007-11-071-0/+9
| | | | llvm-svn: 43802
* Fixed a pretty-printer bug whereby a @try statement with no @finally seg ↵Fariborz Jahanian2007-11-071-5/+4
| | | | | | faulted. llvm-svn: 43798
* pretty-print @try/@catch/@finally from AST as the validation of AST.Fariborz Jahanian2007-11-021-3/+31
| | | | llvm-svn: 43649
* Bunch of class declarations for objective-c's @try-catch statement.Fariborz Jahanian2007-11-011-0/+12
| | | | llvm-svn: 43623
* Implement *skeletal* support for representing GNU inline asm stmts in the AST,Chris Lattner2007-10-291-0/+5
| | | | | | | resolving a crash on a .i file in PR1750. We now generate 49 errors on the .i file in that bug. llvm-svn: 43433
* remove extraneous space in @selector()Chris Lattner2007-10-181-9/+3
| | | | llvm-svn: 43110
* Fixed includes of "clang/AST/DeclObjC.h" to work on case-sensitiveTed Kremenek2007-10-171-1/+1
| | | | | | | filesystems (was "#include "clang/AST/DeclObjc.h", which worked fine on a case-insensitive HFS+ volume on the Mac). llvm-svn: 43080
* Implementation of AST for @protocol expression.Fariborz Jahanian2007-10-171-0/+7
| | | | llvm-svn: 43075
* Steve, pointer out that getName() is available for selectors. Made code much ↵Fariborz Jahanian2007-10-161-9/+1
| | | | | | smaller, thanks. llvm-svn: 43042
* Fix problem dumping/printing method names with null selector.Fariborz Jahanian2007-10-161-2/+8
| | | | llvm-svn: 43039
* Patch to implement AST generation for objective-c's @selector expression.Fariborz Jahanian2007-10-161-0/+12
| | | | llvm-svn: 43038
* Add code generation and sema checking for __builtin_va_arg.Anders Carlsson2007-10-151-0/+8
| | | | llvm-svn: 43006
* Add support for Pascal strings.Anders Carlsson2007-10-151-1/+1
| | | | llvm-svn: 42974
* move IdentifierTable.h from liblex to libbasic.Chris Lattner2007-10-071-1/+1
| | | | llvm-svn: 42730
* - Add ObjcInterfaceDecl::lookupInstanceMethod(), lookupClassMethod().Steve Naroff2007-10-021-4/+11
| | | | | | | | - Add ObjcMessageExpr::getSelector(), getClassName(). - Change Sema::getObjCInterfaceDecl() to simply take an IdentifierInfo (no Scope needed). - Remove FIXME for printing ObjCMessageExpr's. llvm-svn: 42543
* further apfloat'ize the front-end, allowing codegen to pass Chris Lattner2007-09-221-1/+1
| | | | | | APFloat straight through to LLVM now. llvm-svn: 42236
* Progress on message expressions...Steve Naroff2007-09-181-0/+11
| | | | | | | | | | | - Add ObjcMessageExpr AST node and associated constructors. - Add SourceLocation's to ActOnKeywordMessage/ActOnUnaryMessage API. - Instantiate message expressions... - Replace alloca usage with SmallString. Next step, installing a correct type, among other tweaks... llvm-svn: 42116
* pretty print some nodes more nicely.Chris Lattner2007-09-151-9/+28
| | | | llvm-svn: 41989
* Move Decl::NextDeclarator (w/ setters/getters) down to ScopedDecl/FieldDecl.Steve Naroff2007-09-131-1/+1
| | | | | | Decl is now svelte:-) llvm-svn: 41935
* get rid of ugly "warning: no newline at end of file"Gabor Greif2007-09-111-1/+1
| | | | | | warnings that some compilers diagnose llvm-svn: 41847
* Added "PrinterHelper" interface (include/AST/PrinterHelper) that canTed Kremenek2007-08-311-3/+19
| | | | | | | | | | | | | | | | be passed as an (optional) argument to StmtPrinter to customize printing of AST nodes. Used new PrinterHelper interface to enhance printing and visualization of CFGs. The CFGs now illustrate the semantic connectives between statements and terminators, wheras in the previous printing certain expressions would (visible) be printed multiple times to reflect which expressions used the results of other expressions. The end result is that the CFG is easier to read for flow of expression values (following principles similar to the LLVM IR). llvm-svn: 41651
* Add InitListExpr class.Anders Carlsson2007-08-311-0/+9
| | | | llvm-svn: 41636
* implement pretty printing of offsetofChris Lattner2007-08-301-0/+28
| | | | llvm-svn: 41615
* add a new ImaginaryLiteral AST node that is used toChris Lattner2007-08-261-0/+6
| | | | | | | | | | | | | | | | | | represent imaginary literals: float _Complex A; void foo() { A = 1.0iF; } generates: (BinaryOperator 0x2305ec0 '_Complex float' '=' (DeclRefExpr 0x2305e60 '_Complex float' Decl='A' 0x2305cf0) (ImaginaryLiteral 0x2305f40 '_Complex float' (FloatingLiteral 0x2305ea0 'float' 1.000000)))) llvm-svn: 41413
* Split the ASTNode out for compound assignments out from binary operators. NowChris Lattner2007-08-251-0/+5
| | | | | | they show up in dumps etc. llvm-svn: 41393
* Pretty print as:Chris Lattner2007-08-231-1/+14
| | | | | | | | "case sizeof x:" instead of: "case sizeofx:" llvm-svn: 41339
* Parse @encode expressions.Anders Carlsson2007-08-221-0/+5
| | | | llvm-svn: 41273
* Implement parsing and code generation of Objective-C string literals.Anders Carlsson2007-08-211-0/+6
| | | | llvm-svn: 41238
* Switch StmtVisitor from using dynamic to static dispatch. This makes it Chris Lattner2007-08-211-7/+7
| | | | | | | significantly faster and actually reduces the amount of code in the system. This also allows for future visitor changes. llvm-svn: 41211
* Modified ArraySubscriptExpr to have accessors getLHS and getRHS in additionTed Kremenek2007-08-201-2/+2
| | | | | | | | | | | | | 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
* move a switch to common code.Chris Lattner2007-08-091-10/+1
| | | | llvm-svn: 40967
* add a new AST dumper interface (E->dump()). This dumps outChris Lattner2007-08-081-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud