]> granicus.if.org Git - clang/log
clang
12 years agoobjc rewriter: modern metadata for protocol decls. wip.
Fariborz Jahanian [Tue, 7 Feb 2012 20:15:08 +0000 (20:15 +0000)]
objc rewriter: modern metadata for protocol decls. wip.

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

12 years agoIn r149662, setDiagnosticMapping was modified to not allow warnings mapped to
Chad Rosier [Tue, 7 Feb 2012 19:55:45 +0000 (19:55 +0000)]
In r149662, setDiagnosticMapping was modified to not allow warnings mapped to
MAP_ERROR to be remapped to MAP_WARNING.  These new APIs are being added to
allow the diagnostic mapping's "no Werror" bit to be set, and potentially
downgrade anything already mapped to be a warning.

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

12 years agoMake use of const-correct ParseCommandLineOptions
David Blaikie [Tue, 7 Feb 2012 19:36:38 +0000 (19:36 +0000)]
Make use of const-correct ParseCommandLineOptions

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

12 years agoImplements support of format_arg attribute on C++ member.
Jean-Daniel Dupas [Tue, 7 Feb 2012 19:01:42 +0000 (19:01 +0000)]
Implements support of format_arg attribute on C++ member.

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

12 years agoRemove tabs.
Devang Patel [Tue, 7 Feb 2012 18:55:08 +0000 (18:55 +0000)]
Remove tabs.

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

12 years agoEmit debug info for properites that are not backed by an ivar.
Devang Patel [Tue, 7 Feb 2012 18:40:30 +0000 (18:40 +0000)]
Emit debug info for properites that are not backed by an ivar.

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

12 years agoobjc rewriter: start supporting modern objective-c abi
Fariborz Jahanian [Tue, 7 Feb 2012 17:11:38 +0000 (17:11 +0000)]
objc rewriter: start supporting modern objective-c abi
in objective-c rewriter. wip.

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

12 years agoMake parsing of objc @implementations more robust.
Argyrios Kyrtzidis [Tue, 7 Feb 2012 16:50:53 +0000 (16:50 +0000)]
Make parsing of objc @implementations more robust.

Parsing of @implementations was based on modifying global state from
the parser; the logic for late parsing of methods was spread in multiple places
making it difficult to have a robust error recovery.

  -it was difficult to ensure that we don't neglect parsing the lexed methods.
  -it was difficult to setup the original objc container context for parsing the lexed methods
   after completing ParseObjCAtImplementationDeclaration and returning to top level context.

Enhance parsing of @implementations by centralizing it in Parser::ParseObjCAtImplementationDeclaration().
ParseObjCAtImplementationDeclaration now returns only after an @implementation is fully parsed;
all the data and logic for late parsing of methods is now in one place.

This allows us to provide code-completion for late parsed methods with mis-matched braces.
rdar://10775381

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

12 years agoHex literals without a significand no longer crash the lexer. Fixes bug 7910
Aaron Ballman [Tue, 7 Feb 2012 13:46:03 +0000 (13:46 +0000)]
Hex literals without a significand no longer crash the lexer.  Fixes bug 7910

Patch by Eitan Adler

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

12 years agoPrint NamedDecls directly to a raw_ostream where possible.
Benjamin Kramer [Tue, 7 Feb 2012 11:57:57 +0000 (11:57 +0000)]
Print NamedDecls directly to a raw_ostream where possible.

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

12 years agoSwitch the ObjC*Decl raw_stream overloads to take a reference, for consistency with...
Benjamin Kramer [Tue, 7 Feb 2012 11:57:45 +0000 (11:57 +0000)]
Switch the ObjC*Decl raw_stream overloads to take a reference, for consistency with NamedDecls.

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

12 years agoIntroduce basic ASTs for lambda expressions. This covers:
Douglas Gregor [Tue, 7 Feb 2012 10:09:13 +0000 (10:09 +0000)]
Introduce basic ASTs for lambda expressions. This covers:
  - Capturing variables by-reference and by-copy within a lambda
  - The representation of lambda captures
  - The creation of the non-static data members in the lambda class
  that store the captured variables
  - The initialization of the non-static data members from the
  captured variables
  - Pretty-printing lambda expressions

There are a number of FIXMEs, both explicit and implied, including:
  - Creating a field for a capture of 'this'
  - Improved diagnostics for initialization failures when capturing
  variables by copy
  - Dealing with temporaries created during said initialization
  - Template instantiation
  - AST (de-)serialization
  - Binding and returning the lambda expression; turning it into a
  proper temporary
  - Lots and lots of semantic constraints
  - Parameter pack captures

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

12 years agoUse SmallVector instead of std::vector.
Bill Wendling [Tue, 7 Feb 2012 09:40:07 +0000 (09:40 +0000)]
Use SmallVector instead of std::vector.

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

12 years agoUse 'ArrayRef<>' instead of 'std::vector<>&' for passed-in arguments.
Bill Wendling [Tue, 7 Feb 2012 09:25:09 +0000 (09:25 +0000)]
Use 'ArrayRef<>' instead of 'std::vector<>&' for passed-in arguments.

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

12 years agoCalculate the .size() of the vector once.
Bill Wendling [Tue, 7 Feb 2012 09:06:01 +0000 (09:06 +0000)]
Calculate the .size() of the vector once.

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

