]> granicus.if.org Git - clang/log
clang
14 years agoMore AltiVec support.
Anton Korobeynikov [Sat, 19 Jun 2010 09:47:18 +0000 (09:47 +0000)]
More AltiVec support.
Patch by Anton Yartsev!

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

14 years agoadd a libs-only target to the clang makefile, patch by Sunay Ismail
Chris Lattner [Sat, 19 Jun 2010 06:35:25 +0000 (06:35 +0000)]
add a libs-only target to the clang makefile, patch by Sunay Ismail
in PR7397

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

14 years agoFix for PR7415: refactor CodeGenModule::MayDeferGeneration and make it less
Eli Friedman [Sat, 19 Jun 2010 06:24:06 +0000 (06:24 +0000)]
Fix for PR7415: refactor CodeGenModule::MayDeferGeneration and make it less
conservative for static variables in templated classes.

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

14 years agoFix PR7097, a bad interaction between -fno-use-cxa-atexit and
Chris Lattner [Sat, 19 Jun 2010 05:52:45 +0000 (05:52 +0000)]
Fix PR7097, a bad interaction between -fno-use-cxa-atexit and
-mconstructor-aliases by using a WeakVH instead of a raw pointer.

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

14 years agoMore Sema Check and a test case for init_priority attr.
Fariborz Jahanian [Fri, 18 Jun 2010 23:14:53 +0000 (23:14 +0000)]
More Sema Check and a test case for init_priority attr.
(radar 8076356).

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

14 years agoFold additive constants, and support comparsions of the form $sym+const1 <> const2
Jordy Rose [Fri, 18 Jun 2010 22:49:11 +0000 (22:49 +0000)]
Fold additive constants, and support comparsions of the form $sym+const1 <> const2

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

14 years agointroduce a new CharSourceRange class, and enhance the diagnostics routines
Chris Lattner [Fri, 18 Jun 2010 22:45:06 +0000 (22:45 +0000)]
introduce a new CharSourceRange class, and enhance the diagnostics routines
to use them instead of SourceRange.  CharSourceRange is just a SourceRange
plus a bool that indicates whether the range has the end character resolved
or whether the end location is the start of the end token.  While most of
the compiler wants to think of ranges that have ends that are the start of
the end token, the printf diagnostic stuff wants to highlight ranges within
tokens.

This is transparent to the diagnostic stuff.  To start taking advantage of
the new capabilities, you can do something like this:
  Diag(..) << CharSourceRange::getCharRange(Begin,End)

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

14 years agoA trivial fix for a test case that's too horrible to commit. Fixes
Douglas Gregor [Fri, 18 Jun 2010 22:12:56 +0000 (22:12 +0000)]
A trivial fix for a test case that's too horrible to commit. Fixes
<rdar://problem/8108088>.

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

14 years agoImplements Sema part of init_priority(priority) attribute
Fariborz Jahanian [Fri, 18 Jun 2010 21:44:06 +0000 (21:44 +0000)]
Implements Sema part of init_priority(priority) attribute
(radar 8076356) - wip.

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

14 years agoDon't complain about missing field initializers when the initializer
Douglas Gregor [Fri, 18 Jun 2010 21:43:10 +0000 (21:43 +0000)]
Don't complain about missing field initializers when the initializer
list is completely empty, from Lasse Kärkkäinen! Fixes PR7413.

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

14 years agoMerge the "regparm" attribute from a previous declaration of a
Douglas Gregor [Fri, 18 Jun 2010 21:30:25 +0000 (21:30 +0000)]
Merge the "regparm" attribute from a previous declaration of a
function to redeclarations of that function. Fixes PR7025.

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

14 years agoJohn called for a less surprising cast
Gabor Greif [Fri, 18 Jun 2010 10:11:35 +0000 (10:11 +0000)]
John called for a less surprising cast

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

14 years agoMangle tag types (unions, structs, classes, enums) in the Microsoft C++ Mangler.
Charles Davis [Fri, 18 Jun 2010 07:51:00 +0000 (07:51 +0000)]
Mangle tag types (unions, structs, classes, enums) in the Microsoft C++ Mangler.

