]> granicus.if.org Git - clang/log
clang
12 years agoUse a more efficient container for these values. Also reserve space when using a
Bill Wendling [Tue, 7 Feb 2012 00:13:27 +0000 (00:13 +0000)]
Use a more efficient container for these values. Also reserve space when using a
std::vector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149936 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse a SmallVector instead of std::vector. This improves compilation time in
Bill Wendling [Tue, 7 Feb 2012 00:04:27 +0000 (00:04 +0000)]
Use a SmallVector instead of std::vector. This improves compilation time in
445.gobmk by ~1.7%.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149935 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't recalculate the size of the array each time through the for-loop.
Bill Wendling [Mon, 6 Feb 2012 23:46:08 +0000 (23:46 +0000)]
Don't recalculate the size of the array each time through the for-loop.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149933 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMinor comment clarification.
Eli Friedman [Mon, 6 Feb 2012 23:34:35 +0000 (23:34 +0000)]
Minor comment clarification.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149931 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix a minor regression from my potentially-evaluated expression changes.
Eli Friedman [Mon, 6 Feb 2012 23:29:57 +0000 (23:29 +0000)]
Fix a minor regression from my potentially-evaluated expression changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149930 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRelax valid location check. This fixes a clang crash while emitting debug info for...
Devang Patel [Mon, 6 Feb 2012 23:24:13 +0000 (23:24 +0000)]
Relax valid location check. This fixes a clang crash while emitting debug info for properties that are synthesized by the compiler by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149929 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agobuild wide strings with ConstantDataArray, just because we can.
Chris Lattner [Mon, 6 Feb 2012 22:52:04 +0000 (22:52 +0000)]
build wide strings with ConstantDataArray, just because we can.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149928 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoimprove the code that handles IR generation of byte-sized string literals to avoid
Chris Lattner [Mon, 6 Feb 2012 22:47:00 +0000 (22:47 +0000)]
improve the code that handles IR generation of byte-sized string literals to avoid
allocating an std::string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149924 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdded source location for the template keyword in DependentTemplateSpecializationType...
Abramo Bagnara [Mon, 6 Feb 2012 22:45:07 +0000 (22:45 +0000)]
Added source location for the template keyword in DependentTemplateSpecializationTypeLoc nodes (DTSTLoc).

The new info is propagated to TSTLoc on template instantiation, getting rid of 3 FIXMEs in TreeTransform.h and another one Parser.cpp.

Simplified code in TypeSpecLocFiller visitor methods for DTSTLoc and DependentNameTypeLoc by removing what now seems to be dead code (adding corresponding assertions).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149923 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agouse cheaper llvm APIs for various bits of IR generation.
Chris Lattner [Mon, 6 Feb 2012 22:16:34 +0000 (22:16 +0000)]
use cheaper llvm APIs for various bits of IR generation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149916 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agosimplify code and smallvectorize.
Chris Lattner [Mon, 6 Feb 2012 22:00:56 +0000 (22:00 +0000)]
simplify code and smallvectorize.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149915 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCanonicalize the base class used in the nested-name-specifier of a generated
Manuel Klimek [Mon, 6 Feb 2012 21:51:39 +0000 (21:51 +0000)]
Canonicalize the base class used in the nested-name-specifier of a generated
assignment operator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149909 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix the result of VarDecl::checkInitIsICE so it is consistently accurate in C++11...
Eli Friedman [Mon, 6 Feb 2012 21:50:18 +0000 (21:50 +0000)]
Fix the result of VarDecl::checkInitIsICE so it is consistently accurate in C++11 mode.  PR11928.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149908 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTweak format string checking to work with %@ and ObjC toll-free bridging. <rdar...
Ted Kremenek [Mon, 6 Feb 2012 21:45:29 +0000 (21:45 +0000)]
Tweak format string checking to work with %@ and ObjC toll-free bridging.  <rdar://problem/10814120>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149907 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdded MSVC visualizers for PointerIntPair and PointerUnions.
Aaron Ballman [Mon, 6 Feb 2012 20:47:31 +0000 (20:47 +0000)]
Added MSVC visualizers for PointerIntPair and PointerUnions.

