summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix indentation.Jordy Rose2011-08-201-17/+17
| | | | llvm-svn: 138211
* [analyzer] Move handling of hardcoded noreturn ("panic") methods from ↵Jordy Rose2011-08-202-38/+71
| | | | | | CFRefCount to NoReturnFunctionChecker. No functionality change intended. llvm-svn: 138210
* Typo spotted by Ivan Krasin.Chad Rosier2011-08-201-1/+1
| | | | llvm-svn: 138200
* [analyzer] Handle reads of ObjCPropertyRefExprs implicitly in Environment. ↵Ted Kremenek2011-08-203-7/+6
| | | | | | No need to bind an explicit value and create a new node. llvm-svn: 138196
* [analyzer] Simplify ExprEngine::VisitBinaryOperator() by removing recursive ↵Ted Kremenek2011-08-201-121/+113
| | | | | | visit to subexpressions (which is no longer needed). llvm-svn: 138195
* Start partitioning ExprEngine.cpp into separate .cpp files that handle ↵Ted Kremenek2011-08-205-1187/+1202
| | | | | | | | different parts of the analysis (e.g., analysis of C expressions, analysis of Objective-C expressions, and so on). llvm-svn: 138194
* Rename CXXExprEngine.cpp to ExprEngineCXX.cpp.Ted Kremenek2011-08-202-2/+2
| | | | llvm-svn: 138193
* Make the loading of multiple records for the same identifier (fromDouglas Gregor2011-08-201-1/+3
| | | | | | | | | | different modules) more robust. It already handled (simple) merges of the set of declarations attached to that identifier, so add a test case that shows us getting two different declarations for the same identifier (one struct, one function) from different modules, and are able to use both of them. llvm-svn: 138189
* Clean out some minor cruft in the AST reader; no functionality change.Douglas Gregor2011-08-201-2/+0
| | | | llvm-svn: 138188
* Introduce a module visitation function that starts at the top-levelDouglas Gregor2011-08-201-19/+116
| | | | | | | | | | | | | | | | | modules (those that no other module depends on) and performs a search over all of the modules, visiting a new module only when all of the modules that depend on it have already been visited. The visitor can abort the search for all modules that a module depends on, which allows us to minimize the number of lookups necessary when performing a search. Switch identifier lookup from a linear walk over the set of modules to this module visitation operation. The behavior is the same for simple PCH and chained PCH, but provides the proper search order for modules. Verified with printf debugging, since we don't have enough in place to actually test this. llvm-svn: 138187
* Static Analyzer Diagnostics: Move the responsibility for generating the ↵Anna Zaks2011-08-203-65/+100
| | | | | | endOfPath diagnostic piece from BugReport to BugReporterVisitor. Switch CFRefCount to use visitors in order to generate the endOfPath piece. llvm-svn: 138184
* Remove dead code.Ted Kremenek2011-08-202-25/+1
| | | | llvm-svn: 138183
* Static Analyzer Diagnostics: Switch CFRefCount to using the new visitor API. ↵Anna Zaks2011-08-192-22/+34
| | | | | | BugReport no longer needs to inherit from BugReporterVisitor. llvm-svn: 138142
* For assigning SourceLocations to macro arg tokens, reserve a single SLocEntryArgyrios Kyrtzidis2011-08-191-22/+69
| | | | | | | | | | | | | | for tokens that are lexed consecutively from the same FileID, instead of creating a SLocEntry for each token. e.g for assert(foo == bar); there will be a single SLocEntry for the "foo == bar" chunk and locations for the 'foo', '==', 'bar' tokens will point inside that chunk. For parsing SemaExpr.cpp, this reduced the number of SLocEntries by 25%. llvm-svn: 138129
* Rename TokenLexer::getMacroExpansionLocation -> ↵Argyrios Kyrtzidis2011-08-191-8/+10
| | | | | | getExpansionLocForMacroDefLoc, no functionality change. llvm-svn: 138128
* Refactor common functionality into SourceManager::getFileIDSize, no ↵Argyrios Kyrtzidis2011-08-191-14/+1
| | | | | | functionality change. llvm-svn: 138127
* Static Analyzer Diagnostics: Kill the addVisitorCreator(callbackTy, void*) ↵Anna Zaks2011-08-1918-360/+255
| | | | | | | | | | | | API in favor of addVisitor(BugReporterVisitor*). 1) Create a header file to expose the predefined visitors. And move the parent(BugReporterVisitor) there as well. 2) Remove the registerXXXVisitor functions - the Visitor constructors/getters can be used now to create the object. One exception is registerVarDeclsLastStore(), which registers more then one visitor, so make it static member of FindLastStoreBRVisitor. 3) Modify all the checkers to use the new API. llvm-svn: 138126
* Remove unused function ModuleManager::exportLookup()Douglas Gregor2011-08-191-10/+0
| | | | llvm-svn: 138079
* Improve the correctness and accuracy of the message for ↵Matt Beaumont-Gay2011-08-191-10/+13
| | | | | | -Wdynamic-class-memaccess llvm-svn: 138074
* objc-arc: @property definitions should default to (strong) when notFariborz Jahanian2011-08-191-7/+14
| | | | | | specified. // rdar://9971982 llvm-svn: 138062
* Revers r138040. Need to look at a few buildbot failures.Fariborz Jahanian2011-08-197-138/+106
| | | | llvm-svn: 138049
* objective-c: Bring objective-c handling of decl contextFariborz Jahanian2011-08-197-106/+138
| | | | | | | | | | to modernity. Instead of passing down individual context objects from parser to sema, establish decl context in parser and have sema access current context as needed. I still need to take of Doug's comment for minor cleanups. llvm-svn: 138040
* Reflow code. No functionality change.Benjamin Kramer2011-08-191-7/+8
| | | | llvm-svn: 138032
* Warn about and truncate UCNs that are too big for their character literal type.Craig Topper2011-08-191-5/+5
| | | | llvm-svn: 138031
* Teach ModuleManager::addModule() to check whether a particular moduleDouglas Gregor2011-08-191-38/+66
| | | | | | | | | | | | | | | | | | has already been loaded before allocating a new Module structure. If the module has already been loaded (uniquing based on file name), then just return the existing module rather than trying to load it again. This allows us to load a DAG of modules. Introduce a simple test case that forms a diamond-shaped module graph, and illustrates that a source file importing the bottom of the diamond can see declarations in all four of the modules that make up the diamond. Note that this version moves the file-opening logic into the module manager, rather than splitting it between the module manager and the AST reader. More importantly, it properly handles the weird-but-possibly-useful case of loading an AST file from "-". llvm-svn: 138030
* Fix a memory leak in the analyzer - BugReports didn't get freed. Plus, ↵Anna Zaks2011-08-191-4/+14
| | | | | | remove invalid assert from the destructor which wasn't called previously due to the leak. llvm-svn: 138027
* Fix the rest of the indent goofiness here.Chandler Carruth2011-08-191-3/+3
| | | | llvm-svn: 138024
* Fix an egregious formatting goof.Chandler Carruth2011-08-191-19/+19
| | | | llvm-svn: 138023
* Add a completely hacky workaround for pch kext files with different extensionsEric Christopher2011-08-191-18/+24
| | | | | | | | when falling back to cc1plus for our compile. rdar://9963920 llvm-svn: 138017
* Enhance -Wstrl-incorrect-size to not report a FIXIT for destinations that ↵Ted Kremenek2011-08-181-10/+18
| | | | | | are flexible arrays or have size 1. llvm-svn: 138004
* Static Analyzer Diagnostics: Move custom diagnostic visitors from ↵Anna Zaks2011-08-183-69/+82
| | | | | | | | BugReporterContext to BugReport. One API change: I added BugReporter as an additional parameter to the BugReporterVisitor::VisitNode() method to allow visitors register other visitors with the report on the fly (while processing a node). This functionality is used by NilReceiverVisitor, which registers TrackNullOrUndefValue when the receiver is null. llvm-svn: 138001
* Don't accept a typo correction if the corrected identifier is the same as theKaelyn Uhrain2011-08-181-1/+2
| | | | | | uncorrected identifier. Fixes a problem pointed out by Eli. llvm-svn: 137987
* Reapply r137903, but fix the definition of size_t in the test case to use ↵Ted Kremenek2011-08-181-1/+96
| | | | | | | | __SIZE_TYPE__ (and hence be portable). Also, change the warning to -Wstrl-incorrect-size. llvm-svn: 137980
* [libclang] Support code-completion inside macro arguments.Argyrios Kyrtzidis2011-08-182-4/+19
| | | | llvm-svn: 137973
* Temporarily revert r137925 to appease buildbots. Original commit message:Chad Rosier2011-08-181-39/+14
| | | | | | | | | | | | | | Teach ModuleManager::addModule() to check whether a particular module has already been loaded before allocating a new Module structure. If the module has already been loaded (uniquing based on file name), then just return the existing module rather than trying to load it again. This allows us to load a DAG of modules. Introduce a simple test case that forms a diamond-shaped module graph, and illustrates that a source file importing the bottom of the diamond can see declarations in all four of the modules that make up the diamond. llvm-svn: 137971
* Rework DiagnoseInvalidRedeclaration to add the ability to correct typos whenKaelyn Uhrain2011-08-181-23/+69
| | | | | | diagnosing invalid function redeclarations. llvm-svn: 137966
* Use StringRef, rather than C string APIs.Chad Rosier2011-08-181-5/+6
| | | | llvm-svn: 137958
* Add support for MSVC __unaligned attribute. Necessary to parse MSVC headers ↵Francois Pichet2011-08-182-3/+13
| | | | | | | | in 64-bit mode (ie: when _M_IA64 or _M_AMD64 is defined) more info: http://msdn.microsoft.com/en-us/library/ms177389.aspx llvm-svn: 137935
* Always mark friend function declarations in class templates asChandler Carruth2011-08-181-3/+7
| | | | | | | | | | | implicitly instantiable, even if we don't see a body on the friend function declaration. The body may simply have not yet been attached. This fixes PR10666. There may be an alternate, preferred implementation strategy, see my FIXME. Review would definitely be appreciated Doug. =D llvm-svn: 137934
* Teach ModuleManager::addModule() to check whether a particular moduleDouglas Gregor2011-08-181-14/+39
| | | | | | | | | | | | | has already been loaded before allocating a new Module structure. If the module has already been loaded (uniquing based on file name), then just return the existing module rather than trying to load it again. This allows us to load a DAG of modules. Introduce a simple test case that forms a diamond-shaped module graph, and illustrates that a source file importing the bottom of the diamond can see declarations in all four of the modules that make up the diamond. llvm-svn: 137925
* Keep track of which modules have been loaded directly (e.g., viaDouglas Gregor2011-08-182-27/+36
| | | | | | | | | | | | | -import-module) vs. loaded because some other module depends on them. As part of doing this, pass down the module that caused a module to be loaded directly, rather than assuming that we're loading a chain. Finally, write out all of the directly-loaded modules when serializing an AST file (using the new IMPORTS record), so that an AST file can depend on more than one other AST file, all of which will be loaded when that AST file is loaded. This allows us to form and load a tree of modules, but we can't yet load a DAG of modules. llvm-svn: 137923
* Revert r137903, "Add experimental -Wstrlcpy-size warning that looks to see ↵Ted Kremenek2011-08-181-96/+1
| | | | | | | | if the size argument for strlcpy/strlcat is the size of the *source*, and not the size of the *destination*. This warning is off by default (for now)." This currently doesn't work on Windows. llvm-svn: 137920
* No seriously, remove the unsupported warning options.Chad Rosier2011-08-181-1/+1
| | | | llvm-svn: 137918
* Remove the last FIXMEs on -Wunused-comparison since it got moved toChandler Carruth2011-08-181-0/+4
| | | | | | | entirely use the existing -Wunused-value infrastructure. This also fixes a few missed cases for -Wunused in general. llvm-svn: 137916
* Fix off by one.Chad Rosier2011-08-181-1/+1
| | | | llvm-svn: 137915
* [driver] Implement in a more table-like manner and add many more warning optionsChad Rosier2011-08-181-5/+99
| | | | | | | that aren't handled by llvm-gcc on fallback. Enhancement to rdar://9964354 llvm-svn: 137912
* Implement '-Weverything', which enables all warnings except those explicitly ↵Ted Kremenek2011-08-183-7/+28
| | | | | | | | | | | | | | mapped to be ignored. Currently this includes -pedantic warnings as well; we'll need to consider whether these should be included. This works as expected with -Werror. Test cases were added to Sema/warn-unused-parameters.c, but they should probably be broken off into their own test file. llvm-svn: 137910
* For the MacroExpands preprocessor callback, also pass the SourceRangeArgyrios Kyrtzidis2011-08-183-8/+12
| | | | | | of expansion (for function macros it includes the right paren). llvm-svn: 137909
* Add some more options that aren't handled by llvm-gcc on fallback.Eric Christopher2011-08-181-1/+5
| | | | | | This is going to be made a table. llvm-svn: 137907
* [driver] Don't generate diagnostics (i.e., preprocessed source) if reading Chad Rosier2011-08-181-2/+14
| | | | | | | from stdin. This allows Eli and the like to continue with their debugging trickery without loss of limb (or car) on my part. :) llvm-svn: 137906
OpenPOWER on IntegriCloud