- Jul 11, 2009
-
-
Steve Naroff authored
The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches. This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic. By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time. Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks. llvm-svn: 75314
-
- Jul 08, 2009
-
-
Fariborz Jahanian authored
gc'able structs in the Next runtime and adds missing PCH info. llvm-svn: 75014
-
- Jul 07, 2009
-
-
Douglas Gregor authored
FILE type, rather than using name lookup to find FILE within the translation unit. Within precompiled headers, FILE is treated as yet another "special type" (like __builtin_va_list). This change should provide a performance improvement (not verified), since the lookup into the translation unit declaration forces the (otherwise unneeded) construction of a large hash table. More importantly, with precompiled headers, the construction of that table requires deserializing most of the top-level declarations from the precompiled header, which are then unused. Fixes PR 4509. llvm-svn: 74911
-
Douglas Gregor authored
with a particular system root directory and can be used with a different system root directory when the headers it depends on have been installed. Relocatable precompiled headers rewrite the file names of the headers used when generating the PCH file into the corresponding file names of the headers available when using the PCH file. Addresses <rdar://problem/7001604>. llvm-svn: 74885
-
- Jul 06, 2009
-
-
Argyrios Kyrtzidis authored
llvm-svn: 74864
-
Argyrios Kyrtzidis authored
Also, cut down its comments; more comments will be added to ASTLocation. llvm-svn: 74860
-
Argyrios Kyrtzidis authored
llvm-svn: 74859
-
Argyrios Kyrtzidis authored
ASTLocation is a much better name for its intended purpose which to represent a "point" into the AST. llvm-svn: 74858
-
Douglas Gregor authored
of a top-level declaration loads another top-level declaration of the same name whose type depends on the first declaration having been completed. This commit breaks the circular dependency by delaying loads of top-level declarations triggered by loading a name until we are no longer recursively loading types or declarations. llvm-svn: 74847
-
Douglas Gregor authored
from Enea Zaffanella! llvm-svn: 74831
-
Argyrios Kyrtzidis authored
llvm-svn: 74799
-
Argyrios Kyrtzidis authored
llvm-svn: 74798
-
Argyrios Kyrtzidis authored
llvm-svn: 74796
-
- Jul 02, 2009
-
-
Douglas Gregor authored
declaration in the AST. The new ASTContext::getCommentForDecl function searches for a comment that is attached to the given declaration, and returns that comment, which may be composed of several comment blocks. Comments are always available in an AST. However, to avoid harming performance, we don't actually parse the comments. Rather, we keep the source ranges of all of the comments within a large, sorted vector, then lazily extract comments via a binary search in that vector only when needed (which never occurs in a "normal" compile). Comments are written to a precompiled header/AST file as a blob of source ranges. That blob is only lazily loaded when one requests a comment for a declaration (this never occurs in a "normal" compile). The indexer testbed now supports comment extraction. When the -point-at location points to a declaration with a Doxygen-style comment, the indexer testbed prints the associated comment block(s). See test/Index/comments.c for an example. Some notes: - We don't actually attempt to parse the comment blocks themselves, beyond identifying them as Doxygen comment blocks to associate them with a declaration. - We won't find comment blocks that aren't adjacent to the declaration, because we start our search based on the location of the declaration. - We don't go through the necessary hops to find, for example, whether some redeclaration of a declaration has comments when our current declaration does not. Similarly, we don't attempt to associate a \param Foo marker in a function body comment with the parameter named Foo (although that is certainly possible). - Verification of my "no performance impact" claims is still "to be done". llvm-svn: 74704
-
Douglas Gregor authored
llvm-svn: 74664
-
Owen Anderson authored
llvm-svn: 74657
-
- Jul 01, 2009
-
-
Owen Anderson authored
llvm-svn: 74642
-
Sebastian Redl authored
llvm-svn: 74626
-
Owen Anderson authored
llvm-svn: 74615
-
Eli Friedman authored
Note that I'm guessing that *BSD and Solaris do the same thing as Linux here, but it's quite possible I'm wrong; if the following testcase gives an error on x86-64 with gcc for any of those operating systems, please tell me: #include <stdint.h> int64_t x; long x; llvm-svn: 74583
-
- Jun 30, 2009
-
-
Zhongxing Xu authored
llvm-svn: 74517
-
Argyrios Kyrtzidis authored
Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating". Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit. llvm-svn: 74506
-
Argyrios Kyrtzidis authored
Timings showed no significant difference before and after the commit. llvm-svn: 74504
-
Argyrios Kyrtzidis authored
llvm-svn: 74503
-
Argyrios Kyrtzidis authored
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext. This commit touches a lot of files since call sites for these methods are everywhere. I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it. llvm-svn: 74501
-
Chris Lattner authored
This is simple enough, but then I thought it would be nice to make PrintingPolicy get a LangOptions so that various things can key off "bool" and "C++" independently. This spiraled out of control. There are many fixme's, but I think things are slightly better than they were before. One thing that can be improved: CFG should probably have an ASTContext pointer in it, which would simplify its clients. llvm-svn: 74493
-
- Jun 29, 2009
-
-
Bill Wendling authored
llvm-svn: 74414
-
- Jun 28, 2009
-
-
Bill Wendling authored
function attributes. There are predefined macros that are defined when stack protectors are used: __SSP__=1 with -fstack-protector and __SSP_ALL__=2 with -fstack-protector-all. llvm-svn: 74405
-
- Jun 26, 2009
-
-
Anders Carlsson authored
llvm-svn: 74307
-
Nate Begeman authored
llvm-svn: 74280
-
Ted Kremenek authored
GRTransferFuncs had the conflated role of both constructing SVals (symbolic expressions) as well as handling checker-specific logic. Now SValuator has the role of constructing SVals from expressions and GRTransferFuncs just handles checker-specific logic. The motivation is by separating these two concepts we will be able to much more easily create richer constraint-generating logic without coupling it to the main checker transfer function logic. We now have one implementation of SValuator: SimpleSValuator. SimpleSValuator is essentially the SVal-related logic that was in GRSimpleVals (which is removed in this patch). This includes the logic for EvalBinOp, EvalCast, etc. Because SValuator has a narrower role than the old GRTransferFuncs, the interfaces are much simpler, and so is the implementation of SimpleSValuator compared to GRSimpleVals. I also did a line-by-line review of SVal-related logic in GRSimpleVals and cleaned it up while moving it over to SimpleSValuator. As a consequence of removing GRSimpleVals, there is no longer a '-checker-simple' option. The '-checker-cfref' did everything that option did but also ran the retain/release checker. Of course a user may not always wish to run the retain/release checker, nor do we wish core analysis logic buried in the checker-specific logic. The next step is to refactor the logic in CFRefCount.cpp to separate out these pieces into the core analysis engine. llvm-svn: 74229
-
Nate Begeman authored
llvm-svn: 74221
-
Nate Begeman authored
llvm-svn: 74220
-
- Jun 25, 2009
-
-
Argyrios Kyrtzidis authored
Introduce the ResolveLocationInAST function which takes an ASTContext and a SourceLocation and it resolves it into a <Decl*, Stmt*> pair. Decl* is the declaration associated with this source location and Stmt* is the statement/expression that the location points to. If the location does not point to a statement node, Stmt* is null. ResolveLocationInAST (along with converting a file:line:column triplet to a SourceLocation) will be useful for an IDE client and for clang's test suite. llvm-svn: 74197
-
Argyrios Kyrtzidis authored
llvm-svn: 74196
-
Douglas Gregor authored
llvm-svn: 74162
-
- Jun 24, 2009
-
-
Anders Carlsson authored
llvm-svn: 74099
-
Argyrios Kyrtzidis authored
llvm-svn: 74011
-
- Jun 23, 2009
-
-
Douglas Gregor authored
llvm-svn: 73976
-
Chris Lattner authored
Among other things, this makes the warning about unknown warning options mappable. For example: $ clang t.c -Werror -Wfoo error: unknown warning option '-Wfoo' [-Wunknown-warning-option] For another thing, they are properly color coded now too :) llvm-svn: 73936
-