Patch by Nikola Smiljanic

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149896 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRewrite the debug action handling to take -verify into account.
Eric Christopher [Mon, 6 Feb 2012 19:43:51 +0000 (19:43 +0000)]
Rewrite the debug action handling to take -verify into account.
Add a quiet option for dwarfdump and move it out of NDEBUG only.
Still requires an option as we don't want this on by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149894 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUpdate the command line here and update the comment, we're just going
Eric Christopher [Mon, 6 Feb 2012 19:13:09 +0000 (19:13 +0000)]
Update the command line here and update the comment, we're just going
to leave this as a debug only option for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149890 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemoved redundant location info from ElaboratedTypeLoc / DependentNameLoc / Dependent...
Abramo Bagnara [Mon, 6 Feb 2012 19:09:27 +0000 (19:09 +0000)]
Removed redundant location info from ElaboratedTypeLoc / DependentNameLoc / DependentTSTLoc. Uniformed names referencing elaborated keyword. No intended functionality changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149889 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjc: fixes a problem in block type comparison involving
Fariborz Jahanian [Mon, 6 Feb 2012 19:06:20 +0000 (19:06 +0000)]
objc: fixes a problem in block type comparison involving
enums with underlying type explicitly specified
(feature which is on by default in objective-c).
// rdar://10798770

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149888 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoLet an ivar directly refer property TAG.
Devang Patel [Mon, 6 Feb 2012 18:20:02 +0000 (18:20 +0000)]
Let an ivar directly refer property TAG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149881 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago- Turn the other distribution checks into range compares.
Benjamin Kramer [Mon, 6 Feb 2012 15:33:06 +0000 (15:33 +0000)]
- Turn the other distribution checks into range compares.
- Turn openSUSE version parsing into a StringSwitch
- Add an entry for Fedora release 16 (Verne)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149872 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdded location for template keyword in TemplateSpecializationTypeLoc. In the process...
Abramo Bagnara [Mon, 6 Feb 2012 14:41:24 +0000 (14:41 +0000)]
Added location for template keyword in TemplateSpecializationTypeLoc. In the process removed some naming ambiguities.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149870 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoConsolidate the ubuntu detection logic a bit, add an entry for Ubuntu 12.04 aka preci...
Benjamin Kramer [Mon, 6 Feb 2012 14:36:09 +0000 (14:36 +0000)]
Consolidate the ubuntu detection logic a bit, add an entry for Ubuntu 12.04 aka precise pangolin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149869 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixed instantiation of DependentScopeDeclRefExpr.
Abramo Bagnara [Mon, 6 Feb 2012 14:31:00 +0000 (14:31 +0000)]
Fixed instantiation of DependentScopeDeclRefExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149868 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove instantiateTemplateAttribute into the sema namespace, make helpers static.
Benjamin Kramer [Mon, 6 Feb 2012 11:13:08 +0000 (11:13 +0000)]
Move instantiateTemplateAttribute into the sema namespace, make helpers static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149864 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTest for r149855.
Craig Topper [Mon, 6 Feb 2012 08:31:19 +0000 (08:31 +0000)]
Test for r149855.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149862 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix vector splat casts to cast element to the appropriate vector element before inser...
Craig Topper [Mon, 6 Feb 2012 05:05:50 +0000 (05:05 +0000)]
Fix vector splat casts to cast element to the appropriate vector element before inserting into the vector. Fixes PR11930.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149855 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement name mangling for scalar value initialization. Reported on IRC by Xeo.
Richard Smith [Mon, 6 Feb 2012 02:54:51 +0000 (02:54 +0000)]
Implement name mangling for scalar value initialization. Reported on IRC by Xeo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149854 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoInvalid O levels on the command line no longer have a confusing error.
Aaron Ballman [Mon, 6 Feb 2012 00:40:31 +0000 (00:40 +0000)]
Invalid O levels on the command line no longer have a confusing error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149852 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[clang.py] Implement Type.is_pod
Gregory Szorc [Sun, 5 Feb 2012 19:42:06 +0000 (19:42 +0000)]
[clang.py] Implement Type.is_pod

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149842 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[clang.py] Change type -> Type
Tobias Grosser [Sun, 5 Feb 2012 12:15:56 +0000 (12:15 +0000)]
[clang.py] Change type -> Type

Names that have corresponding classes in python are commonly started with an
uppercase letter. Let's follow that convention.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149831 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[clang.py] Implement Cursor.enum_type
Tobias Grosser [Sun, 5 Feb 2012 11:42:25 +0000 (11:42 +0000)]
[clang.py] Implement Cursor.enum_type

