summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* The value of a const weak variable is not an integer constant.John McCall2012-01-051-1/+8
| | | | llvm-svn: 147575
* Fixes a code gen bug for setter code for a property ofFariborz Jahanian2012-01-051-0/+31
| | | | | | | | 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-052-1/+7
| | | | | | | 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-043-18/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Rename attribute 'objc_suppress_autosynthesis' to ↵Ted Kremenek2012-01-041-7/+7
| | | | | | 'objc_disable_automatic_synthesis'. llvm-svn: 147567
* Fix test on Release builds.Eli Friedman2012-01-041-1/+1
| | | | llvm-svn: 147565
* Test case for my previous patch.Fariborz Jahanian2012-01-041-2/+2
| | | | llvm-svn: 147563
* Add an APValue representation for the difference between two ↵Eli Friedman2012-01-041-0/+13
| | | | | | | | | | 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-041-0/+10
| | | | | | information even in subscripting operations. llvm-svn: 147557
* Support __has_attribute for objc_suppress_autosynthesisFariborz Jahanian2012-01-041-0/+2
| | | | | | which is automatic with proper spelling :). llvm-svn: 147555
* Add __has_feature(modules) to indicate when modules are available (inDouglas Gregor2012-01-041-1/+15
| | | | | | | | | 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-043-0/+32
| | | | llvm-svn: 147535
* Implement declaration merging for non-template functions fromDouglas Gregor2012-01-043-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Restore r147493 and remove the part of the test that was checking the wrong ↵David Chisnall2012-01-041-2/+0
| | | | | | thing. llvm-svn: 147530
* Extend ConditionBRVisitor to handle condition variable assignments.Ted Kremenek2012-01-041-0/+214
| | | | llvm-svn: 147526
* Don't treat 'import' as a contextual keyword when we're in a caching lexer, ↵Douglas Gregor2012-01-041-0/+6
| | | | | | or when modules are disabled. llvm-svn: 147524
* Process attributes in explicit function template instantiations. Fixes part ofRafael Espindola2012-01-041-0/+5
| | | | | | PR11690. llvm-svn: 147523
* Stub out the Sema interface for lambda expressions, and change the parser to ↵Eli Friedman2012-01-044-15/+16
| | | | | | use it. Unconditionally error on lambda expressions because they don't work in any meaningful way yet. llvm-svn: 147515
* Teach the static analyzer to not treat XPC types as CF types.Ted Kremenek2012-01-041-0/+16
| | | | llvm-svn: 147506
* In non-gc, non-arc mode, property of 'Class' typeFariborz Jahanian2012-01-041-0/+15
| | | | | | | | variety is treated as a 'void *'. No need to issue warning reserved for objc object properties. // rdar://10565506 llvm-svn: 147504
* Enhance UnixAPIChecker to also warn about zero-sized allocations to calloc() ↵Ted Kremenek2012-01-031-0/+32
| | | | | | and realloc(). Patch by Cyril Roelandt! llvm-svn: 147500
* Test "merging" of typedef types across distinct modules. At present,Douglas Gregor2012-01-033-0/+15
| | | | | | | | | | | | 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-032-0/+49
| | | | | | Anton Lokhmotov. llvm-svn: 147496
* Add initial version of checker to check if virtual member functions are ↵Ted Kremenek2012-01-031-0/+53
| | | | | | | | called transitively from C++ constructors or destructors. Checker by Lei Zhang with a few tweaks by Ted Kremenek. llvm-svn: 147494
* objc: diagnose misplacement of objc_suppress_autosynthesisFariborz Jahanian2012-01-031-0/+6
| | | | | | attribute. llvm-svn: 147490
* Implement cross-module declaration merging for tag declarations, soDouglas Gregor2012-01-035-0/+59
| | | | | | | | | | | | that if two modules A and B both contain a declaration of a tag such as struct X; and those two modules are unrelated, the two declarations of X will be merged into a single redeclaration chain. llvm-svn: 147488
* Add __has_feature(objc_modules)Douglas Gregor2012-01-031-0/+11
| | | | llvm-svn: 147482
* Add a test for the driver-level -fmodules/-fno-modules flags.Douglas Gregor2012-01-031-0/+6
| | | | llvm-svn: 147480
* Add test case for PR 9774, which got fixed along the way.Ted Kremenek2012-01-031-0/+6
| | | | llvm-svn: 147479
* Added testcases for -Wdisabled-macro-expansion.Abramo Bagnara2012-01-031-0/+27
| | | | llvm-svn: 147473
* Re-uglify #public and #private to #__public_macro and #__private_macro.Douglas Gregor2012-01-035-7/+7
| | | | llvm-svn: 147469
* objc: use objc_suppress_autosynthesis attribute on classesFariborz Jahanian2012-01-031-0/+33
| | | | | | which should not be default synthesized. llvm-svn: 147468
* Eliminate the uglified keyword __import_module__ for importingDouglas Gregor2012-01-0320-72/+83
| | | | | | | | | | | | | modules. This leaves us without an explicit syntax for importing modules in C/C++, because such a syntax needs to be discussed first. In Objective-C/Objective-C++, the @import syntax is used to import modules. Note that, under -fmodules, C/C++ programs can import modules via the #include mechanism when a module map is in place for that header. This allows us to work with modules in C/C++ without committing to a syntax. llvm-svn: 147467
* Under -fmodules, accept #public <macroname> and #private <macroname>Douglas Gregor2012-01-0313-30/+30
| | | | | | | to make a macro public (the default for headers) or private, respectively. llvm-svn: 147455
* Introduce a non-uglified syntax for module imports in Objective-C:Douglas Gregor2012-01-0320-32/+32
| | | | | | @import identifier [. identifier]* ; llvm-svn: 147452
* Don't attempt to merge a deserialized declaration with existingDouglas Gregor2012-01-031-2/+2
| | | | | | | declarations in the AST unless modules are enabled. This case doesn't come up with precompiled headers, and it isn't cheap. llvm-svn: 147451
* Rename the command-line option for mapping #include/#import over toDouglas Gregor2012-01-039-10/+10
| | | | | | | | module imports from -fauto-module-import to -fmodules. The new name will eventually be used to enable modules, and the #include/#import mapping is a crucial part of the feature. llvm-svn: 147447
* Process attributes in explicit template instatiation definitions. Fixes PR11690.Rafael Espindola2012-01-031-0/+10
| | | | llvm-svn: 147441
* Teach the frontend to provide the builtin preprocessor defines forChandler Carruth2012-01-031-12/+14
| | | | | | -ffast-math. llvm-svn: 147440
* Add assertion to char32_t that the value is valid, as suggested by Jordy Rose.Richard Smith2012-01-021-2/+4
| | | | | | | Add a test that such characters don't make it through to StringLiteral objects in error recovery. llvm-svn: 147438
* Diagnose cases where the definition of a particular type is required,Douglas Gregor2012-01-022-3/+23
| | | | | | | is known (to Clang), but is not visible because the module has not yet been imported. llvm-svn: 147436
* Fix PR11685 by implementing -ffast-math and its various friends in theChandler Carruth2012-01-021-0/+119
| | | | | | | | | | | | | | | | | | | | | | | | | Clang driver. This involves a bunch of silly option parsing code to try to carefully emulate GCC's options. Currently, this takes a conservative approach, and unless all of the unsafe optimizations are enabled, none of them are. The fine grained control doesn't seem particularly useful. If it ever becomes useful, we can add that to LLVM first, and then expose it here. This also fixes a few tiny bugs in the flag management around -fhonor-infinities and -fhonor-nans; the flags now form proper sets both for enabling and disabling, with the last flag winning. I've also implemented a moderately terrifying GCC feature where a language change is also provided by the '-ffast-math' flag by defining the __FAST_MATH__ preprocessor macro. This feature is tracked and serialized in the frontend but it isn't used yet. A subsequent patch will add the preprocessor macro and tests for it. I've manually tested that codegen appears to respect this, but I've not dug in enough to see if there is an easy way to test codegen options w/o relying on the particulars of LLVM's optimizations. llvm-svn: 147434
* Small cosmetic cleanups in code I will change anyway.Rafael Espindola2012-01-021-1/+1
| | | | llvm-svn: 147424
* Implement declaration merging for Objective-C protocols acrossDouglas Gregor2012-01-014-0/+20
| | | | | | | multiple, disjoint modules. There is far too much duplicating with the ObjCInterfaceDecl case here, which I'll eliminate shortly. llvm-svn: 147417
* Wire up redeclaration chains for Objective-C protocols, so that bothDouglas Gregor2012-01-015-0/+29
| | | | | | | forward declarations and definitions of an Objective-C protocol are represented within a single chain of ObjCProtocolDecls. llvm-svn: 147412
* Consider visibility attributes in namespaces as being explicit. I.e., theyRafael Espindola2012-01-011-0/+12
| | | | | | take precedence over command line options. Fixes PR10113. llvm-svn: 147405
* Implement support for module requirements, which indicate the languageDouglas Gregor2011-12-314-0/+21
| | | | | | | | | features needed for a particular module to be available. This allows mixed-language modules, where certain headers only work under some language variants (e.g., in C++, std.tuple might only be available in C++11 mode). llvm-svn: 147387
OpenPOWER on IntegriCloud