summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Make changes to SDiagsWriter to make it work in combination with the ARC ↵Argyrios Kyrtzidis2011-12-072-30/+33
| | | | | | | | | | | | | migrator: -Allow it to be used with multiple BeginSourceFile/EndSourceFile calls; for this introduce a "finish" callback method in the DiagnosticConsumer. SDiagsWriter finishes up the serialization file inside this method. -Make it independent of any particular DiagnosticsEngine; make it use the SourceManager of the Diagnostic object. -Ignore null source ranges. llvm-svn: 146020
* Fix multilib library paths on ppc64 Linux. Patch by Michael Kostylev. PR11472.Eli Friedman2011-12-071-2/+9
| | | | llvm-svn: 146016
* Implement basic support for private headers in frameworks. In essence,Douglas Gregor2011-12-072-25/+131
| | | | | | | | | when we load a module map (module.map) from a directory, also load a private module map (module_private.map) for that directory, if present. That private module map can inject a new submodule that captures private headers. llvm-svn: 146012
* Make sure we correctly zero-initialize unions containing a pointer to data ↵Eli Friedman2011-12-072-7/+17
| | | | | | member as the first field. PR11487. llvm-svn: 146009
* [analyzer] Propagate taint through MemRegions.Anna Zaks2011-12-071-2/+25
| | | | | | | SVal can be not only a symbol, but a MemRegion. Add support for such cases. llvm-svn: 146006
* If we can't write the temporary module map file when compiling aDouglas Gregor2011-12-071-1/+2
| | | | | | module, at least have the decency to complain about it. llvm-svn: 146002
* When folding the size of a global scope VLA to a constant, require the arrayRichard Smith2011-12-072-5/+36
| | | | | | | bound to not have side effects(!). Add constant-folding support for expressions of void type, to ensure that we can still fold ((void)0, 1) as an array bound. llvm-svn: 146000
* objc: issue deprecated/unavailable diagnostic whenFariborz Jahanian2011-12-072-8/+12
| | | | | | | methods with these attributes are sent to receivers of 'id' type too. // rdar://10459930 llvm-svn: 145999
* DeadStoresChecker: when whitelisting dead initializations with constants, lookRichard Smith2011-12-061-1/+1
| | | | | | | for a foldable constant rather than an IR-level constant. This is still far too liberal, but is a step in the right direction. llvm-svn: 145990
* [analyzer] Add comments related to symbol_iteratorAnna Zaks2011-12-061-0/+1
| | | | llvm-svn: 145987
* [analyzer] Refactor: Move symbol_iterator from SVal to SymExpr, use itAnna Zaks2011-12-065-77/+69
| | | | | | for finding dependent symbols for taint. llvm-svn: 145986
* [analyzer] Propagate taint through NonLoc to NonLoc casts.Anna Zaks2011-12-067-27/+58
| | | | | | | | | | | - Created a new SymExpr type - SymbolCast. - SymbolCast is created when we don't know how to simplify a NonLoc to NonLoc casts. - A bit of code refactoring: introduced dispatchCast to have better code reuse, remove a goto. - Updated the test case to showcase the new taint flow. llvm-svn: 145985
* [analyzer] Remove an unnecessary check.Anna Zaks2011-12-061-1/+1
| | | | llvm-svn: 145984
* Add a FIXME to provide a sensible error message hereDouglas Gregor2011-12-061-2/+3
| | | | llvm-svn: 145983
* Move vector bitcast handling in constant expressions from the expressionRichard Smith2011-12-062-40/+14
| | | | | | | | | | | | | evaluator into constant initializer handling / IRGen. The practical consequence of this is that the bitcast now lives in the constant's definition, rather than in its uses. The code in the constant expression evaluator was producing vectors of the wrong type and size (and possibly of the wrong value for a big-endian int-to-vector bitcast). We were getting away with this only because we don't yet support constant-folding of any expressions which inspect vector values. llvm-svn: 145981
* Use absolute paths for temporary module map filesDouglas Gregor2011-12-061-1/+1
| | | | llvm-svn: 145973
* Remove misleading error messageDouglas Gregor2011-12-061-2/+1
| | | | llvm-svn: 145958
* When inferring a module map for a framework, infer subframeworkDouglas Gregor2011-12-062-10/+34
| | | | | | modules for each of its subframeworks. llvm-svn: 145957
* [asan] Mac: do not link dynamic libs with the asan-rt, use -undefined ↵Kostya Serebryany2011-12-062-3/+18
| | | | | | dynamic_lookup for dynamic libs. Style fixes. Patch by glider@google.com llvm-svn: 145955
* Allow inferred submodules for any (sub)module that has an umbrella headerDouglas Gregor2011-12-061-9/+8
| | | | llvm-svn: 145945
* When suggesting a module import for a #include or #import, suggest theDouglas Gregor2011-12-061-6/+3
| | | | | | | | most specific (sub)module based on the actual file we find, rather than always importing the top-level module. This means that #include'ing <Foo/Blah.h> should give us the submodule Foo.Blah. llvm-svn: 145942
* Implement modules support for subframeworks (aka embeddedDouglas Gregor2011-12-061-19/+39
| | | | | | | | frameworks). A submodule can now be labeled as a "framework", and header search will look into the appropriate Headers/PrivateHeaders subdirectories for named headers. llvm-svn: 145941
* When building the main file to parse given a module map, don't skipDouglas Gregor2011-12-061-19/+24
| | | | | | | | explicit submodules or umbrella headers from submodules. Instead, build the entire module at once, and let the name-hiding mechanisms hide the contents of explicit submodules at load time. llvm-svn: 145940
* Headers: wmmintrin.h only needs xmmintrin.h.Daniel Dunbar2011-12-061-1/+1
| | | | | | | - Fixes <rdar://problem/10261246> clang -maes option is not sufficient to include <wmmintrin.h> llvm-svn: 145939
* Minor tweak to prepare for submodules with umbrella headers. No actualDouglas Gregor2011-12-061-7/+13
| | | | | | functionality change yet. llvm-svn: 145938
* Install cpuid.h when building with cmake too.Rafael Espindola2011-12-061-0/+1
| | | | llvm-svn: 145935
* Suggest typo corrections for implicit function declarations.Hans Wennborg2011-12-061-1/+25
| | | | | | | A mistyped function call becomes an inmplicit function declaration in C. Suggest typo correction when one can be found. llvm-svn: 145930
* Extend warnings for missing '@end'.Erik Verbruggen2011-12-062-31/+83
| | | | | | Fixes PR2709. llvm-svn: 145928
* Switch a cast to a dyn_cast and check the pointer before using. Fixes a crashRichard Trieu2011-12-061-4/+5
| | | | | | | | | | in the following code: void test4(bool (&x)(void)) { while (x); } llvm-svn: 145918
* Stack realignment is a tristate. Add -mno-stackrealign to turn off all stackNick Lewycky2011-12-063-8/+14
| | | | | | realignment, even with locals with alignment exceeding the ABI guarantee. llvm-svn: 145909
* Minor comment update.Eli Friedman2011-12-061-1/+3
| | | | llvm-svn: 145905
* Implement inferred submodules support, which (when requested)Douglas Gregor2011-12-063-59/+133
| | | | | | | implicitly generates submodules corresponding to the headers that fall within a module. llvm-svn: 145887
* Make sure we perform lvalue-to-rvalue conversions for enum initializers. ↵Eli Friedman2011-12-061-0/+3
| | | | | | PR11484. llvm-svn: 145874
* objc: put out more coherent warning when method definitionFariborz Jahanian2011-12-061-1/+3
| | | | | | attributes don't match its declaration. // rdar://10529259. llvm-svn: 145872
* Add -mstack-alignment=X and fix -mstackrealign handling now that theJoerg Sonnenberger2011-12-053-4/+15
| | | | | | backend options are gone. llvm-svn: 145868
* More refactoring of objc rewriter.Fariborz Jahanian2011-12-051-87/+107
| | | | llvm-svn: 145867
* Parse inferred submodules in module maps, track their contents inDouglas Gregor2011-12-054-11/+143
| | | | | | | Module, and (de-)serialize this information. Semantics of inferred submodules to follow. llvm-svn: 145864
* Make EmitAggregateCopy take an alignment argument. Make EmitFinalDestCopy ↵Eli Friedman2011-12-052-7/+15
| | | | | | | | | | | pass in the correct alignment when known. The test includes a FIXME for a related case involving calls; it's a bit more complicated to fix because the RValue class doesn't keep track of alignment. <rdar://problem/10463337> llvm-svn: 145862
* [analyzer] Rely on LLVM Dominators in Clang dominator computation.Anna Zaks2011-12-054-164/+3
| | | | | | | | (Previously, Clang used it's implementation of dominators.) The patch is contributed by Guoping Long! llvm-svn: 145858
* [analyzer] Mark ConstraintManager::canReasonAbout as protected.Anna Zaks2011-12-051-2/+2
| | | | llvm-svn: 145857
* [analyzer] Simplify the condition.Anna Zaks2011-12-051-3/+1
| | | | | | | | This is a fixup for r145832. The extra clauses do not matter after we remove the dependency on canReasonAbout(InitVal) in r145832. llvm-svn: 145856
* Add a warning for implicit conversion from function literals (and staticLang Hames2011-12-051-0/+19
| | | | | | | | | | | | | methods) to bool. E.g. void foo() {} if (f) { ... // <- Warns here. } Only applies to non-weak functions, and does not apply if the function address is taken explicitly with the addr-of operator. llvm-svn: 145849
* Make isWeakDecl available as a method on ValueDecl.Lang Hames2011-12-051-9/+3
| | | | llvm-svn: 145845
* More objc rewriter refactoring.Fariborz Jahanian2011-12-051-48/+40
| | | | llvm-svn: 145841
* [analyzer] Unify SymbolVal and SymExprVal under a single SymbolValAnna Zaks2011-12-055-181/+175
| | | | | | | | | | | | | | | | class. We are going into the direction of handling SymbolData and other SymExpr uniformly, so it makes less sense to keep two different SVal classes. For example, the checkers would have to take an extra step to reason about each type separately. The classes have the same members, we were just using the SVal kind field for easy differentiation in 3 switch statements. The switch statements look more ugly now, but we can make the code more readable in other ways, for example, moving some code into separate functions. llvm-svn: 145833
* [analyzer] Remove all uses of ConstraintManager::canResonAbout() fromAnna Zaks2011-12-054-53/+52
| | | | | | | | | | | | ExprEngine. Teach SimpleConstraintManager::assumeSymRel() to propagate constraints to symbolic expressions. + One extra warning (real bug) is now generated due to enhanced assumeSymRel(). llvm-svn: 145832
* [analyzer] First step toward removingAnna Zaks2011-12-054-20/+37
| | | | | | | | | | | | | | ConstraintManager::canReasonAbout() from the ExprEngine. ExprEngine should not care if the constraint solver can reason about something or not. The solver should be able to handle all the SymExprs. To do this, the solver should be able to keep track of not only the SymbolData but of all SymExprs. This is why we change SymbolRef to be an alias of SymExpr*. When encountering an expression it cannot simplify, the solver should just add the constraints to it. llvm-svn: 145831
* [analyzer] Minor improvements on RangeConstraint pretty-printing.Anna Zaks2011-12-051-3/+5
| | | | llvm-svn: 145830
* [analyzer] Change RetainCountChecker to use symbol dump method insteadAnna Zaks2011-12-051-2/+3
| | | | | | | | of relying on SymbolID. This way any expression can be printed (not only SymbolData). llvm-svn: 145829
* [analyzer] Add ability to do a simple ProgramState dump() withoutAnna Zaks2011-12-051-36/+58
| | | | | | | | | requiring CFG. Adding more ugly code; the evnvironment printing should be moved to envirnment at some point. llvm-svn: 145828
OpenPOWER on IntegriCloud