summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* tests: Mark the /dev/fd test as requiring Darwin until I can test on other OSes.Daniel Dunbar2012-11-151-0/+3
| | | | llvm-svn: 168095
* [utils/ClangDataFormat.py] For invalid source locations just returnArgyrios Kyrtzidis2012-11-151-0/+6
| | | | | | "<invalid loc>" for summary. llvm-svn: 168087
* tests: Check that we can output to /dev/fd filesystem.Daniel Dunbar2012-11-151-1/+19
| | | | | | | - An LLVM unique_file() bug could cause us to infinite loop on the later test case. llvm-svn: 168082
* [analyzer] Fix a use-after-free introduced in r168019.Jordan Rose2012-11-151-4/+5
| | | | | | | | | | | | | | | | | | | | | | | In code like this: void foo() { bar(); baz(); } ...the location for the call to 'bar()' was being used as a backup location for the call to 'baz()'. This is fine unless the call to 'bar()' is deemed uninteresting and that part of the path deleted. (This looks like a logic error as well, but in practice the only way 'baz()' could have an invalid location is if the entire body of 'foo()' is synthesized, meaning the call to 'bar()' will be using the location of the call to 'foo()' anyway. Nevertheless, the new version better matches the intent of the code.) Found by Matt Beaumont-Gay using ASan. Thanks, Matt! llvm-svn: 168080
* tests: Add a test for reading from named pipes.Daniel Dunbar2012-11-152-0/+16
| | | | | | - Realized I could use the /dev/fd filesystem to make a simple portable test. llvm-svn: 168079
* If an excluded header does not exist, just ignore itDouglas Gregor2012-11-152-1/+4
| | | | llvm-svn: 168077
* [analyzer] Report leaks at the closing brace of a function body.Jordan Rose2012-11-1514-213/+180
| | | | | | | | | | | | | | | | | | | | This fixes a few cases where we'd emit path notes like this: +---+ 1| v p = malloc(len); ^ |2 +---+ In general this should make path notes more consistent and more correct, especially in cases where the leak happens on the false branch of an if that jumps directly to the end of the function. There are a couple places where the leak is reported farther away from the cause; these are usually cases where there are several levels of nested braces before the end of the function. This still matches our current behavior for when there /is/ a statement after all the braces, though. llvm-svn: 168070
* [analyzer] StreamChecker: Remove now-unnecessary check::EndPath callback.Jordan Rose2012-11-151-46/+1
| | | | | | | Also, don't bother to stop tracking symbols in the return value, either. They are now properly considered live during checkDeadSymbols. llvm-svn: 168069
* [analyzer] MacOSKeychainAPIChecker: Remove now-unnecessary check::EndPath.Jordan Rose2012-11-151-75/+0
| | | | | | | Also, don't bother to stop tracking symbols in the return value, either. They are now properly considered live during checkDeadSymbols. llvm-svn: 168068
* [analyzer] MallocChecker: Remove now-unnecessary check::EndPath callback.Jordan Rose2012-11-151-29/+1
| | | | | | | Also, don't bother to stop tracking symbols in the return value, either. They are now properly considered live during checkDeadSymbols. llvm-svn: 168067
* [analyzer] Mark symbol values as dead in the environment.Jordan Rose2012-11-157-184/+262
| | | | | | | | | | | | | | This allows us to properly remove dead bindings at the end of the top-level stack frame, using the ReturnStmt, if there is one, to keep the return value live. This in turn removes the need for a check::EndPath callback in leak checkers. This does cause some changes in the path notes for leak checkers. Previously, a leak would be reported at the location of the closing brace in a function. Now, it gets reported at the last statement. This matches the way leaks are currently reported for inlined functions, but is less than ideal for both. llvm-svn: 168066
* block extended signatur option. Change previous optionFariborz Jahanian2012-11-1511-12/+26
| | | | | | | | to a cc1 -fencode-extended-block-signature and pass it to cc1 and recognize this option to produce extended block type signature. // rdar://12109031 llvm-svn: 168063
* [modules] Use a memory buffer directly as input for the module includes,Argyrios Kyrtzidis2012-11-154-18/+23
| | | | | | instead of messing with virtual files. llvm-svn: 168062
* [modules] Setup the import location of a module file and use itArgyrios Kyrtzidis2012-11-157-17/+54
| | | | | | as the include location of the main file of an imported module. llvm-svn: 168061
* Comment to XML conversion: convert some tests to use the new [[@LINE]]Dmitri Gribenko2012-11-152-49/+49
| | | | | | FileCheck feature. This will hopefully make tests less fragile. llvm-svn: 168056
* Remove unused diagnostics from TableGen files.Dmitri Gribenko2012-11-153-6/+0
| | | | llvm-svn: 168055
* Simplify code. No functionality change.Benjamin Kramer2012-11-151-18/+12
| | | | llvm-svn: 168047
* Do not cache a pointer to ExprEvalContexts.back().Benjamin Kramer2012-11-151-7/+9
| | | | | | | | | | It may become a dangling pointer if the underlying SmallVector reallocates. Sadly the testcase is really large and doesn't reduce well because of SmallVector's reallocation patterns. Fixes PR14336. llvm-svn: 168045
* Use empty parens for empty function parameter list instead of '(void)'.Dmitri Gribenko2012-11-157-11/+11
| | | | llvm-svn: 168041
* [UBSan] Add support for building ubsan runtime library on Linux with 'make'. ↵Alexey Samsonov2012-11-151-5/+6
| | | | | | Clang part. llvm-svn: 168039
* Teach the uninitialized field warning about anonymous structs and union members.Nick Lewycky2012-11-152-9/+29
| | | | | | Fixes PR14073! llvm-svn: 168031
* Make -ffp-contract a codegen option, rather than a laguage option. This makesLang Hames2012-11-157-24/+25
| | | | | | | more sense anyway - it determines how expressions are codegen'd. It also ensures that -ffp-contract=fast has the intended effect when compiling LLVM IR. llvm-svn: 168027
* Revert r167567, restoring the ability of clang to run gcc in cases where itNick Lewycky2012-11-158-35/+804
| | | | | | can't handle the input file type. This resulted in PR14338. llvm-svn: 168024
* Fix an off-by-one error by switching < to <= in ↵Richard Trieu2012-11-152-1/+2
| | | | | | -Wtautological-constant-out-of-range-compare and added test case. llvm-svn: 168023
* Do not use data recursion in ASTMatchFinder.Daniel Jasper2012-11-152-0/+28
| | | | | | The matchers rely on the complete AST being traversed as shown by the new test cases. llvm-svn: 168022
* [analyzer] Fix test case broken by previous commit.Jordan Rose2012-11-151-0/+1758
| | | | llvm-svn: 168020
* [analyzer] Make sure calls in synthesized functions have valid path locations.Jordan Rose2012-11-155-1849/+420
| | | | | | | | | | | | | | | | | | We do this by using the "most recent" good location: if a synthesized function 'A' calls another function 'B', the path notes for the call to 'B' will be placed at the same location as the path note for calling 'A'. Similarly, the call to 'A' will have a note saying "Entered call from...", and now we just don't emit that (since the user doesn't have a body to look at anyway). Previously, we were doing this for the "Calling..." notes, but not for the "Entered call from..." or "Returning to caller". This caused a crash when the path entered and then exiting a call within a synthesized body. <rdar://problem/12657843> llvm-svn: 168019
* [PCH] Reading expressions from attributes should be done using ReadExpr(),Argyrios Kyrtzidis2012-11-152-1/+318
| | | | | | | | | | | not ReadExpr(). Also add a test case making sure the thread safety attributes work as expected when they come from a PCH. Fixes rdar://12584141 & http://llvm.org/PR13982 llvm-svn: 168017
* Fix a trivial bool-related bug I spotted while skimming David Fang'sEli Friedman2012-11-152-2/+6
| | | | | | current list of powerpc-darwin8 failures. llvm-svn: 168016
* Add link to cfe-users mailing list.Tanya Lattner2012-11-151-0/+1
| | | | llvm-svn: 168015
* Per [basic.lookup.classref]p3, in an expression of the form p->~type-name, theRichard Smith2012-11-153-2/+12
| | | | | | | | | | type-name is looked up in the context of the complete postfix-expression. Don't forget to pass the scope into this lookup when the type-name is a template-id; it might name an alias template which can't be found within the class itself. Bug spotted by Johannes Schaub on #llvm. llvm-svn: 168011
* Fix DiagnoseBitwisePrecedence so it doesn't cast "-1" to the typeEli Friedman2012-11-151-24/+16
| | | | | | | | | BinaryOperator::Opcode. This is bad form, and the behavior of the static_cast in this case is unspecified according to the standard. Fixes a warning that showed up from r167992 on self-host. llvm-svn: 168010
* objective-C blocks: make cc1 flag -encode-extended-block-signatureFariborz Jahanian2012-11-152-3/+3
| | | | | | the default. // rdar://12109031 llvm-svn: 168007
* Make template diffing handle integral expressions of various widths correctly.Eli Friedman2012-11-143-4/+31
| | | | | | PR14342. llvm-svn: 168005
* Add -cc1 option -fno-diagnostics-use-presumed-location, a handy mode forRichard Smith2012-11-147-7/+50
| | | | | | | | | working with preprocessed testcases. This causes source locations in diagnostics to point at the spelling location instead of the presumed location, while still keeping the semantic effects of the line directives (entering and leaving system-header mode, primarily). llvm-svn: 168004
* [utils/ClangDataFormat.py] Add data formatter for StringRef.Argyrios Kyrtzidis2012-11-141-0/+21
| | | | llvm-svn: 168003
* [utils/ClangDataFormat.py] In the summary of SourceLocation, include whether ↵Argyrios Kyrtzidis2012-11-141-2/+5
| | | | | | | | it is local or loaded. llvm-svn: 168002
* objective-C blocks: under cc1 flag -encode-extended-block-signature,Fariborz Jahanian2012-11-145-2/+32
| | | | | | | | generate expanded signature encoding to include types as we already do this for protocol method lists. // rdar://12109031 llvm-svn: 167997
* [analyzer] Fix test in previous commit.Jordan Rose2012-11-141-1/+3
| | | | llvm-svn: 167995
* [analyzer] Add a test case for printing a path note at a PreStmt point.Jordan Rose2012-11-141-1/+28
| | | | | | | | This is also a false-positive test case for <rdar://problem/12415065>. <rdar://problem/12687586> llvm-svn: 167994
* Improve -Wtautological-constant-out-of-range-compare by taking into accountRichard Trieu2012-11-143-19/+191
| | | | | | | | | type conversion between integers. This allows the warning to be more accurate. Also, turned the warning off in an analyzer test. The relavent test cases are covered by the tests in Sema. llvm-svn: 167992
* Teach the AST importer to merge enumerator constants. FixesDouglas Gregor2012-11-141-2/+20
| | | | | | <rdar://problem/12676166>, and tested on the LLDB side of the world. llvm-svn: 167990
* When evaluating variably modified types for function parameters, dig out theEli Friedman2012-11-142-2/+15
| | | | | | | | | | type as written from the ParmVarDecl; it's unclear whether the standard (C99 6.9.1p10) requires this, but we're following the precedent set by gcc, and hopefully nobody will ever ask about this again. PR9559 / <rdar://problem/12621983>. llvm-svn: 167985
* Remove the cellspu port.Eric Christopher2012-11-145-16/+5
| | | | | | Approved by Chris Lattner. llvm-svn: 167983
* ParseTemplate.cpp: Prune obsolete descriptions in ↵NAKAMURA Takumi2012-11-141-10/+0
| | | | | | | | | | | | | | | | ParseSingleDeclarationAfterTemplate(), for now. [-Wdocumentation] /// \param TemplateParams if non-NULL, the template parameter lists /// that preceded this declaration. In this case, the declaration is a /// template declaration, out-of-line definition of a template, or an /// explicit template specialization. When NULL, the declaration is an /// explicit template instantiation. /// /// \param TemplateLoc when TemplateParams is NULL, the location of /// the 'template' keyword that indicates that we have an explicit /// template instantiation. llvm-svn: 167982
* [analyzer] Ensure that CmpRuns recursively walks the output directory.Anna Zaks2012-11-141-39/+40
| | | | llvm-svn: 167981
* In ExpressionEvaluationContextRecord manage LambdaMangle with a sharedArgyrios Kyrtzidis2012-11-143-6/+46
| | | | | | | | | pointer, otherwise we will double free it when ExpressionEvaluationContextRecord gets copied. Fixes crash in rdar://12645424 & http://llvm.org/PR14252 llvm-svn: 167946
* The ObjC++-to-C++ personality trick is only necessary on NeXT runtimes,John McCall2012-11-141-4/+5
| | | | | | | which is not coincidentally the only place it works, either (because of how it tests for EH_TYPE symbols). llvm-svn: 167935
* fixes a buildbot failure.Fariborz Jahanian2012-11-141-0/+1
| | | | llvm-svn: 167934
* Fix 80-column violation.Fariborz Jahanian2012-11-141-3/+5
| | | | llvm-svn: 167932
OpenPOWER on IntegriCloud