Contributed by: Gregory Szorc <gregory.szorc@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149830 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[clang.py] Implement Cursor.underlying_typedef_type
Tobias Grosser [Sun, 5 Feb 2012 11:42:20 +0000 (11:42 +0000)]
[clang.py] Implement Cursor.underlying_typedef_type

Contributed by: Gregory Szorc <gregory.szorc@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149829 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[clang.py] add TypeKind.VECTOR
Tobias Grosser [Sun, 5 Feb 2012 11:42:14 +0000 (11:42 +0000)]
[clang.py] add TypeKind.VECTOR

Added a missing enumeration.

Contributed by: Gregory Szorc <gregory.szorc@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149828 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[clang.py] Add CursorKind.{is_translation_unit, is_preprocessing, is_unexposed}
Tobias Grosser [Sun, 5 Feb 2012 11:42:09 +0000 (11:42 +0000)]
[clang.py] Add CursorKind.{is_translation_unit, is_preprocessing, is_unexposed}

Contributed by: Gregory Szorc <gregory.szorc@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149827 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[clang.py] Implement Cursor.hash
Tobias Grosser [Sun, 5 Feb 2012 11:42:03 +0000 (11:42 +0000)]
[clang.py] Implement Cursor.hash

Contributed by: Gregory Szorc <gregory.szorc@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149826 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[clang.py] Expose diagnostic category and option info to Python binding
Tobias Grosser [Sun, 5 Feb 2012 11:41:58 +0000 (11:41 +0000)]
[clang.py] Expose diagnostic category and option info to Python binding

Contributed by: Gregory Szorc <gregory.szorc@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149825 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[clang.py] Implement __eq__ and __ne__ on SourceLocation and SourceRange
Tobias Grosser [Sun, 5 Feb 2012 11:40:59 +0000 (11:40 +0000)]
[clang.py] Implement __eq__ and __ne__ on SourceLocation and SourceRange

There is no type checking in __eq__, so ctypes will throw if the wrong
Python type is passed in to the C function. Personally, I feel garbage
in means garbage out and it isn't worth testing for this explicitly.

Contributed by: Gregory Szorc <gregory.szorc@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149824 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix a typo (builting -> builtin).
Benjamin Kramer [Sun, 5 Feb 2012 11:24:56 +0000 (11:24 +0000)]
Fix a typo (builting -> builtin).

Patch by Afriza N. Arief!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149822 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove operator overload out of line. Calling operator<< on a forward declared type...
Benjamin Kramer [Sun, 5 Feb 2012 09:46:30 +0000 (09:46 +0000)]
Move operator overload out of line. Calling operator<< on a forward declared type doesn't seem to work on MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149819 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixing a warning in MSVC (this is also a test commit)
Aaron Ballman [Sun, 5 Feb 2012 03:08:16 +0000 (03:08 +0000)]
Fixing a warning in MSVC (this is also a test commit)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149806 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoconstexpr: Implement DR1358: An instantiation of a constexpr function which
Richard Smith [Sun, 5 Feb 2012 02:30:54 +0000 (02:30 +0000)]
constexpr: Implement DR1358: An instantiation of a constexpr function which
can't produce a constant expression is not ill-formed (so long as some
instantiation of that function can produce a constant expression).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149802 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoreapply the patches reverted in r149477, which enable ConstantDataArray.
Chris Lattner [Sun, 5 Feb 2012 02:30:40 +0000 (02:30 +0000)]
reapply the patches reverted in r149477, which enable ConstantDataArray.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149801 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoBasic: import SmallString<> into clang namespace
Dylan Noblesmith [Sun, 5 Feb 2012 02:13:05 +0000 (02:13 +0000)]
Basic: import SmallString<> into clang namespace

