aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-12-21Fix bugs in SourceManager::computeMacroArgsCache() and add a unit test for it.Argyrios Kyrtzidis
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147057 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21For SourceManager::isBeforeInTranslationUnit(), have it consider macro arg ↵Argyrios Kyrtzidis
expanded token locations as coming before the closing ')' of a function macro expansion. Include a unit test for SourceManager. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147056 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21Implement a trivial, obvious optimization for deserialization ofDouglas Gregor
redeclaration chains: only ever have the reader search for redeclarations of the first (canonical) declaration, since we only ever record redeclaration ranges for the that declaration. Searching for redeclarations of non-canonical declarations will never find anything, so it's a complete waste of time. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147055 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21Add a few more AVX2 intrinsics and fix the type strings on a couple SSE ↵Craig Topper
intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147048 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21Add AVX2 horizontal add/sub intrinsics.Craig Topper
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147047 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21constexpr: diagnostic improvements for invalid lvalue-to-rvalue conversions inRichard Smith
constant expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147035 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21Bump suitable alignment on darwin ppc 32/64 and x86-32 to 16 bytes. I don'tNick Lewycky
actually know about the other OSes on X86-32 besides Linux... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147034 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21C++11 half of r147023: In C++11, additionally eagerly instantiate:Richard Smith
- constexpr function template instantiations - variables of reference type - constexpr variables git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147031 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21Attempt to fix test on 32-bit hosts.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147030 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21Fix a case where Expr::isConstantInitializer would return true for an ↵Eli Friedman
expression we can't support. In a slightly amusing twist, the case in question was already in the clang regression tests marked as a valid construct. <rdar://problem/10020074> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147026 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21C++ constant expression handling: eagerly instantiate static const integral dataRichard Smith
members of class templates so that their values can be used in ICEs. This required reverting r105465, to get such instantiated members to be included in serialized ASTs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147023 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-21objc QOI: Don't't warn about mismatch between attributes Fariborz Jahanian
on method declaration and definition if former is in a system header. // rdar://10580333 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147020 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20PR11297: Provide a better diagnostic for code which contains aRichard Smith
reasonable-looking but ill-formed for-range statement of the form: for (expression : expression) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147006 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20[analyzer] Do not invalidate arguments when the parameter'sAnna Zaks
type is a pointer to const. (radar://10595327) The regions corresponding to the pointer and reference arguments to a function get invalidated by the calls since a function call can possibly modify the pointed to data. With this change, we are not going to invalidate the data if the argument is a pointer to const. This change makes the analyzer more optimistic in reporting errors. (Support for C, C++ and Obj C) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147002 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20objc/c++: Issue diagnostic when free-standing ivar is accessed Fariborz Jahanian
in class method instead of crash. // rdar://10593227 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146998 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20When we make a previously-deserialized module definition visible,Douglas Gregor
notify the AST deserialization listener so that the AST writer knows that it can write the macro definition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146994 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20Fix inversion of static analyzer path diagnostics for path conditions.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146993 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20Fix a crash on invalid, http://llvm.org/pr11599Nico Weber
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146988 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20Let the KNR promotion warning be disabled.Roman Divacky
Patch by Dimitry Andric! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146982 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20When performing name lookup for a redeclaration, ignore moduleDouglas Gregor
visibility restrictions. This ensures that all declarations of the same entity end up in the same redeclaration chain, even if some of those declarations aren't visible. While this may seem unfortunate to some---why can't two C modules have different functions named 'f'?---it's an acknowedgment that a module does not introduce a new "namespace" of names. As part of this, stop merging the 'module-private' bit from previous declarations to later declarations, because we want each declaration in a module to stand on its own because this can effect, for example, submodule visibility. Note that this notion of names that are invisible to normal name lookup but are available for redeclaration lookups is how we should implement friend declarations and extern declarations within local function scopes. I'm not tackling that problem now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146980 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20When performing layout for an Objective-C class, make sure to dig outDouglas Gregor
the definition of that class. Fixes PR11613 / <rdar://problem/10604077>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146976 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20Add AVX2 intrinsics for pavg, pblend, and pcmp instructions. Also remove ↵Craig Topper
unneeded builtins for SSE pcmp. Change SSE pcmpeqq and pcmpgtq to not use builtins and just use vector == and >. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146969 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20Update the CMake build for r146959's new files.Chandler Carruth
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146967 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20Relax type checking for a few Neon intrinsics. <rdar://problem/10538555>Bob Wilson
Not long ago, I tightened up the type checking for pointer arguments of Neon intrinsics to match the specifications provided by ARM. One consequence was that it became impossible to access the unaligned versions of a few Neon load/store operations. Since there are just a few of these intrinsics where it makes a difference, I think it's better to relax the type checking than to either introduce new non-standard unaligned intrinsics or to disallow intrinsics for the unaligned operations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146963 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20Fix off-by-one error in an assert condition. No functionality change, but betterRichard Smith
error detection. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146962 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20Revert r146766, and add a testcase for which it introduced a wrong-code bug.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146961 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20Unweaken vtables as per ↵David Blaikie
http://llvm.org/docs/CodingStandards.html#ll_virtual_anch git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146959 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20Unlike in C++03, a constant-expression is not an unevaluated operand in C++11.Richard Smith
Split out a new ExpressionEvaluationContext flag for this case, and don't treat it as unevaluated in C++11. This fixes some crash-on-invalids where we would allow references to class members in potentially-evaluated constant expressions in static member functions, and also fixes half of PR10177. The fix to PR10177 exposed a case where template instantiation failed to provide a source location for a diagnostic, so TreeTransform has been tweaked to supply source locations when transforming a type. The source location is still not very good, but MarkDeclarationsReferencedInType would need to operate on a TypeLoc to improve it further. Also fix MarkDeclarationReferenced in C++98 mode to trigger instantiation for static data members of class templates which are used in constant expressions. This fixes a link-time problem, but we still incorrectly treat the member as non-constant. The rest of the fix for that issue is blocked on PCH support for early-instantiated static data members, which will be added in a subsequent patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146955 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20Fix tentative parsing so it knows how to handle an ambiguous ↵Eli Friedman
for-range-declaration. PR11601. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146953 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20Remove some extraneous carriage returns from these files. One of theChandler Carruth
Windows subversion clients isn't setup to default to eol:native again... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146952 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20Refine error diagnostic for using bridged casts when not using ARC.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146938 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-20Detect when mapping a #include/#import over to a submodule ends upDouglas Gregor
hitting a submodule that was never actually created, e.g., because that header wasn't parsed. In such cases, complain (because the module's umbrella headers don't cover everything) and fall back to including the header. Later, we'll add a warning at module-build time to catch all such cases. However, this fallback is important to eliminate assertions in the ASTWriter when this happens. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146933 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19Mark the calls to the _setjmp function as returns twice. ↵Bill Wendling
<rdar://problem/10492556> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146926 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19Switch a few callers of MakeAddrLValue places over to ↵Eli Friedman
MakeNaturalAlignAddrLValue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146920 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19objc-arc: bridge casts in non-arc mode are nowFariborz Jahanian
error. // rdar://10597832 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146918 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19Evaluation support for ExprWithCleanups. We won't evaluate any expression whichRichard Smith
actually requires non-trivial cleanups, so no cleanups need to be performed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146916 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19Improve r146813 (for PR11595) to give an appropriate diagnostic.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146915 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19loads also handled of course.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146910 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19Fix PR5279 - don't sliently drop alignment information on stores of types ↵Chris Lattner
that have alignment less than the natural alignment of the type when it comes from a typedef. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146908 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19filecheckize.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146907 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19rename test.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146906 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19Eliminate the first->last redeclaration map from the AST fileDouglas Gregor
format. It's no longer being used, now that we have a new implementation of redeclaration chains. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146905 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19objc-arc: bridge casts in non-objc-arc mode are ignord.Fariborz Jahanian
But, warn too. // rdar://10597832 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146904 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19Remove ASTReader's PendingForwardRefs, which is now handled by theDouglas Gregor
(more general) fix-up of definition data pointers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146903 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19Attempt to fix test in Release builds.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146898 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19Fix typo 'typdefs', from Nikola SmiljanicDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146894 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19Once we have fully deserialized a redeclaration chain for somethingDouglas Gregor
with a definition pointer (e.g., C++ and Objective-C classes), zip through the redeclaration chain to make sure that all of the declarations point to the definition data. As part of this, realized again why the first redeclaration of an entity in a file is important, and brought back that idea. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146886 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19Re-implement (de-)serialization of redeclaration chains forDouglas Gregor
redeclaration templates (RedeclarableTemplateDecl), similarly to the way (de-)serialization is implemented for Redeclarable<T>. In the process, found a simpler formulation for handling redeclaration chains and implemented that in both places. The new test establishes that we're building the redeclaration chains properly. However, the FIXME indicates where we're tickling a different bug that has to do with us not setting the DefinitionData pointer properly in redeclarations that we detected after the definition itself was deserialized. The (separable) fix for that bug is forthcoming. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146883 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19Add a triple to the test.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146871 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-19The submodule offset map can introduce "empty" remapping entries forDouglas Gregor
imported modules that don't introduce any new entities of a particular kind. Allow these entries to be replaced with entries for another loaded module. In the included test case, selectors exhibit this behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146870 91177308-0d34-0410-b5e6-96231b3b80d8