summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Enable stack protectors by default for iOS. <rdar://problem/8836680>Bob Wilson2011-12-141-1/+1
| | | | llvm-svn: 146552
* [analyzer] Treat stdin as a source of taint.Anna Zaks2011-12-141-6/+44
| | | | | | | | Some of the test cases do not currently work because the analyzer core does not seem to call checkers for pre/post DeclRefExpr visits. (Opened radar://10573500. To be fixed later on.) llvm-svn: 146536
* [analyzer] Minor refactor to addTaint.Anna Zaks2011-12-141-2/+8
| | | | llvm-svn: 146535
* [analyzer] Mark output of fscanf and fopen as tainted.Anna Zaks2011-12-141-1/+30
| | | | llvm-svn: 146533
* [analyzer] Mark getenv output as tainted.Anna Zaks2011-12-142-2/+10
| | | | | | Also, allow adding taint to a region (not only a symbolic value). llvm-svn: 146532
* Per discussion on the list, remove BitcodeVerify pass to reimplement as a ↵Chad Rosier2011-12-144-11/+0
| | | | | | free function. llvm-svn: 146530
* Make the diagnostic message more consistant. Update the type comparison toRichard Trieu2011-12-131-11/+16
| | | | | | | handle non-pointer types. This is for the extra info printed when function types are compared. llvm-svn: 146525
* objc: diagnose duplicate declaration of methodsFariborz Jahanian2011-12-131-2/+14
| | | | | | in classes. // rdar://10535349 llvm-svn: 146504
* Added an assertion about overflow in sizeof evaluation. This does not solve ↵Abramo Bagnara2011-12-131-1/+3
| | | | | | the underlying structural issue that is waiting for a proper solution. llvm-svn: 146482
* Disallow decltype in qualified declarator-ids.David Blaikie2011-12-131-0/+10
| | | | llvm-svn: 146480
* Add checks and diagnostics for many of the cases which C++11 considers to notRichard Smith2011-12-131-89/+203
| | | | | | be constant expressions. llvm-svn: 146479
* Set umbrella directory correctly when we infer a framework moduleDouglas Gregor2011-12-121-1/+1
| | | | llvm-svn: 146451
* Fix "control may reach end of non-void function" warning.Nick Lewycky2011-12-121-2/+1
| | | | llvm-svn: 146448
* Implement the Microsoft __if_exists/if_not_exists extension in initializer-list.Francois Pichet2011-12-121-0/+74
| | | | | | | | | | | | | | | Necessary to parse Microsoft ATL code. Example: int array[] = { 0, __if_exists(CLASS::Type) {2, } 3 }; will declare an array of 2 or 3 elements depending on if CLASS::Type exists or not. llvm-svn: 146447
* Tweak submodule ID handling in the AST writerDouglas Gregor2011-12-122-6/+9
| | | | llvm-svn: 146445
* objc-arc: better diagnostic when block is declaredFariborz Jahanian2011-12-121-1/+2
| | | | | | inside a struct/union. llvm-svn: 146444
* Make CGRecordLayoutBuilder correctly switch over to a packed class when a ↵Eli Friedman2011-12-121-36/+50
| | | | | | class has a base whose alignment will break the class layout. <rdar://problem/10551376>. llvm-svn: 146443
* Add frontend flags to enable bitcode verifier pass.Chad Rosier2011-12-124-0/+11
| | | | llvm-svn: 146441
* Suppress -Warray-bounds in certain cases involving macros from system headers.Matt Beaumont-Gay2011-12-121-1/+11
| | | | | | The motivation here is a "clever" implementation of strncmp(), which peels the first few comparisons via chained conditional expressions which ensure that the input arrays are known at compile time to be sufficiently large. llvm-svn: 146430
* Fixes a bug in calculation of field offsets of ms_structFariborz Jahanian2011-12-121-3/+14
| | | | | | | fields by just following what comment says. // rdar://10513599 llvm-svn: 146414
* Hexagon backend supportTony Linthicum2011-12-1210-6/+2648
| | | | llvm-svn: 146413
* When we have an umbrella directory in a module map, recursively walkDouglas Gregor2011-12-121-1/+2
| | | | | | the subdirectories to find headers in submodules. llvm-svn: 146398
* Clean up diagnostic wording for disallowed casts in C++11 constant expressions.Richard Smith2011-12-121-2/+7
| | | | llvm-svn: 146395
* Don't mark include guard macros as implicitly private. This isn'tDouglas Gregor2011-12-121-21/+1
| | | | | | | actually a terribly good heuristic, and the world is too horrible for it to work. llvm-svn: 146393
* Implement C++11 constant expression cast restrictions.Richard Smith2011-12-121-0/+19
| | | | llvm-svn: 146371
* Fix some not-yet-used diagnostic code in a template, which gcc spotted and clangRichard Smith2011-12-121-1/+1
| | | | | | did not! llvm-svn: 146366
* Prepare constant expression infrastructure for the generation of richerRichard Smith2011-12-122-80/+98
| | | | | | diagnostics. No functionality change. llvm-svn: 146365
* Update Clang to emit the new form of llvm.cttz and llvm.ctlz intrinsics,Chandler Carruth2011-12-121-3/+4
| | | | | | | | | setting the is_zero_undef flag appropriately to true as that matches the semantics of these GCC builtins. This is the Clang side of r146357 in LLVM. llvm-svn: 146358
* Fix/test decltype dtor calls with invalid base expression.David Blaikie2011-12-121-1/+1
| | | | llvm-svn: 146354
* [analyzer] CStringChecker should not rely on the analyzer generating ↵Anna Zaks2011-12-113-5/+11
| | | | | | | | | | | | | | UndefOrUnknown value when it cannot reason about the expression. We are now often generating expressions even if the solver is not known to be able to simplify it. This is another cleanup of the existing code, where the rest of the analyzer and checkers should not base their logic on knowing ahead of the time what the solver can reason about. In this case, CStringChecker is performing a check for overflow of 'left+right' operation. The overflow can be checked with either 'maxVal-left' or 'maxVal-right'. Previously, the decision was based on whether the expresion evaluated to undef or not. With this patch, we check if one of the arguments is a constant, in which case we know that 'maxVal-const' is easily simplified. (Another option is to use canReasonAbout() method of the solver here, however, it's currently is protected.) This patch also contains 2 small bug fixes: - swap the order of operators inside SValBuilder::makeGenericVal. - handle a case when AddeVal is unknown in GenericTaintChecker::getPointedToSymbol. llvm-svn: 146343
* Reuse forAddr to create ignored AggValueSlots.Benjamin Kramer2011-12-111-5/+2
| | | | | | Silences valgrind warnings about uninitalized alignment values. llvm-svn: 146342
* [analyzer]Fixup r146336.Anna Zaks2011-12-102-8/+8
| | | | | | | Forgot to commit the Header files. Rename generateUnknownVal -> makeGenericVal. llvm-svn: 146337
* [analyzer] Introduce IntSymExpr, where the integer is on the lhs.Anna Zaks2011-12-104-15/+66
| | | | | | | | Fix a bug in SimpleSValBuilder, where we should swap lhs and rhs when calling generateUnknownVal(), - the function which creates symbolic expressions when data is tainted. The issue is not visible when we only create the expressions for taint since all expressions are commutative from taint perspective. Refactor SymExpr::symbol_iterator::expand() to use a switch instead of a chain of ifs. llvm-svn: 146336
* Check that arguments to a scanf call match the format specifier,Hans Wennborg2011-12-102-3/+284
| | | | | | and offer fixits when there is a mismatch. llvm-svn: 146326
* In ContentCache::replaceBuffer, add sanity check to make sure that we do not ↵Argyrios Kyrtzidis2011-12-101-1/+5
| | | | | | | | free a buffer and then continue using it. rdar://10359140. llvm-svn: 146308
* Make sure that we infer __strong, etc. when we instantiate variablesDouglas Gregor2011-12-103-0/+14
| | | | | | under ARC. Fixes <rdar://problem/10530209>. llvm-svn: 146307
* Add a fast path to the constant evaluator for integer literals. This speeds upRichard Smith2011-12-101-0/+8
| | | | | | | compilation of some translation units of SPEC's 445.gobmk by ~4%, and does not seem to cause a measurable slowdown in other cases. llvm-svn: 146306
* Add a sanity check in SourceManager::getColumnNumber, make sureArgyrios Kyrtzidis2011-12-101-1/+8
| | | | | | we don't try to access beyond the buffer. llvm-svn: 146305
* Add ability to supply additional message to availability macros,Fariborz Jahanian2011-12-103-9/+37
| | | | | | // rdar://10095131 llvm-svn: 146304
* When we manage to re-use an expression during tree transformation (=Douglas Gregor2011-12-101-8/+8
| | | | | | | | template instantiation), and that expression might produce a temporary, invoke MaybeBindToTemporary. Otherwise, we forget to destroy objects, release objects, etc. Fixes <rdar://problem/10531073>. llvm-svn: 146301
* Driver: Handle -f{no-}honor-infinities, -f{no-}honor-nans, andDaniel Dunbar2011-12-092-2/+22
| | | | | | | | -ffinite-math-only. - No test case yet, I don't know how to construct a situation where this matters. llvm-svn: 146297
* Make array new on a pointer to data member type work correctly. PR11523.Eli Friedman2011-12-091-2/+3
| | | | llvm-svn: 146291
* C++11 constant expressions: Don't use CheckICE in C++11; instead, determineRichard Smith2011-12-092-285/+380
| | | | | | | | | | | | whether an expression is a (core) constant expression as a side-effect of evaluation. This takes us from accepting far too few expressions as ICEs to accepting slightly too many -- fixes for the remaining cases are coming next. The diagnostics produced when an expression is found to be non-constant are currently quite poor (with generic wording but reasonable source locations), and will be improved in subsequent commits. llvm-svn: 146289
* Add notes for suppressing and (if it's a zero-arg function returning bool) ↵David Blaikie2011-12-091-0/+10
| | | | | | fixing the function-to-bool conversion warning. llvm-svn: 146280
* objc-arc: diagnose synthesis of a 'weak unavailable' property.Fariborz Jahanian2011-12-091-6/+14
| | | | | | // rdar://10535245 llvm-svn: 146272
* Provide a separate warning for weak vtables in explicit template ↵David Blaikie2011-12-091-1/+4
| | | | | | instantiations. There's no (current) way to fix such templates to emit strong symbols/vtables, but perhaps users want to know about the cost being incurred anyway. llvm-svn: 146265
* When performing subframework header lookup, don't search forDouglas Gregor2011-12-091-3/+7
| | | | | | | ".framework/" in the path name, because it could be ".framework\" on Windows. This whole function needs to be rewritten with PathV2. llvm-svn: 146261
* Use llvm::sys::fs::equivalent rather than comparing inodes, becauseDouglas Gregor2011-12-091-6/+5
| | | | | | comparing inodes doesn't actually work on Windows. llvm-svn: 146260
* Remove unnecessary braces from my previous commit.Hans Wennborg2011-12-091-2/+1
| | | | llvm-svn: 146259
* Make printf warnings refer to wint_t and wchar_t by nameHans Wennborg2011-12-093-14/+13
| | | | | | in addition to underlying type. llvm-svn: 146254
OpenPOWER on IntegriCloud