(I was going to fix the TODO about DenseMap too, but
that would break self-host right now. See PR11922.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149799 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoBasic: import OwningPtr<> into clang namespace
Dylan Noblesmith [Sun, 5 Feb 2012 02:12:40 +0000 (02:12 +0000)]
Basic: import OwningPtr<> into clang namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149798 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTry to fix Benjamin's r149781 on MSVC.
NAKAMURA Takumi [Sun, 5 Feb 2012 02:00:07 +0000 (02:00 +0000)]
Try to fix Benjamin's r149781 on MSVC.

MSVC has complained the definition of "inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB, CanQualType T)" in clang/AST/CanonicalType.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149797 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoconstexpr: Fix implementation of DR1311: check for volatile qualifiers in
Richard Smith [Sun, 5 Feb 2012 01:23:16 +0000 (01:23 +0000)]
constexpr: Fix implementation of DR1311: check for volatile qualifiers in
lvalue-to-rvalue conversions on the source type of the conversion, not the
target type (which has them removed for non-class types).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149796 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPreserve alignment for Neon vld1_lane/dup and vst1_lane intrinsics.
Bob Wilson [Sat, 4 Feb 2012 23:58:08 +0000 (23:58 +0000)]
Preserve alignment for Neon vld1_lane/dup and vst1_lane intrinsics.

We had been generating load/store instructions with the default alignment
for the vector element type, even when the pointer argument had less alignment.
<rdar://problem/10538555>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149794 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSkip freebsd driver test when ppc32/ppc64 targets are not configured.
Bob Wilson [Sat, 4 Feb 2012 23:15:59 +0000 (23:15 +0000)]
Skip freebsd driver test when ppc32/ppc64 targets are not configured.

Otherwise, the clang driver falls back to invoking gcc and the ppc tests
fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149793 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoA useful approximation of initializer list constructors.
Sebastian Redl [Sat, 4 Feb 2012 21:27:47 +0000 (21:27 +0000)]
A useful approximation of initializer list constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149792 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFactor out the actual overload resolution from TryConstructorInitialization, since...
Sebastian Redl [Sat, 4 Feb 2012 21:27:39 +0000 (21:27 +0000)]
Factor out the actual overload resolution from TryConstructorInitialization, since it needs to be used again for list constructor resolution.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149791 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't unwrap initializer lists before calling TryConstructorInitialization, instead...
Sebastian Redl [Sat, 4 Feb 2012 21:27:33 +0000 (21:27 +0000)]
Don't unwrap initializer lists before calling TryConstructorInitialization, instead doing a little more work inside. This should make finding initializer list constructors easier, as well as fix one place where the ({}) vs {} issue was probably poorly handled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149790 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove an unused and unimplemented function prototype.
Sebastian Redl [Sat, 4 Feb 2012 21:27:28 +0000 (21:27 +0000)]
Remove an unused and unimplemented function prototype.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149789 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAlso, these objc++ rewriter tests are meant to run in NeXt's
Fariborz Jahanian [Sat, 4 Feb 2012 19:06:06 +0000 (19:06 +0000)]
Also, these objc++ rewriter tests are meant to run in NeXt's
fragile-abi mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149788 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThese tests are intended to run in NeXt's legacy objective-c abi (fragile-abi).
Fariborz Jahanian [Sat, 4 Feb 2012 18:56:43 +0000 (18:56 +0000)]
These tests are intended to run in NeXt's legacy objective-c abi (fragile-abi).
Make this explicit since default is now nonfragile-abi.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149787 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSome compilers do require Diagnostic.h to be present here.
Benjamin Kramer [Sat, 4 Feb 2012 14:13:11 +0000 (14:13 +0000)]
Some compilers do require Diagnostic.h to be present here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149785 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't include Diagnostics.h twice when it's required zero times.
Benjamin Kramer [Sat, 4 Feb 2012 14:09:30 +0000 (14:09 +0000)]
Don't include Diagnostics.h twice when it's required zero times.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149784 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove a method from IdentifierTable.h out of line and remove the SmallString include.
Benjamin Kramer [Sat, 4 Feb 2012 13:45:25 +0000 (13:45 +0000)]
Move a method from IdentifierTable.h out of line and remove the SmallString include.

Fix all the transitive include users.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149783 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove Diagnostic.h include from Preprocessor.h.
Benjamin Kramer [Sat, 4 Feb 2012 13:02:15 +0000 (13:02 +0000)]
Remove Diagnostic.h include from Preprocessor.h.

- Move the offending methods out of line and fix transitive includers.
- This required changing an enum in the PPCallback API into an unsigned.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149782 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove various diagnostic operator<< overloads out of line and remove includes of Diagn...
Benjamin Kramer [Sat, 4 Feb 2012 12:31:12 +0000 (12:31 +0000)]
Move various diagnostic operator<< overloads out of line and remove includes of Diagnostic.h.

Fix all the files that depended on transitive includes of Diagnostic.h.
With this patch in place changing a diagnostic no longer requires a full rebuild of the StaticAnalyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149781 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMove Storage and StorageAllocator out of the PartialDiagnostic class so we can forwar...
Benjamin Kramer [Sat, 4 Feb 2012 12:30:46 +0000 (12:30 +0000)]
Move Storage and StorageAllocator out of the PartialDiagnostic class so we can forward declare them.

Let ASTContext allocate the storage in its BumpPtrAllocator.
This will help us remove ASTContext's depedency on PartialDiagnostic.h soon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149780 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoStaticAnalyzer: Remove FixIts from PathDiagnosticPieces.
Benjamin Kramer [Sat, 4 Feb 2012 12:30:37 +0000 (12:30 +0000)]
StaticAnalyzer: Remove FixIts from PathDiagnosticPieces.

They were unused and pulled in Diagnostic.h for no reason.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149779 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIn C++11 mode, when an integral constant expression is desired and we have a
Richard Smith [Sat, 4 Feb 2012 09:53:13 +0000 (09:53 +0000)]
In C++11 mode, when an integral constant expression is desired and we have a
value of class type, look for a unique conversion operator converting to
integral or unscoped enumeration type and use that. Implements [expr.const]p5.

Sema::VerifyIntegerConstantExpression now performs the conversion and returns
the converted result. Some important callers of Expr::isIntegralConstantExpr
have been switched over to using it (including all of those required for C++11
conformance); this switch brings a side-benefit of improved diagnostics and, in
several cases, simpler code. However, some language extensions and attributes
have not been moved across and will not perform implicit conversions on
constant expressions of literal class type where an ICE is required.

In passing, fix static_assert to perform a contextual conversion to bool on its
argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149776 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't allow a value of a scoped enumeration to be used as the first bound for an
Richard Smith [Sat, 4 Feb 2012 07:07:42 +0000 (07:07 +0000)]
Don't allow a value of a scoped enumeration to be used as the first bound for an
array new expression. This lays some groundwork for the implicit conversion to
integral or unscoped enumeration which C++11 ICEs undergo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149772 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Make sure Containers OutOfBounds checker does not crash on undefined argum...
Anna Zaks [Sat, 4 Feb 2012 06:40:52 +0000 (06:40 +0000)]
[analyzer] Make sure Containers OutOfBounds checker does not crash on undefined arguments, when CF functions are called with wrong number of arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149771 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDisallow constexpr main.
Richard Smith [Sat, 4 Feb 2012 06:10:17 +0000 (06:10 +0000)]
Disallow constexpr main.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149770 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix a rejects-valid in C++11: array new of a negative size, or overflowing array
Richard Smith [Sat, 4 Feb 2012 05:35:53 +0000 (05:35 +0000)]
Fix a rejects-valid in C++11: array new of a negative size, or overflowing array
new, is well-formed with defined semantics of throwing (a type which can be
caught by a handler for) std::bad_array_new_length, unlike in C++98 where it is
somewhere nebulous between undefined behavior and ill-formed.

If the array size is an integral constant expression and satisfies one of these
criteria, we would previous the array new expression, but now in C++11 mode, we
merely issue a warning (the code is still rejected in C++98 mode, naturally).

We don't yet implement new C++11 semantics correctly (see PR11644), but we do
implement the overflow checking, and (for the default operator new) convert such
expressions to an exception, so accepting such code now does not seem especially
unsafe.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149767 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUnbreak failing test added in r149738.
Richard Smith [Sat, 4 Feb 2012 05:33:36 +0000 (05:33 +0000)]
Unbreak failing test added in r149738.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149766 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoArrayRef goodness in MultiplexConsumer, no functionality change.
Argyrios Kyrtzidis [Sat, 4 Feb 2012 05:23:00 +0000 (05:23 +0000)]
ArrayRef goodness in MultiplexConsumer, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149764 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove unused field from FixItRecompile.
Argyrios Kyrtzidis [Sat, 4 Feb 2012 04:53:03 +0000 (04:53 +0000)]
Remove unused field from FixItRecompile.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149762 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't warn on use of default allocator with an over-aligned type when the
Nick Lewycky [Sat, 4 Feb 2012 03:30:14 +0000 (03:30 +0000)]
Don't warn on use of default allocator with an over-aligned type when the
allocator is given the pointer to allocate into.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149760 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix ASTMerge tests that I broke in my previous commit.
Argyrios Kyrtzidis [Sat, 4 Feb 2012 03:26:16 +0000 (03:26 +0000)]
Fix ASTMerge tests that I broke in my previous commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149759 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoautoconf: update config header
Dylan Noblesmith [Sat, 4 Feb 2012 02:38:34 +0000 (02:38 +0000)]
autoconf: update config header

Sync with the change in r149652.

Also fix the comment to sync with LLVM's config.h header.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149748 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Turn on by default two checkers:
Anna Zaks [Sat, 4 Feb 2012 02:31:57 +0000 (02:31 +0000)]
[analyzer] Turn on by default two checkers:
 - osx.coreFoundation.containers.IndexOutOfBounds
 - osx.cocoa.SelfInit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149747 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] fixup to the previous commit.
