summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* PR10828: Produce a warning when a no-arguments function is declared in blockRichard Smith2012-01-0510-17/+46
| | | | | | | | | | | | | | | | | scope, when no other indication is provided that the user intended to declare a function rather than a variable. Remove some false positives from the existing 'parentheses disambiguated as a function' warning by suppressing it when the declaration is marked as 'typedef' or 'extern'. Add a new warning group -Wvexing-parse containing both of these warnings. The new warning is enabled by default; despite a number of false positives (and one bug) in clang's test-suite, I have only found genuine bugs with it when running it over a significant quantity of real C++ code. llvm-svn: 147599
* More lambda work. Tweak the Sema interface slightly. Start adding the ↵Eli Friedman2012-01-0510-44/+141
| | | | | | pieces to build the lambda class and its call operator. Create an actual scope for the lambda body. llvm-svn: 147595
* [driver] Add support for passing -lazy_framework/-lazy_library to the linker.Chad Rosier2012-01-052-0/+16
| | | | | | rdar://10630328 llvm-svn: 147591
* Change casting slightly to avoid warnings about casting away const.Eli Friedman2012-01-051-2/+2
| | | | llvm-svn: 147589
* When we're performing name lookup for a tag, we still allow ourselvesDouglas Gregor2012-01-054-5/+13
| | | | | | | | | | | | | | | | | | to see hidden declarations because every tag lookup is effectively a redeclaration lookup. For example, image that struct foo; is declared in a submodule that is known but hasn't been imported. If someone later writes struct foo *foo_p; then "struct foo" is either a reference or a redeclaration. To keep the redeclaration chains sound, we treat it like a redeclaration for name-lookup purposes. llvm-svn: 147588
* Minor cleanup; no functional change.Eli Friedman2012-01-051-3/+2
| | | | llvm-svn: 147582
* Sanity checks in SourceManager::getFileEntryForID() and ↵Argyrios Kyrtzidis2012-01-051-2/+8
| | | | | | | | SourceManager::getFileEntryForSLocEntry() to make sure we do not crash. rdar://10594186 llvm-svn: 147576
* The value of a const weak variable is not an integer constant.John McCall2012-01-055-2/+30
| | | | llvm-svn: 147575
* If we already have a definition for a top-level module that we deserialized ↵Douglas Gregor2012-01-051-0/+13
| | | | | | from a module file, don't bother parsing a new definition llvm-svn: 147574
* Fixes a code gen bug for setter code for a property ofFariborz Jahanian2012-01-052-1/+33
| | | | | | | | c++ object reference type with trivial copy constructor. This causes an assert crash and bad code gen. when assert is off. // rdar://6137845 llvm-svn: 147573
* When generating includes for all of the headers we found in anDouglas Gregor2012-01-053-4/+20
| | | | | | | umbrella directory, skip includes for any headers that are part of an unavailable module. llvm-svn: 147572
* [analyzer] Add another tests to taint tester.Anna Zaks2012-01-041-0/+9
| | | | llvm-svn: 147570
* [analyzer] Be less pessimistic about invalidation of global variablesAnna Zaks2012-01-0416-125/+325
| | | | | | | | | | | | | | | | | | | | | | | | | | | | as a result of a call. Problem: Global variables, which come in from system libraries should not be invalidated by all calls. Also, non-system globals should not be invalidated by system calls. Solution: The following solution to invalidation of globals seems flexible enough for taint (does not invalidate stdin) and should not lead to too many false positives. We split globals into 3 classes: * immutable - values are preserved by calls (unless the specific global is passed in as a parameter): A : Most system globals and const scalars * invalidated by functions defined in system headers: B: errno * invalidated by all other functions (note, these functions may in turn contain system calls): B: errno C: all other globals (which are not in A nor B) llvm-svn: 147569
* [analyzer] Correct the error message in the testing infrastructure.Anna Zaks2012-01-041-2/+1
| | | | llvm-svn: 147568
* Rename attribute 'objc_suppress_autosynthesis' to ↵Ted Kremenek2012-01-046-13/+13
| | | | | | 'objc_disable_automatic_synthesis'. llvm-svn: 147567
* Fix 80 col violations.Ted Kremenek2012-01-041-13/+27
| | | | llvm-svn: 147566
* Fix test on Release builds.Eli Friedman2012-01-041-1/+1
| | | | llvm-svn: 147565
* Store the submodules of a module in source order, as they are storedDouglas Gregor2012-01-048-84/+96
| | | | | | | | in the module map. This provides a bit more predictability for the user, as well as eliminating the need to sort the submodules when serializing them. llvm-svn: 147564
* Test case for my previous patch.Fariborz Jahanian2012-01-041-2/+2
| | | | llvm-svn: 147563
* objc: When issuing warning for missing synthesis forFariborz Jahanian2012-01-043-4/+16
| | | | | | | properties in classes declared with objc_suppress_autosynthesis attribute, pinpoint location of the said class in a note. llvm-svn: 147562
* Add an APValue representation for the difference between two ↵Eli Friedman2012-01-047-98/+133
| | | | | | | | | | address-of-label expressions. Add support to Evaluate and CGExprConstant for generating/handling them. Remove the special-case for such differences in Expr::isConstantInitializer. With that done, remove a bunch of buggy code from CGExprConstant for handling scalar expressions which is no longer necessary. Fixes PR11705. llvm-svn: 147561
* fix test on -Asserts builds.Chris Lattner2012-01-041-1/+1
| | | | llvm-svn: 147558
* implement rdar://10639962 by keeping track of increased alignment Chris Lattner2012-01-042-1/+15
| | | | | | information even in subscripting operations. llvm-svn: 147557
* Add missing #endif in documentation.Ted Kremenek2012-01-041-0/+1
| | | | llvm-svn: 147556
* Support __has_attribute for objc_suppress_autosynthesisFariborz Jahanian2012-01-042-1/+3
| | | | | | which is automatic with proper spelling :). llvm-svn: 147555
* Driver/Darwin: Remove a hack that avoided passing -demangle to iOS linkers.Daniel Dunbar2012-01-041-7/+1
| | | | llvm-svn: 147552
* Add __has_feature(modules) to indicate when modules are available (inDouglas Gregor2012-01-042-2/+17
| | | | | | | | | any language variant), and restrict __has_feature(objc_modules) to mean that we also have the Objective-C @import syntax. I anticipate __has_feature(cxx_modules) and/or __has_feature(c_modules) for when we nail down the module syntax for C/C++. llvm-svn: 147548
* Fix test so it doesn't depend on the host's calling convention lowering code.Eli Friedman2012-01-041-6/+6
| | | | llvm-svn: 147545
* Implement declaration merging for variables in disjoint modules.Douglas Gregor2012-01-044-1/+48
| | | | llvm-svn: 147535
* Implement declaration merging for non-template functions fromDouglas Gregor2012-01-045-44/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | different modules. This implementation is a first approximation of what we want, using only the function type to determine equivalence. Later, we'll want to deal with some of the more subtle issues, including: - C allows a prototyped declaration and a non-prototyped declaration to be merged, which we should support - We may want to ignore the return type when merging, then complain if the return types differ. Or, we may want to leave it as it us, so that we only complain if overload resolution eventually fails. - C++ non-static member functions need to consider cv-qualifiers and ref-qualifiers. - Function templates need to consider the template parameters and return type. - Function template specializations will have special rules. - We can now (accidentally!) end up overloading in C, even without the "overloadable" attribute, and will need to detect this at some point. The actual detection of "is this an overload?" is implemented by Sema::IsOverload(), which will need to be moved into the AST library for re-use here. That will be a future refactor. llvm-svn: 147534
* Implement declaration merging for typedefs loaded from disjointDouglas Gregor2012-01-042-27/+38
| | | | | | | | | | | modules, so long as the typedefs refer to the same underlying type. This ensures that the typedefs end up in the same redeclaration chain. To test this, fix name lookup for C/Objective-C to properly deal with multiple declarations with the same name in the same scope. llvm-svn: 147533
* Penryn doesn't support sse4.2, don't enable it in the first place.Benjamin Kramer2012-01-041-2/+1
| | | | | | | While the code took care of disabling the sse42 flag it didn't know about popcnt. This broke -march=native on penryn. llvm-svn: 147531
* Restore r147493 and remove the part of the test that was checking the wrong ↵David Chisnall2012-01-042-8/+32
| | | | | | thing. llvm-svn: 147530
* Extend ConditionBRVisitor to handle condition variable assignments.Ted Kremenek2012-01-043-4/+259
| | | | llvm-svn: 147526
* Don't treat 'import' as a contextual keyword when we're in a caching lexer, ↵Douglas Gregor2012-01-044-11/+30
| | | | | | or when modules are disabled. llvm-svn: 147524
* Process attributes in explicit function template instantiations. Fixes part ofRafael Espindola2012-01-042-0/+8
| | | | | | PR11690. llvm-svn: 147523
* Add an explicit LambdaExprContext to Declarator, to parallel ↵Eli Friedman2012-01-044-5/+20
| | | | | | BlockLiteralContext. Use it to ensure semantic analysis of types isn't confused by the lack of a type specifier. llvm-svn: 147522
* Have functions return structures smaller than 128-bit in registers if ABIAkira Hatanaka2012-01-041-3/+54
| | | | | | is either N32 or N64. llvm-svn: 147520
* Fix messed-up indentation in r147515.Eli Friedman2012-01-041-7/+7
| | | | llvm-svn: 147517
* Stub out the Sema interface for lambda expressions, and change the parser to ↵Eli Friedman2012-01-049-33/+118
| | | | | | use it. Unconditionally error on lambda expressions because they don't work in any meaningful way yet. llvm-svn: 147515
* Revert r147493. It broke test/CodeGenObjC/constant-strings.m.Rafael Espindola2012-01-041-32/+6
| | | | llvm-svn: 147511
* Teach the static analyzer to not treat XPC types as CF types.Ted Kremenek2012-01-042-1/+19
| | | | llvm-svn: 147506
* Minor code formatting cleanups.Ted Kremenek2012-01-041-17/+17
| | | | llvm-svn: 147505
* In non-gc, non-arc mode, property of 'Class' typeFariborz Jahanian2012-01-042-0/+24
| | | | | | | | variety is treated as a 'void *'. No need to issue warning reserved for objc object properties. // rdar://10565506 llvm-svn: 147504
* Get rid of an unnecessary check; the AST for init-lists is the same ↵Eli Friedman2012-01-031-6/+4
| | | | | | independent of whether we're in C++11 mode. llvm-svn: 147503
* Enhance UnixAPIChecker to also warn about zero-sized allocations to calloc() ↵Ted Kremenek2012-01-032-25/+145
| | | | | | and realloc(). Patch by Cyril Roelandt! llvm-svn: 147500
* Minor tweak to name lookup for C/Objective-C: after the first name, still ↵Douglas Gregor2012-01-031-1/+1
| | | | | | consider whether this is a redeclaration lookup when determining whether to look for the visible declaration llvm-svn: 147499
* Test "merging" of typedef types across distinct modules. At present,Douglas Gregor2012-01-036-23/+43
| | | | | | | | | | | | the AST reader doesn't actually perform a merge, because name lookup knows how to merge identical typedefs together. As part of this, teach C/Objective-C name lookup to return multiple results in all cases, rather than first digging through the attributes to see if the value is overloadable. This way, we'll catch ambiguous lookups in C/Objective-C. llvm-svn: 147498
* Support constant evaluation for OpenCL nested vector literals. Patch by ↵Eli Friedman2012-01-033-43/+81
| | | | | | Anton Lokhmotov. llvm-svn: 147496
* Add initial version of checker to check if virtual member functions are ↵Ted Kremenek2012-01-034-0/+296
| | | | | | | | called transitively from C++ constructors or destructors. Checker by Lei Zhang with a few tweaks by Ted Kremenek. llvm-svn: 147494
OpenPOWER on IntegriCloud