summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Adjust method calls to reflect name changes inTed Kremenek2010-11-2412-110/+117
| | | | | | | | | | ImmutableSet/ImmtuableMap/ImmutableList APIs. Along the way, clean up some method names in the static analyzer so that they are more descriptive and/or start with lowercase letters. llvm-svn: 120071
* The final result of all this refactoring: instead of doing stat immediatelyChris Lattner2010-11-232-6/+54
| | | | | | | | | | | | | followed by an open for every source file we open, probe the file system with 'open' and then do an fstat when it succeeds. open+fstat is faster than stat+open because the kernel only has to perform the string->inode mapping once. Presumably it gets faster the deeper in your filesystem a lookup happens. For -Eonly on cocoa.h, this reduces system time from 0.042s to 0.039s on my machine, a 7.7% speedup. llvm-svn: 120066
* Redeclarations of using declarations are not okay in function scopes.John McCall2010-11-231-2/+2
| | | | | | | | Not sure what I was thinking before. Fixes PR8668. llvm-svn: 120063
* if we succeed in opening a directory but expected a file, ensure we don'tChris Lattner2010-11-231-1/+22
| | | | | | leak a filedescriptor if a client ever starts returning one. llvm-svn: 120062
* hopefully resolve the windows buildbot issue (retch)Chris Lattner2010-11-231-0/+8
| | | | llvm-svn: 120061
* change the 'is directory' indicator to be a null-or-notChris Lattner2010-11-235-22/+56
| | | | | | | | | pointer that is passed down through the APIs, and make FileSystemStatCache::get be the one that filters out directory lookups that hit files. This also paves the way to have stat queries be able to return opened files. llvm-svn: 120060
* pull "is directory" handling into FileManager::getStatValueChris Lattner2010-11-231-29/+36
| | | | | | | which simplifies clients and is important for future directions. Add a FD member to FileEntry which isn't used but will be shortly. llvm-svn: 120056
* A few tweaks to the value-kind computation:John McCall2010-11-233-73/+88
| | | | | | | | | | | | | - Default argument expressions pick up the value kind of the incoming expression, not the value kind of the parameter it initializes. - When building a template argument for substitution, A::x is an rvalue if x is an instance method. - Anonymous struct/union paths pick up value kind the same way that normal member accesses do; extract out a common code path for this. Enable the value-kind assertion, now that it passes self-host. llvm-svn: 120055
* Remove static_casts from SemaDeclAttr.cppPeter Collingbourne2010-11-231-22/+22
| | | | llvm-svn: 120053
* tidy up code, add a comment about dir caching.Chris Lattner2010-11-231-20/+16
| | | | llvm-svn: 120048
* replicate a terrible hack to fix a build error on VC++Chris Lattner2010-11-231-0/+4
| | | | llvm-svn: 120039
* simplify the cache miss handling code, eliminating CacheMissing.Chris Lattner2010-11-234-18/+7
| | | | llvm-svn: 120038
* factor the "cache miss" handling code out of FM into a static Chris Lattner2010-11-231-21/+6
| | | | | | method in FileSystemStatCache. llvm-svn: 120037
* r120013 dropped passing in the precomputed file size to Chris Lattner2010-11-232-3/+3
| | | | | | | MemoryBuffer::getFile, causing us to pick up a fstat for every file. Restore the optimization. llvm-svn: 120032
* PCH files only cache successful stats. Remove the code that reads/writes Chris Lattner2010-11-233-32/+13
| | | | | | the result code of the stat to/from the PCH file since it is always 0. llvm-svn: 120031
* rework the stat cache, pulling it out of FileManager.h intoChris Lattner2010-11-238-74/+129
| | | | | | | its own header and giving it some more structure. No functionality change. llvm-svn: 120030
* tidy up. Split FileManager::getBufferForFile intoChris Lattner2010-11-233-12/+18
| | | | | | | | | | two copies, since they are fundamentally different operations and the StringRef one should go away (it shouldn't be part of FileManager at least). Remove some dead arguments. llvm-svn: 120013
* don't allow remapping PTH file paths with -fworking-directory, theChris Lattner2010-11-232-4/+3
| | | | | | client should just pass in absolute paths. llvm-svn: 120012
* reduce indentation and use early outs, to make it easier to readChris Lattner2010-11-231-72/+79
| | | | | | this code. no functionality change. llvm-svn: 120011
* now the FileManager has a FileSystemOpts ivar, stop threadingChris Lattner2010-11-2316-123/+74
| | | | | | | | | FileSystemOpts through a ton of apis, simplifying a lot of code. This also fixes a latent bug in ASTUnit where it would invoke methods on FileManager without creating one in some code paths in cindextext. llvm-svn: 120010
* give FileManager a 'FileSystemOptions' ivar, which will be usedChris Lattner2010-11-234-12/+12
| | | | | | | to simplify a bunch of code in it. It should ultimately get inlined into FileManager. llvm-svn: 120007
* Partially revert Doug's PCH validation patch (r98585).Chris Lattner2010-11-233-22/+9
| | | | | | | | | | | | | | | | | | | | | | This patch completely defeated the "passing in a prestat'd size to MemoryBuffer" optimization, leading to an extra fstat call for every buffer opened, in order to find out if the datestamp and size of the file on disk matches what is in the stat cache. I fully admit that I don't completely understand what is going on here: why punish code when a stat cache isn't in use? what is the point of a stat cache if you have to turn around and stat stuff to validate it? To resolve both these issues, just drop the modtime check and check the file size, which is the important thing anyway. This should also resolve PR6812, because presumably windows is stable when it comes to file sizes. If the modtime is actually important, we should get it and keep it on the first stat. This eliminates 833 fstat syscalls when processing Cocoa.h, speeding up system time on -Eonly Cocoa.h from 0.041 to 0.038s. llvm-svn: 120001
* Microsoft C anonymous struct implementation.Francois Pichet2010-11-231-29/+95
| | | | | | Documentation: http://msdn.microsoft.com/en-us/library/z2cx9y4f.aspx llvm-svn: 120000
* stringref'ize APIChris Lattner2010-11-231-18/+16
| | | | llvm-svn: 119997
* tidy upChris Lattner2010-11-231-4/+4
| | | | llvm-svn: 119996
* avoid creating sys::Path instances when -fworking-directory isn't being used.Chris Lattner2010-11-231-1/+8
| | | | llvm-svn: 119995
* Stylistic changes to CFG.cpp:Zhanyong Wan2010-11-221-24/+22
| | | | | | | | | | | 1. "no 'else' after 'return'" -- this is for conformance with the coding standards. 2. move 'else' to the line of the previous '}' -- this is for consistency. Reviewed by kremenek. llvm-svn: 119983
* Refactor the null-initialization for record types and make it handle bases ↵Anders Carlsson2010-11-221-75/+85
| | | | | | that aren't i8 arrays. llvm-svn: 119980
* Remove the other FIXME I added. This is covered by the Index test and not ↵Nico Weber2010-11-221-2/+0
| | | | | | testable via -ast-dump. llvm-svn: 119971
* Remove one I just added, add a more focused test for why the current code is ↵Nico Weber2010-11-221-2/+0
| | | | | | correct. llvm-svn: 119969
* Try to get the bots green after r119966.Nico Weber2010-11-222-4/+7
| | | | llvm-svn: 119968
* Fix the source range of CXXNewExprs. Fixes http://llvm.org/pr8661.Nico Weber2010-11-224-9/+12
| | | | llvm-svn: 119966
* Minor whitespace fix, no functionality changeNico Weber2010-11-221-3/+3
| | | | llvm-svn: 119965
* Fix PR8419. Reviewed by kremenek and xuzhongxing.Zhanyong Wan2010-11-221-0/+17
| | | | llvm-svn: 119960
* Undo part of my previous commit to mm_malloc.h, going back to the use ofChandler Carruth2010-11-222-13/+9
| | | | | | | | | | | | | | stdlib.h. There were numerous problems with forward declaring 'malloc' and 'free', but the most important is that these are reserved by POSIX and may be implemented via a function-like macro. As suggested by Dale Johannesen, I'm instead guarding the only include of this in our builtin headers with __STDC_HOSTED__, and I've removed the include of the header from the test suite. I'll discuss with folks whether we want to have a hosted section of the test suite or not, and add it (and perhaps other tests) back there if that's the direction. llvm-svn: 119958
* Remove FIXME; we don't ever want to lay out empty bases.Anders Carlsson2010-11-221-7/+6
| | | | llvm-svn: 119957
* Rename BaseLLVMType to NonVirtualBaseLLVMType.Anders Carlsson2010-11-212-7/+8
| | | | llvm-svn: 119956
* Add getCGRecordLayout helper function. No functionality change.Anders Carlsson2010-11-211-6/+13
| | | | llvm-svn: 119955
* The 'X' printf type has a valid alternative form. Fixes PR8641.Anders Carlsson2010-11-211-1/+2
| | | | llvm-svn: 119946
* Fix a bunch of IndirectFieldDecl-related warnings.Benjamin Kramer2010-11-212-4/+5
| | | | | | - Negative ChainingSize doesn't make sense, make it unsigned. llvm-svn: 119943
* Filename.rfind("/\\") won't give us the position of the last directory ↵Benjamin Kramer2010-11-211-11/+11
| | | | | | seperator. llvm-svn: 119939
* remove old compatibility APIs, use StringRef versions instead.Chris Lattner2010-11-213-16/+10
| | | | llvm-svn: 119935
* change the various getFile routines to use StringRef as their implementation ↵Chris Lattner2010-11-211-37/+32
| | | | | | form. llvm-svn: 119934
* Fix warning: enumeration value 'IndirectField' not handled in switch.Francois Pichet2010-11-211-0/+1
| | | | llvm-svn: 119924
* Major anonymous union/struct redesign.Francois Pichet2010-11-2111-112/+198
| | | | | | | | | | | A new AST node is introduced: def IndirectField : DDecl<Value>; IndirectFields are injected into the anonymous's parent scope and chain back to the original field. Name lookup for anonymous entities now result in an IndirectFieldDecl instead of a FieldDecl. There is no functionality change, the code generated should be the same. llvm-svn: 119919
* Forward the -fno-elide-constructor argument to clang -cc1. Fixes PR8652.Anders Carlsson2010-11-211-0/+6
| | | | llvm-svn: 119915
* Add comments.Zhongxing Xu2010-11-201-1/+2
| | | | llvm-svn: 119900
* Fix a typo in EnvironmentManager::bindExprAndLocation(). Reviewed by kremenek.Zhanyong Wan2010-11-201-1/+2
| | | | llvm-svn: 119899
* Handle CFGAutomaticObjDtor. Zhongxing Xu2010-11-203-1/+38
| | | | llvm-svn: 119897
* Revert r119838 "Don't warn for empty 'if' body if there is a macro that ↵Argyrios Kyrtzidis2010-11-207-34/+21
| | | | | | | | | | expands to nothing" and use a better and more general approach, where NullStmt has a flag to indicate whether it was preceded by an empty macro. Thanks to Abramo Bagnara for the hint! llvm-svn: 119887
OpenPOWER on IntegriCloud