Anna Zaks [Sat, 4 Feb 2012 02:31:53 +0000 (02:31 +0000)]
[analyzer] fixup to the previous commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149746 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Minor cleanups to the ObjCSelfInitChecker.
Anna Zaks [Sat, 4 Feb 2012 02:31:37 +0000 (02:31 +0000)]
[analyzer] Minor cleanups to the ObjCSelfInitChecker.
(Also renames in other ObjC checkers to create one category of checks.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149745 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFixed some testsuite problems introduced by my
Sean Callanan [Sat, 4 Feb 2012 02:28:18 +0000 (02:28 +0000)]
Fixed some testsuite problems introduced by my
last commit.  Sorry for the outage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149744 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoComment mystery code.
Nick Lewycky [Sat, 4 Feb 2012 02:16:48 +0000 (02:16 +0000)]
Comment mystery code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149742 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert r149721. chapuni tells me akyrtzi already fixed the test
Nico Weber [Sat, 4 Feb 2012 01:50:30 +0000 (01:50 +0000)]
Revert r149721. chapuni tells me akyrtzi already fixed the test
by adding a triple, and the typedef makes things worse on windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149740 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse variable in place of multiple CI.getFrontendOpts() calls and use a bit
Argyrios Kyrtzidis [Sat, 4 Feb 2012 01:36:04 +0000 (01:36 +0000)]
Use variable in place of multiple CI.getFrontendOpts() calls and use a bit
of ArrayRef goodness. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149739 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoNew test case.
Devang Patel [Sat, 4 Feb 2012 01:30:45 +0000 (01:30 +0000)]
New test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149738 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoClang has existing support for debuggers that
Sean Callanan [Sat, 4 Feb 2012 01:29:37 +0000 (01:29 +0000)]
Clang has existing support for debuggers that
want to provide "po"-like functionality which
treats the result of an expression implicitly as
"id" (if it is not otherwise known) and prints
it as an Objective-C object.

This has in the past been gated by the
"DebuggerSupport" language option, but that is
too general.  Debuggers also provide other commands
like "print" that do not make any assumptions
about whether the object is an Objective-C object.

This patch makes the assumption conditional on a
new language option: DebuggerCastResultToId.  I
have also made corresponding modifications to the
testsuite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149735 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoCreate new tag for the property. This is a work in progress.
Devang Patel [Sat, 4 Feb 2012 01:15:04 +0000 (01:15 +0000)]
Create new tag for the property. This is a work in progress.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149734 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] Stick to the silly notion that a forward class/protocol
Argyrios Kyrtzidis [Sat, 4 Feb 2012 01:04:58 +0000 (01:04 +0000)]
[libclang] Stick to the silly notion that a forward class/protocol
declaration is a reference. rdar://10749990

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149733 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSuppress the used-but-not-defined warning for static data members while I look into...
Eli Friedman [Sat, 4 Feb 2012 00:54:05 +0000 (00:54 +0000)]
Suppress the used-but-not-defined warning for static data members while I look into a rather nasty bug in the new odr-use marking code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149731 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoconstexpr:
Richard Smith [Sat, 4 Feb 2012 00:33:54 +0000 (00:33 +0000)]
constexpr:
  The recent support for potential constant expressions exposed a bug in the
  implementation of libstdc++4.6, where numeric_limits<int>::min() is defined
  as (int)1 << 31, which isn't a constant expression. Disable the 'constexpr
  function never produces a constant expression' error inside system headers
  to compensate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149729 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUpdate tests so that they don't rely upon LLVMDebugVersion number.
