summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
* Make ASTContext explicitly keep track of the declaration for the CDouglas Gregor2009-07-072-0/+12
| | | | | | | | | | | | | | | | | 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
* Introduce the notion of "Relocatable" precompiled headers, which are builtDouglas Gregor2009-07-073-54/+156
| | | | | | | | | | | | 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
* Update CMake files.Argyrios Kyrtzidis2009-07-061-1/+0
| | | | llvm-svn: 74864
* Move the 'ResolveLocationInAST' function from the Frontend library to the ↵Argyrios Kyrtzidis2009-07-061-332/+0
| | | | | | | | Index library. Also, cut down its comments; more comments will be added to ASTLocation. llvm-svn: 74860
* Move ASTLocation and DeclReferenceMap from the AST library to the Index library.Argyrios Kyrtzidis2009-07-061-1/+2
| | | | llvm-svn: 74859
* Rename 'ASTNode' -> 'ASTLocation'.Argyrios Kyrtzidis2009-07-061-4/+4
| | | | | | ASTLocation is a much better name for its intended purpose which to represent a "point" into the AST. llvm-svn: 74858
* Fix PR 4489, a crash in PCH loading that occurs when loading the nameDouglas Gregor2009-07-062-20/+81
| | | | | | | | | | 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
* Keep track of the Expr used to describe the size of an array type,Douglas Gregor2009-07-062-2/+49
| | | | | | from Enea Zaffanella! llvm-svn: 74831
* Avoid re-checking the parameters of a function, when trying to resolve a ↵Argyrios Kyrtzidis2009-07-051-5/+12
| | | | | | location. llvm-svn: 74799
* Make use of ASTNode for return value of clang::ResolveLocationInAST() and in ↵Argyrios Kyrtzidis2009-07-051-4/+4
| | | | | | the index-test tool. llvm-svn: 74798
* Do an early check for function definition.Argyrios Kyrtzidis2009-07-051-10/+12
| | | | llvm-svn: 74796
* Add support for retrieving the Doxygen comment associated with a givenDouglas Gregor2009-07-022-3/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix PR 4489, a PCH crash during de-serialization.Douglas Gregor2009-07-012-2/+0
| | | | llvm-svn: 74664
* Update for changes in LLVM. Hopefully this is the last one for a while.Owen Anderson2009-07-011-2/+2
| | | | llvm-svn: 74657
* Hold the LLVMContext by reference instead of by pointer.Owen Anderson2009-07-011-2/+2
| | | | llvm-svn: 74642
* Add header search path for Gentoo stable, x86_64 version.Sebastian Redl2009-07-011-0/+8
| | | | llvm-svn: 74626
* Update for LLVMContext+Module change.Owen Anderson2009-07-011-4/+7
| | | | llvm-svn: 74615
* Fix for PR4192: fix the definition of int64_t on x86_64 Linux.Eli Friedman2009-07-011-1/+1
| | | | | | | | | | | | | 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
* remove dead code.Zhongxing Xu2009-06-301-2/+0
| | | | llvm-svn: 74517
* De-ASTContext-ify DeclContext.Argyrios Kyrtzidis2009-06-307-96/+71
| | | | | | | 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
* Remove the ASTContext parameter from the getBody() methods of Decl and ↵Argyrios Kyrtzidis2009-06-306-12/+12
| | | | | | | | subclasses. Timings showed no significant difference before and after the commit. llvm-svn: 74504
* Remove the ASTContext parameter from the printing related methods of Decl.Argyrios Kyrtzidis2009-06-302-4/+4
| | | | llvm-svn: 74503
* Remove the ASTContext parameter from the attribute-related methods of Decl.Argyrios Kyrtzidis2009-06-302-2/+2
| | | | | | | | | 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
* Key decisions about 'bool' vs '_Bool' to be based on a new flag in langoptions.Chris Lattner2009-06-304-8/+13
| | | | | | | | | | | | 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
* Make the StackProtector bitfield use enums instead of obscure numbers.Bill Wendling2009-06-281-2/+2
| | | | llvm-svn: 74414
* Add stack protector support to clang. This generates the 'ssp' and 'sspreq'Bill Wendling2009-06-281-1/+6
| | | | | | | | 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
* Implement enough of the 'auto' keyword so we can claim to support N2546.Anders Carlsson2009-06-261-0/+3
| | | | llvm-svn: 74307
* OpenCL 1.0 support: attributesNate Begeman2009-06-262-0/+14
| | | | llvm-svn: 74280
* Introduce a new concept to the static analyzer: SValuator.Ted Kremenek2009-06-261-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Write/Read new Language OptionsNate Begeman2009-06-252-0/+4
| | | | llvm-svn: 74221
* PCH support for OpenCL language optionsNate Begeman2009-06-251-0/+2
| | | | llvm-svn: 74220
* Introduce the ResolveLocationInAST function which takes an ASTContext and a ↵Argyrios Kyrtzidis2009-06-252-0/+323
| | | | | | | | | | | 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
* Handle PCHReader::IgnorePCH, it gets returned for when the file does not exist.Argyrios Kyrtzidis2009-06-251-5/+1
| | | | llvm-svn: 74196
* Add missing dependencies to the CMake build systemDouglas Gregor2009-06-251-1/+4
| | | | llvm-svn: 74162
* Add a DecltypeType type.Anders Carlsson2009-06-242-1/+9
| | | | llvm-svn: 74099
* Update CMakeLists.txtArgyrios Kyrtzidis2009-06-231-0/+1
| | | | llvm-svn: 74011
* Fix some TableGen-related dependencies for the Clang CMake buildDouglas Gregor2009-06-231-1/+1
| | | | llvm-svn: 73976
* switch Warnings.cpp to use the diagnostics machinery to print diagnostics, ↵Chris Lattner2009-06-231-1/+3
| | | | | | | | | | | | | | not *fprintf*! 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
* __APPLE_CC__ should only be set when building for darwin targets.Chris Lattner2009-06-231-1/+0
| | | | llvm-svn: 73934
* Add the license part to the new source files.Argyrios Kyrtzidis2009-06-201-0/+13
| | | | llvm-svn: 73825
* Serialize FunctionDecl's EndRangeLoc out to the PCH file.Argyrios Kyrtzidis2009-06-202-0/+2
| | | | llvm-svn: 73822
* Introduce the ASTUnit class.Argyrios Kyrtzidis2009-06-201-0/+146
| | | | | | ASTUnit is a helper class to allow easy loading of an ASTContext from a PCH file. No users for now. llvm-svn: 73819
* Added writing and reading of the ConstQualAdded flag ofFariborz Jahanian2009-06-202-0/+2
| | | | | | BlockDeclRefExpr to PCH. llvm-svn: 73800
* Keep track of when declarations are "used" according to C andDouglas Gregor2009-06-192-0/+4
| | | | | | | | | | | | C++. This logic is required to trigger implicit instantiation of function templates and member functions of class templates, which will be implemented separately. This commit includes support for -Wunused-parameter, printing warnings for named parameters that are not used within a function/Objective-C method/block. Fixes <rdar://problem/6505209>. llvm-svn: 73797
* Fix bug in the new PCHReader constructor. PP and Context should be ↵Argyrios Kyrtzidis2009-06-191-1/+1
| | | | | | initialized to 0. llvm-svn: 73762
* Make changes to PCHReader to allow reading a PCH file without having a ↵Argyrios Kyrtzidis2009-06-191-341/+458
| | | | | | | | | | pre-initialized Preprocessor. -Introduce 'PCHReaderListener' which is an abstract interface for getting various information from the PCHReader. -If PCHReader is constructed without a Preprocessor, it can still load the file and invoke the callbacks of PCHReaderListener. -If PCHReader is constructed with an initialized Preprocessor, PCHValidator is used as a PCHReaderListener to validate the contents of the PCH file against the given Preprocessor. llvm-svn: 73741
* Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.Douglas Gregor2009-06-182-2/+2
| | | | llvm-svn: 73702
* Add some missing CMake dependenciesDouglas Gregor2009-06-181-0/+2
| | | | llvm-svn: 73700
* Move CXXMethodDecl::OutOfLineDefinition into Decl::OutOfLine.Argyrios Kyrtzidis2009-06-171-4/+4
| | | | llvm-svn: 73651
* First step toward fixing <rdar://problem/6613046> refactor clang objc type ↵Steve Naroff2009-06-174-8/+12
| | | | | | | | | | | | representation. Add a type (ObjCObjectPointerType) and remove a type (ObjCQualifiedIdType). This large/tedious patch is just a first step. Next step is to remove ObjCQualifiedInterfaceType. After that, I will remove the magic TypedefType for 'id' (installed by Sema). This work will enable various simplifications throughout clang (when dealing with ObjC types). No functionality change. llvm-svn: 73649
OpenPOWER on IntegriCloud