12 years agoReserve a moderate amount of space for the back-end arguments.
Bill Wendling [Tue, 7 Feb 2012 09:05:34 +0000 (09:05 +0000)]
Reserve a moderate amount of space for the back-end arguments.

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

12 years agoFix a bug in semantic analysis involving anonymous structs and flexible arrays.
Eli Friedman [Tue, 7 Feb 2012 05:00:47 +0000 (05:00 +0000)]
Fix a bug in semantic analysis involving anonymous structs and flexible arrays.

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

12 years agoFix a couple of nasty bugs involving negative enum constants. <rdar://problem/10760113>.
Eli Friedman [Tue, 7 Feb 2012 04:34:38 +0000 (04:34 +0000)]
Fix a couple of nasty bugs involving negative enum constants.  <rdar://problem/10760113>.

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

12 years agoUpdate test case.
Ted Kremenek [Tue, 7 Feb 2012 03:56:27 +0000 (03:56 +0000)]
Update test case.

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

12 years agoMake FunctionDecl::doesDeclarationForceExternallyVisibleDefinition use the same logic...
Eli Friedman [Tue, 7 Feb 2012 03:50:18 +0000 (03:50 +0000)]
Make FunctionDecl::doesDeclarationForceExternallyVisibleDefinition use the same logic as FunctionDecl::isInlineDefinitionExternallyVisible to figure out whether to emit a definition.  Based on work by Anton Yartsev.

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

12 years agoCreate PathDiagnosticCallEnter and PathDiagnosticCallExit, to remark calls in PathDia...
Ted Kremenek [Tue, 7 Feb 2012 02:27:37 +0000 (02:27 +0000)]
Create PathDiagnosticCallEnter and PathDiagnosticCallExit, to remark calls in PathDiagnostics from other events.  This will
have potential uses later.

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

12 years agoTweak BugReporter extensive diagnostics to not add edges between function calls.
Ted Kremenek [Tue, 7 Feb 2012 02:26:17 +0000 (02:26 +0000)]
Tweak BugReporter extensive diagnostics to not add edges between function calls.

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

12 years agoQuote name of function in path diagnostics.
Ted Kremenek [Tue, 7 Feb 2012 02:26:14 +0000 (02:26 +0000)]
Quote name of function in path diagnostics.

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

12 years agoRemove the unused TypoCorrectionConsumer::MaxEditDistance.
Kaelyn Uhrain [Tue, 7 Feb 2012 01:32:58 +0000 (01:32 +0000)]
Remove the unused TypoCorrectionConsumer::MaxEditDistance.

MaxEditDistance was effectively unused as it being initialized to the max
unsigned valued but never updated. Removing it avoids conversion
headaches once the "edit distance" of a typo correction is a weighted
composite of several values instead of roughly the number of characters
changed; comparing the weighted composite value to the number of
characters in a typo would require some form of normalization to make it
comparable to the old, character-based notion of edit distance.

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

12 years agoFilter a few more options not recognized by gcc. <rdar://problem/10814020>
Bob Wilson [Tue, 7 Feb 2012 01:17:55 +0000 (01:17 +0000)]
Filter a few more options not recognized by gcc.  <rdar://problem/10814020>

These are new options that gcc doesn't recognize so the clang driver needs
to remove them when it falls back to invoking gcc.

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

12 years agoAdd C11 FLT_TRUE_MIN and friends. <rdar://problem/10812837>.
Eli Friedman [Tue, 7 Feb 2012 01:02:19 +0000 (01:02 +0000)]
Add C11 FLT_TRUE_MIN and friends.  <rdar://problem/10812837>.

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

12 years ago[analyzer] Allow each CString check to be enabled/disabled
Anna Zaks [Tue, 7 Feb 2012 00:56:14 +0000 (00:56 +0000)]
[analyzer] Allow each CString check to be enabled/disabled
separately.

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

12 years agoBump up the initial vector size to avoid having to grow the vector more often.
Bill Wendling [Tue, 7 Feb 2012 00:54:58 +0000 (00:54 +0000)]
Bump up the initial vector size to avoid having to grow the vector more often.

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

12 years agosimplify a bunch of code to use the well-known LLVM IR types computed by CodeGenModule.
Chris Lattner [Tue, 7 Feb 2012 00:39:47 +0000 (00:39 +0000)]
simplify a bunch of code to use the well-known LLVM IR types computed by CodeGenModule.

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

12 years agotidy up code, make the common case (1-byte strings) come first
Chris Lattner [Tue, 7 Feb 2012 00:39:21 +0000 (00:39 +0000)]
tidy up code, make the common case (1-byte strings) come first

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

12 years agoAdd basic BugReporter support for CallEnter/CallExit. WIP.
Ted Kremenek [Tue, 7 Feb 2012 00:24:33 +0000 (00:24 +0000)]
Add basic BugReporter support for CallEnter/CallExit.  WIP.

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

12 years agoMisc improvements to the diagnostic when a variable is odr-used in a context that...
Eli Friedman [Tue, 7 Feb 2012 00:15:00 +0000 (00:15 +0000)]
Misc improvements to the diagnostic when a variable is odr-used in a context that is not allowed to capture variables.

Fixes PR11883.

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

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