Devang Patel [Fri, 3 Feb 2012 23:58:39 +0000 (23:58 +0000)]
Update tests so that they don't rely upon LLVMDebugVersion number.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149726 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake _mm_cmpgt_epi8 immute to -funsigned-char.
Nick Lewycky [Fri, 3 Feb 2012 23:57:48 +0000 (23:57 +0000)]
Make _mm_cmpgt_epi8 immute to -funsigned-char.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149725 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTry to get test passing on windows.
Nico Weber [Fri, 3 Feb 2012 23:36:13 +0000 (23:36 +0000)]
Try to get test passing on windows.

Idea by Jean-Daniel Dupas.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149721 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake explicit captures which cause implicit captures work correctly.
Eli Friedman [Fri, 3 Feb 2012 23:06:43 +0000 (23:06 +0000)]
Make explicit captures which cause implicit captures work correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149719 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement implicit capture for lambda expressions.
Eli Friedman [Fri, 3 Feb 2012 22:47:37 +0000 (22:47 +0000)]
Implement implicit capture for lambda expressions.

Still left: explicit captures in lambdas need to cause implicit capture, and I need to take a look at the diagnostics for some cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149718 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake sure that the layout-override parser grabs the size, not the data
Douglas Gregor [Fri, 3 Feb 2012 19:31:51 +0000 (19:31 +0000)]
Make sure that the layout-override parser grabs the size, not the data
size. Otherwise, we can end up with bogus layouts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149703 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen a pack expansion occurs in the template argument list of an alias
Douglas Gregor [Fri, 3 Feb 2012 17:16:23 +0000 (17:16 +0000)]
When a pack expansion occurs in the template argument list of an alias
template without a corresponding parameter pack, don't immediately
substitute the alias template. This is under discussion in the C++
committee, and may become ill-formed, but for now we match GCC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149697 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a triple to test/SemaObjC/format-strings-objc.m to make it pass in windows hosts.
Argyrios Kyrtzidis [Fri, 3 Feb 2012 17:13:43 +0000 (17:13 +0000)]
Add a triple to test/SemaObjC/format-strings-objc.m to make it pass in windows hosts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149696 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDon't warn about anonymous struct/union in C11.
Hans Wennborg [Fri, 3 Feb 2012 15:47:04 +0000 (15:47 +0000)]
Don't warn about anonymous struct/union in C11.