Also, test that static members with default visibility in a struct have the
right mangling.

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

14 years agoPrintf format strings: Added some more tests and fixed some minor bugs.
Tom Care [Fri, 18 Jun 2010 03:02:16 +0000 (03:02 +0000)]
Printf format strings: Added some more tests and fixed some minor bugs.
- Precision toStrings shouldn't print a dot when they have no value.
- Length of char length modifier is now returned correctly.
- Added several fixit tests.

Note: fixit tests are currently broken due to a bug in HighlightRange. Marking as XFAIL for now.

M    test/Sema/format-strings-fixit.c
M    include/clang/Analysis/Analyses/PrintfFormatString.h
M    lib/Analysis/PrintfFormatString.cpp

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

14 years agoAdd null stream check for more APIs.
Zhongxing Xu [Fri, 18 Jun 2010 02:47:46 +0000 (02:47 +0000)]
Add null stream check for more APIs.

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

14 years agoRewrite comment to make my intentions slightly more clear.
Sean Hunt [Fri, 18 Jun 2010 02:14:45 +0000 (02:14 +0000)]
Rewrite comment to make my intentions slightly more clear.

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

14 years agoChange two static variables into instance variables of ASTContext. This allows us...
Ted Kremenek [Fri, 18 Jun 2010 00:31:04 +0000 (00:31 +0000)]
Change two static variables into instance variables of ASTContext.  This allows us to have multiple copies
of ASTContext at the same time.

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

14 years agoGiven Decl::isUsed() a flag indicating when to consider the "used"
Douglas Gregor [Thu, 17 Jun 2010 23:14:26 +0000 (23:14 +0000)]
Given Decl::isUsed() a flag indicating when to consider the "used"
attribute as part of the calculation. Sema::MarkDeclReferenced(), and
a few other places, want only to consider the "used" bit to determine,
e.g, whether to perform template instantiation. Fixes a linkage issue
with Boost.Serialization.

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

14 years agoobjective-C++ IRGen: property reference as an
Fariborz Jahanian [Thu, 17 Jun 2010 23:00:29 +0000 (23:00 +0000)]
objective-C++ IRGen: property reference as an
lvalue when performing a derived-to-base conversion.
Fixes radar 7501812. Added an executable test to
llvm-test suite.

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

14 years agoBug 7394 - Fixed toString representation of Precisions in format strings.
Tom Care [Thu, 17 Jun 2010 22:55:40 +0000 (22:55 +0000)]
Bug 7394 - Fixed toString representation of Precisions in format strings.

M    include/clang/Analysis/Analyses/PrintfFormatString.h
M    lib/Analysis/PrintfFormatString.cpp

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

14 years agoDo not treat @selector as lvalue (unlike g++).
Fariborz Jahanian [Thu, 17 Jun 2010 21:45:48 +0000 (21:45 +0000)]
Do not treat @selector as lvalue (unlike g++).
Patch by Nico Weber (pr7390).

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

14 years agoImproves RecursiveASTVisitor:
Zhanyong Wan [Thu, 17 Jun 2010 20:56:31 +0000 (20:56 +0000)]
Improves RecursiveASTVisitor:

* refactors code in DEF_TRAVERSE_DECL() into
  TraverseDeclContextHelper() to reduce code bloat and facilitate
  reuse.
* makes the order of traversing a FunctionDecl (including its
  subclasses)'s children more natural: before the function parameters
  are visited after the function body; now they are visited after the
  function type and before the function body.
* fixes a double count for function return type and arguments.

Reviewed by chandlerc and csilvers.

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

14 years agoObjective-c++ IRGen. Support for @selector expression as
Fariborz Jahanian [Thu, 17 Jun 2010 19:56:20 +0000 (19:56 +0000)]
Objective-c++ IRGen. Support for @selector expression as
an lvalue. Fixes PR7390.

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

14 years agoBug 7377: Fixed several bad printf format string bugs.
Tom Care [Thu, 17 Jun 2010 19:00:27 +0000 (19:00 +0000)]
Bug 7377: Fixed several bad printf format string bugs.
- Added warning for undefined behavior when using field specifier
- Added warning for undefined behavior when using length modifier
- Fixed warnings for invalid flags
- Added warning for ignored flags
- Added fixits for the above warnings
- Fixed accuracy of detecting several undefined behavior conditions
- Receive normal warnings in addition to security warnings when using %n
- Fix bug where '+' flag would remain on unsigned conversion suggestions