Also, in C, call this a C11 extension rather than a GNU extension.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149695 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement support for a pack expansion into a fixed-length
Douglas Gregor [Fri, 3 Feb 2012 07:34:46 +0000 (07:34 +0000)]
Implement support for a pack expansion into a fixed-length
template. Such pack expansions can easily fail at template
instantiation time, if the expanded parameter packs are of the wrong
length. Fixes <rdar://problem/10040867>, PR9021, and the example that
came up today at Going Native.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149685 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Testing: add automated reference results reset.
Anna Zaks [Fri, 3 Feb 2012 06:35:23 +0000 (06:35 +0000)]
[analyzer] Testing: add automated reference results reset.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149682 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix -ftrap-function fallout from llvm r145714. <rdar://problem/10799325>
Bob Wilson [Fri, 3 Feb 2012 06:27:22 +0000 (06:27 +0000)]
Fix -ftrap-function fallout from llvm r145714.  <rdar://problem/10799325>

That llvm change removed the -trap-func backend option, so that using
-ftrap-function with clang would cause the backend to complain.  Fix it
by adding the trap function name to the CodeGenOptions and passing it through
to the TargetOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149679 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoChange Lexer::makeFileCharRange() to have it accept a CharSourceRange
Argyrios Kyrtzidis [Fri, 3 Feb 2012 05:58:29 +0000 (05:58 +0000)]
Change Lexer::makeFileCharRange() to have it accept a CharSourceRange
instead of a SourceRange, and handle the case where the range is
a char (not token) range.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149677 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoChange the fixed array of FixitHints to a SmallVector to lift off
Argyrios Kyrtzidis [Fri, 3 Feb 2012 05:58:22 +0000 (05:58 +0000)]
Change the fixed array of FixitHints to a SmallVector to lift off
the limit on the number of fixits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149676 91177308-0d34-0410-b5e6-96231b3b80d8