Summary of changes:
- Added expanded tests
- Added/expanded warnings
- Added position info to OptionalAmounts for fixits
- Extracted optional flags to a wrapper class with position info for fixits
- Added several methods to validate a FormatSpecifier by component, each checking for undefined behavior
- Fixed conversion specifier checking to conform to C99 standard
- Added hooks to detect the invalid states in CheckPrintfHandler::HandleFormatSpecifier

Note: warnings involving the ' ' (space) flag are temporarily disabled until whitespace highlighting no longer triggers assertions. I will make a post about this on cfe-dev shortly.

M    test/Sema/format-strings.c
M    include/clang/Basic/DiagnosticSemaKinds.td
M    include/clang/Analysis/Analyses/PrintfFormatString.h
M    lib/Analysis/PrintfFormatString.cpp
M    lib/Sema/SemaChecking.cpp

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

14 years agoWhen pushing a copy of the TypeLoc information for a dependent
Douglas Gregor [Thu, 17 Jun 2010 16:03:49 +0000 (16:03 +0000)]
When pushing a copy of the TypeLoc information for a dependent
template specialization type, copy the location information but use
the new type. Fixes PR7385.

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

14 years agoUse UnaryOperator as the representation of dependent expressions when
Douglas Gregor [Thu, 17 Jun 2010 15:46:20 +0000 (15:46 +0000)]
Use UnaryOperator as the representation of dependent expressions when
no overloaded operators were found in scope, mirroring what we already
do for BinaryOperator.

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

14 years agoUpdate CMake build system for ARM NEON generation.
Douglas Gregor [Thu, 17 Jun 2010 15:17:41 +0000 (15:17 +0000)]
Update CMake build system for ARM NEON generation.

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

14 years agoSome fixes to type-visiting -- a few places where the type-name was
Craig Silverstein [Thu, 17 Jun 2010 13:40:37 +0000 (13:40 +0000)]
Some fixes to type-visiting -- a few places where the type-name was
explicitly typed in the source, but we weren't recursing on it.  One
is new <type>, the other is <type>() (eg int()).

I also fixed the initializer parsing to parse on the syntactic
initializer list, not the semantic.  Usually they'll be identical, so
this won't affect much in practice, but keeps the AST as a syntax-tree
visitor.

Reviewed by chandlerc.

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

14 years agoFix typo (test commit)
Peter Collingbourne [Thu, 17 Jun 2010 12:39:05 +0000 (12:39 +0000)]
Fix typo (test commit)

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

14 years agofix some more gcc3.4 constness warnings
Gabor Greif [Thu, 17 Jun 2010 11:29:31 +0000 (11:29 +0000)]
fix some more gcc3.4 constness warnings

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

14 years agouse typedef to make hack more transparent and also appease gcc3.4 constness warning
Gabor Greif [Thu, 17 Jun 2010 10:59:08 +0000 (10:59 +0000)]
use typedef to make hack more transparent and also appease gcc3.4 constness warning

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

14 years agoMake sure the caching mechanism in Parser::ParseLexedMethodDefs is robust against...
Argyrios Kyrtzidis [Thu, 17 Jun 2010 10:52:22 +0000 (10:52 +0000)]
Make sure the caching mechanism in Parser::ParseLexedMethodDefs is robust against the parser reading too few tokens.

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

14 years agoMake sure parens/braces/brackets are correctly balanced.
Argyrios Kyrtzidis [Thu, 17 Jun 2010 10:52:18 +0000 (10:52 +0000)]
Make sure parens/braces/brackets are correctly balanced.

In a line like:

(;

the semicolon leaves Parser:ParenCount unbalanced (it's 1 even though we stopped looking for a right paren).
This may affect later parsing and result in bad recovery for parsing errors.

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

14 years agoDon't ast-print the builtin __[u]int128_t.
Argyrios Kyrtzidis [Thu, 17 Jun 2010 10:52:11 +0000 (10:52 +0000)]
Don't ast-print the builtin __[u]int128_t.

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

14 years agoMangle operator names in the Microsoft C++ Mangler.
Charles Davis [Thu, 17 Jun 2010 06:47:31 +0000 (06:47 +0000)]
Mangle operator names in the Microsoft C++ Mangler.

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

14 years agoTweak stack address checker to report multiple cases where globals may reference...
Ted Kremenek [Thu, 17 Jun 2010 04:21:37 +0000 (04:21 +0000)]
Tweak stack address checker to report multiple cases where globals may reference stack memory.
Also refactor the diagnostics so that we print out the kind of stack memory returned.

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

14 years agoInclude the bug description in the report hash so that we can emit multiple bugs...
Ted Kremenek [Thu, 17 Jun 2010 04:21:27 +0000 (04:21 +0000)]
Include the bug description in the report hash so that we can emit multiple bugs of the same
type at the same location.

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

14 years agoGenerate arm_neon.inc in include/clang/Basic, which provides:
Nate Begeman [Thu, 17 Jun 2010 04:17:01 +0000 (04:17 +0000)]
Generate arm_neon.inc in include/clang/Basic, which provides:
1. builtins definitions for BuiltinsARM.def
2. intrinsic validation code for SemaChecking

Unsure as to whether this is the best way to handle the make dependencies or not.

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

14 years agoRemove last of the bool shifts for MS VC++, patch by dimitry andric
Nate Begeman [Thu, 17 Jun 2010 02:26:59 +0000 (02:26 +0000)]
Remove last of the bool shifts for MS VC++, patch by dimitry andric

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

14 years agoComment Attr.td so people have a better understanding of what goes on.
Sean Hunt [Thu, 17 Jun 2010 01:51:32 +0000 (01:51 +0000)]
Comment Attr.td so people have a better understanding of what goes on.

Also removed the unused Aliases member.

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

14 years agoFix format string checking of '%c' by treating it as an integer conversion. Fixes...
Ted Kremenek [Thu, 17 Jun 2010 01:12:20 +0000 (01:12 +0000)]
Fix format string checking of '%c' by treating it as an integer conversion.  Fixes PR 7391.

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

14 years agoPer conversation with Doug, remove two assertions in ParseLexedMethodDefs() that
Ted Kremenek [Thu, 17 Jun 2010 00:59:17 +0000 (00:59 +0000)]
Per conversation with Doug, remove two assertions in ParseLexedMethodDefs() that
didn't indicate violated invariants but that we weren't recovering well.

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

14 years agoFix yet another CMake typo. I'm not quite sure how this succeeded locally now.
Sean Hunt [Thu, 17 Jun 2010 00:51:27 +0000 (00:51 +0000)]
Fix yet another CMake typo. I'm not quite sure how this succeeded locally now.

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

14 years agoFix a typo in the previous commit I thought I'd fixed, but apparently didn't.
Sean Hunt [Thu, 17 Jun 2010 00:42:32 +0000 (00:42 +0000)]
Fix a typo in the previous commit I thought I'd fixed, but apparently didn't.

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

14 years agoUpdate CMake build for new attribute changes.
Sean Hunt [Thu, 17 Jun 2010 00:37:02 +0000 (00:37 +0000)]
Update CMake build for new attribute changes.

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

14 years agoRework StackAddrLeakChecker to find stores of stack memory addresses to global variables
Ted Kremenek [Thu, 17 Jun 2010 00:24:44 +0000 (00:24 +0000)]
Rework StackAddrLeakChecker to find stores of stack memory addresses to global variables
by inspecting the Store bindings instead of iterating over all the global variables
in a translation unit.  By looking at the store directly, we avoid cases where we cannot
directly load from the global variable, such as an array (which can result in an assertion failure)
and it also catches cases where we store stack addresses to non-scalar globals.
Also, but not iterating over all the globals in the translation unit, we maintain cache
locality, and the complexity of the checker becomes restricted to the complexity of the
analyzed function, and doesn't scale with the size of the translation unit.

This fixes PR 7383.

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

14 years agoImplement RegionStoreManager::iterBindings(). This implementation only returns the...
Ted Kremenek [Thu, 17 Jun 2010 00:24:42 +0000 (00:24 +0000)]
Implement RegionStoreManager::iterBindings().  This implementation only returns the base region in
the binding key instead of the region + offset.  It isn't clear if this is the best semantics, but most
clients will likely only care about simple bindings, or bindings to a particular variable.  We can
refine later if necessary.

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

14 years agoCorrectly return early from BasicStoreManager::iterBindings() when the BindingsHandle...
Ted Kremenek [Thu, 17 Jun 2010 00:24:37 +0000 (00:24 +0000)]
Correctly return early from BasicStoreManager::iterBindings() when the BindingsHandler returns false.

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

14 years agoWhen parsing cached C++ method declarations/definitions, save the
Douglas Gregor [Wed, 16 Jun 2010 23:45:56 +0000 (23:45 +0000)]
When parsing cached C++ method declarations/definitions, save the
"previous token" location at the end of the class definition. This
eliminates a badly-placed error + Fix-It when the ';' following a
class definition is missing. Fixes <rdar://problem/8066414>.

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

14 years agoImplement first TD-based usage of attributes.
Sean Hunt [Wed, 16 Jun 2010 23:43:53 +0000 (23:43 +0000)]
Implement first TD-based usage of attributes.

Currently, there are two effective changes:

 - Attr::Kind has been changed to attr::Kind, in a separate namespace
   rather than the Attr class. This is because the enumerator needs to
   be visible to parse.
 - The class definitions for the C++0x attributes other than aligned are
   generated by TableGen.

The specific classes generated by TableGen are controlled by an array in
TableGen (see the accompanying commit to the LLVM repository). I will be
expanding the amount of code generated as I develop the new attributes system
while initially keeping it confined to these attributes.

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

14 years agoMake the "extra ';' inside a struct or union" diagnostic more
Douglas Gregor [Wed, 16 Jun 2010 23:08:59 +0000 (23:08 +0000)]
Make the "extra ';' inside a struct or union" diagnostic more
precise. Fixes PR7336.

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

14 years agoWhen we see a 'template' disambiguator that marks the next identifier
Douglas Gregor [Wed, 16 Jun 2010 23:00:59 +0000 (23:00 +0000)]
When we see a 'template' disambiguator that marks the next identifier
(or operator-function-id) as a template, but the context is actually
non-dependent or the current instantiation, allow us to use knowledge
of what kind of template it is, e.g., type template vs. function
template, for further syntactic disambiguation. This allows us to
parse properly in the presence of stray "template" keywords, which is
necessary in C++0x and it's good recovery in C++98/03.

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

14 years agoFix the recently-added warning about 'typename' and 'template'
Douglas Gregor [Wed, 16 Jun 2010 22:31:08 +0000 (22:31 +0000)]
Fix the recently-added warning about 'typename' and 'template'
disambiguation keywords outside of templates in C++98/03. Previously,
the warning would fire when the associated nested-name-specifier was
not dependent, but that was a misreading of the C++98/03 standard:
now, we complain only when we're outside of any template.

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

14 years agoExtend format string type-checking to include '%p'. Fixes remaining cases PR 4468.
Ted Kremenek [Wed, 16 Jun 2010 21:23:04 +0000 (21:23 +0000)]
Extend format string type-checking to include '%p'.  Fixes remaining cases PR 4468.

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

14 years agoCanonicalize template template parameters when canonicalizing a
Douglas Gregor [Wed, 16 Jun 2010 21:09:37 +0000 (21:09 +0000)]
Canonicalize template template parameters when canonicalizing a
template name that refers to such a parameter. It's amazing that this
problem didn't surface earlier. Fixes PR7387.

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

14 years agotests: Update Frontend config to actually run ir-support tests.
Daniel Dunbar [Wed, 16 Jun 2010 20:04:36 +0000 (20:04 +0000)]
tests: Update Frontend config to actually run ir-support tests.

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

14 years agoC return types must be complete as well.
Fariborz Jahanian [Wed, 16 Jun 2010 19:56:08 +0000 (19:56 +0000)]
C return types must be complete as well.
Moved check before we build the ObjCMessageExpr node.
(PR7386 related).

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

14 years agoChange the test for which ABI/CC to use on ARM to be base on the environment
Rafael Espindola [Wed, 16 Jun 2010 19:01:17 +0000 (19:01 +0000)]
Change the test for which ABI/CC to use on ARM to be base on the environment
(the last argument of the triple).

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

14 years agoMake sure result type of objc++ message expression is
Fariborz Jahanian [Wed, 16 Jun 2010 18:56:04 +0000 (18:56 +0000)]
Make sure result type of objc++ message expression is
complete before attempting to bind it to a temporary.
Fixes PR7386.

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

14 years agoA a new test for my previous patch.
Rafael Espindola [Wed, 16 Jun 2010 18:02:31 +0000 (18:02 +0000)]
A a new test for my previous patch.

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

14 years agoFix tests that I missed from my previous commit.
Rafael Espindola [Wed, 16 Jun 2010 17:49:52 +0000 (17:49 +0000)]
Fix tests that I missed from my previous commit.

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

14 years agoTest commit by adding a blank comment line.
Zhanyong Wan [Wed, 16 Jun 2010 17:21:03 +0000 (17:21 +0000)]
Test commit by adding a blank comment line.

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

14 years agoFrontend: Allow passing -cc1 level arguments to plugins. Patch by Troy Straszheim!
Daniel Dunbar [Wed, 16 Jun 2010 16:59:23 +0000 (16:59 +0000)]
Frontend: Allow passing -cc1 level arguments to plugins. Patch by Troy Straszheim!

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

14 years agoDriver: Ignore -ffast-math and -f[no-]finite-math-only.
Daniel Dunbar [Wed, 16 Jun 2010 16:59:17 +0000 (16:59 +0000)]
Driver: Ignore -ffast-math and -f[no-]finite-math-only.

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

14 years agoDon't poke at an undefined class type of a field. Fixes PR7355.
Douglas Gregor [Wed, 16 Jun 2010 16:54:04 +0000 (16:54 +0000)]
Don't poke at an undefined class type of a field. Fixes PR7355.

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

14 years agoDowngrade the error when using a typedef in the nested-name-specifier
Douglas Gregor [Wed, 16 Jun 2010 16:26:47 +0000 (16:26 +0000)]
Downgrade the error when using a typedef in the nested-name-specifier
of an explicit instantiation to an ExtWarn, since nobody else seems to
diagnose this problem.

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

14 years agoAdd Cygwin C++ header search path.
Douglas Gregor [Wed, 16 Jun 2010 16:24:51 +0000 (16:24 +0000)]
Add Cygwin C++ header search path.

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

14 years agoFixed conflict between objc_memmove_collectable builtin
Fariborz Jahanian [Wed, 16 Jun 2010 16:22:04 +0000 (16:22 +0000)]
Fixed conflict between objc_memmove_collectable builtin
decl. and one ddefined in darwin header file.

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

14 years agoDon't set the calling convention for ARM if it is already the default.
Rafael Espindola [Wed, 16 Jun 2010 16:13:39 +0000 (16:13 +0000)]
Don't set the calling convention for ARM if it is already the default.

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

14 years agoIf a non-dependent base class initializer fails to match any direct or
Douglas Gregor [Wed, 16 Jun 2010 16:03:14 +0000 (16:03 +0000)]
If a non-dependent base class initializer fails to match any direct or
virtual base class, but the class still has dependent base classes,
then don't diagnose the failed match as an error: the right base class
might magically appear. Fixes PR7259.

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

14 years agoAdd some missing parentheses, from Anton Yartsev
Douglas Gregor [Wed, 16 Jun 2010 15:28:57 +0000 (15:28 +0000)]
Add some missing parentheses, from Anton Yartsev

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

14 years agoRevert r106099; it broke self-host.
Douglas Gregor [Wed, 16 Jun 2010 15:23:05 +0000 (15:23 +0000)]
Revert r106099; it broke self-host.

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

14 years agoAdded TemplateTypeParmType::getDecl().
Abramo Bagnara [Wed, 16 Jun 2010 14:59:30 +0000 (14:59 +0000)]
Added TemplateTypeParmType::getDecl().

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

14 years agoRework the unqualified-lookup-in-templates section of the compatibility
John McCall [Wed, 16 Jun 2010 10:48:16 +0000 (10:48 +0000)]
Rework the unqualified-lookup-in-templates section of the compatibility
document.  jyasskin, let me know if this meets your needs.

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

14 years agoFix the build. Using declarations should not be considering when looking
John McCall [Wed, 16 Jun 2010 09:33:39 +0000 (09:33 +0000)]
Fix the build.  Using declarations should not be considering when looking
for overridden virtual methods.

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

14 years agoSome more nods to HTML well-formedness.
John McCall [Wed, 16 Jun 2010 08:48:08 +0000 (08:48 +0000)]
Some more nods to HTML well-formedness.

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

14 years agoFix a point of semantics with using declaration hiding: method templates
John McCall [Wed, 16 Jun 2010 08:42:20 +0000 (08:42 +0000)]
Fix a point of semantics with using declaration hiding:  method templates
introduced by using decls are hidden even if their template parameter lists
or return types differ from the "overriding" declaration.

Propagate using shadow declarations around more effectively when looking up
template-ids.  Reperform lookup for template-ids in member expressions so that
access control is properly set up.

Fix some number of latent bugs involving template-ids with totally invalid
base types.  You can only actually get these with a scope specifier, since
otherwise the template-id won't parse as a template-id.

Fixes PR7384.

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

14 years agoWe return Loc where we know.
Zhongxing Xu [Wed, 16 Jun 2010 06:16:46 +0000 (06:16 +0000)]
We return Loc where we know.

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

14 years agoTypo.
Zhongxing Xu [Wed, 16 Jun 2010 05:58:35 +0000 (05:58 +0000)]
Typo.

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

14 years agoAlthough arguments can not be undefined when we get here, they can still be
Zhongxing Xu [Wed, 16 Jun 2010 05:56:39 +0000 (05:56 +0000)]
Although arguments can not be undefined when we get here, they can still be
unknown.

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

14 years agoCast earlier. We know we can get a DefinedSVal.
Zhongxing Xu [Wed, 16 Jun 2010 05:52:03 +0000 (05:52 +0000)]
Cast earlier. We know we can get a DefinedSVal.

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

14 years agoRegister CallAndMessageChecker before AttrNonNullChecker. Then we can assume
Zhongxing Xu [Wed, 16 Jun 2010 05:45:09 +0000 (05:45 +0000)]
Register CallAndMessageChecker before AttrNonNullChecker. Then we can assume
arguments are not undefined.

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

14 years agoAdd StreamChecker. This checker models and checks stream manipulation functions.
Zhongxing Xu [Wed, 16 Jun 2010 05:38:05 +0000 (05:38 +0000)]
Add StreamChecker. This checker models and checks stream manipulation functions.
This is the start.

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

14 years agoStart mangling function types in the Microsoft C++ Mangler.
Charles Davis [Wed, 16 Jun 2010 05:33:16 +0000 (05:33 +0000)]
Start mangling function types in the Microsoft C++ Mangler.

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

14 years agoFix template ordering compatibility docs. I missed another section that covered
Jeffrey Yasskin [Wed, 16 Jun 2010 01:12:12 +0000 (01:12 +0000)]
Fix template ordering compatibility docs. I missed another section that covered
the same thing.

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

14 years agoGive Type::isIntegralType() an ASTContext parameter, so that it
Douglas Gregor [Wed, 16 Jun 2010 00:35:25 +0000 (00:35 +0000)]
Give Type::isIntegralType() an ASTContext parameter, so that it
provides C "integer type" semantics in C and C++ "integral type"
semantics in C++.

Note that I still need to update isIntegerType (and possibly other
predicates) using the same approach I've taken for
isIntegralType(). The two should have the same meaning, but currently
don't (!).

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

14 years agoIntroduce Type::isIntegralOrEnumerationType(), to cover those places
Douglas Gregor [Wed, 16 Jun 2010 00:17:44 +0000 (00:17 +0000)]
Introduce Type::isIntegralOrEnumerationType(), to cover those places
in C++ that involve both integral and enumeration types. Convert all
of the callers to Type::isIntegralType() that are meant to work with
both integral and enumeration types over to
Type::isIntegralOrEnumerationType(), to prepare to eliminate
enumeration types as integral types.

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

14 years agoWorkaround a possible VS C++ bug.
Fariborz Jahanian [Wed, 16 Jun 2010 00:16:38 +0000 (00:16 +0000)]
Workaround a possible VS C++ bug.

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

14 years agoDescribe a gcc compatibility problem that occurs when a template calls a
Jeffrey Yasskin [Tue, 15 Jun 2010 23:50:08 +0000 (23:50 +0000)]
Describe a gcc compatibility problem that occurs when a template calls a
function defined between its declaration and an instantiation, and that
function isn't findable through ADL.

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

14 years agoMoved objective-c++ code gen. tests to their own directory and
Fariborz Jahanian [Tue, 15 Jun 2010 23:49:10 +0000 (23:49 +0000)]
Moved objective-c++ code gen. tests to their own directory and
added a new test case (related to radar 8070772).

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

14 years agoMove CodeGenOptions.h *back* into Frontend. This should have been done when the
Chandler Carruth [Tue, 15 Jun 2010 23:19:56 +0000 (23:19 +0000)]
Move CodeGenOptions.h *back* into Frontend. This should have been done when the
dependency edge was reversed such that CodeGen depends on Frontend.

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

14 years agoPatch adds support for copying of those
Fariborz Jahanian [Tue, 15 Jun 2010 22:44:06 +0000 (22:44 +0000)]
Patch adds support for copying of those
objective-c++ class objects which have GC'able objc object
pointers and need to use ObjC's objc_memmove_collectable
API (radar 8070772).

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

14 years agoUpdate equality and relationship comparisons of pointers to reflect
Douglas Gregor [Tue, 15 Jun 2010 21:38:40 +0000 (21:38 +0000)]
Update equality and relationship comparisons of pointers to reflect
C++ semantics, eliminating an extension diagnostic that doesn't match
C++ semantics (ordered comparison with NULL) and tightening some
extwarns to errors in C++ to match GCC and maintain conformance in
SFINAE contexts. Fixes <rdar://problem/7941392>.

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

14 years agofix the various buildbot failures by ensuring that tokens are really completely initi...
Chris Lattner [Tue, 15 Jun 2010 21:06:38 +0000 (21:06 +0000)]
fix the various buildbot failures by ensuring that tokens are really completely initialized.

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

14 years agoRemove a completely useless and utterly incorrect assertion.
Douglas Gregor [Tue, 15 Jun 2010 20:38:36 +0000 (20:38 +0000)]
Remove a completely useless and utterly incorrect assertion.

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

14 years agoDriver: Support -Wp,-MMD,FOO, which I found an instance of. :(
Daniel Dunbar [Tue, 15 Jun 2010 20:30:18 +0000 (20:30 +0000)]
Driver: Support -Wp,-MMD,FOO, which I found an instance of. :(

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

14 years agoTeach code completion not to ignore data members when performing code
Douglas Gregor [Tue, 15 Jun 2010 20:26:51 +0000 (20:26 +0000)]
Teach code completion not to ignore data members when performing code
completion for expressions.

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

14 years agoadd a testcase, from Michael Spencer
Chris Lattner [Tue, 15 Jun 2010 18:56:20 +0000 (18:56 +0000)]
add a testcase, from Michael Spencer

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

14 years agofix an uninitialized variable, patch by Michael Spencer!
Chris Lattner [Tue, 15 Jun 2010 18:55:23 +0000 (18:55 +0000)]
fix an uninitialized variable, patch by Michael Spencer!

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

14 years agoRemove a dead argument to ProcessUCNEscape.
Chris Lattner [Tue, 15 Jun 2010 18:06:43 +0000 (18:06 +0000)]
Remove a dead argument to ProcessUCNEscape.

Fix string concatenation to treat escapes in concatenated strings that
are wide because of other string chunks to process the escapes as wide
themselves.  Before we would warn about and miscompile the attached testcase.

This fixes rdar://8040728 - miscompile + warning: hex escape sequence out of range

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