]> granicus.if.org Git - clang/log
clang
14 years agoFixed incorrect type of alloca (GNU runtime).
David Chisnall [Fri, 30 Apr 2010 13:36:12 +0000 (13:36 +0000)]
Fixed incorrect type of alloca (GNU runtime).

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

14 years agoAdd calling convention related attributes to related declaration. Mark attributes...
Abramo Bagnara [Fri, 30 Apr 2010 13:10:51 +0000 (13:10 +0000)]
Add calling convention related attributes to related declaration. Mark attributes invalid on type related checking so to add them to declarations only when everything is ok.

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

14 years agoAttribute noreturn is now put in declaration attributes. Fixed a double warning gener...
Abramo Bagnara [Fri, 30 Apr 2010 09:13:03 +0000 (09:13 +0000)]
Attribute noreturn is now put in declaration attributes. Fixed a double warning generation.

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

14 years agoAn edge from a call expression to the exit block is only an abnormal edge
John McCall [Fri, 30 Apr 2010 07:10:06 +0000 (07:10 +0000)]
An edge from a call expression to the exit block is only an abnormal edge
if *none* of the successors of the call expression is the exit block.
This matters when a call of bool type is the condition of (say) a while
loop in a function with no statements after the loop.  This *can* happen
in C, but it's much more common in C++ because of overloaded operators.

Suppresses some substantial number of spurious -Wmissing-noreturn warnings.

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

14 years agoFix ADL for types declared in transparent decls, from Alp Toker!
Douglas Gregor [Fri, 30 Apr 2010 07:08:38 +0000 (07:08 +0000)]
Fix ADL for types declared in transparent decls, from Alp Toker!

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

14 years agoIntroduce a sequence number into class template partial
Douglas Gregor [Fri, 30 Apr 2010 05:56:50 +0000 (05:56 +0000)]
Introduce a sequence number into class template partial
specializations, which keeps track of the order in which they were
originally declared. We use this number so that we can always walk the
list of partial specializations in a predictable order during matching
or template instantiation. This also fixes a failure in Boost.Proto,
where SourceManager::isBeforeInTranslationUnit was behaving
poorly in inconsistent ways.

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

14 years agoAccount for the VTT argument when making an implicit copy constructor for
John McCall [Fri, 30 Apr 2010 05:56:45 +0000 (05:56 +0000)]
Account for the VTT argument when making an implicit copy constructor for
a class with virtual bases.  Just a patch until Sema starts (correctly) doing
most of this analysis.

Fixes PR 6622.

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

14 years agoWhen we start the definition of a class template, set the
Douglas Gregor [Fri, 30 Apr 2010 04:39:27 +0000 (04:39 +0000)]
When we start the definition of a class template, set the
InjectedClassNameType's Decl to point at the definition. It's a little
messy, but we do the same thing with classes and their record types,
since much of Clang expects that the TagDecl* one gets out of a type
is the definition. Fixes several Boost.Proto failures.

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

14 years agoRemove unused trait.
Zhongxing Xu [Fri, 30 Apr 2010 04:17:33 +0000 (04:17 +0000)]
Remove unused trait.

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

14 years agoRefactor the AnalysisConsumer to analyze functions after the whole
Zhongxing Xu [Fri, 30 Apr 2010 04:14:20 +0000 (04:14 +0000)]
Refactor the AnalysisConsumer to analyze functions after the whole
translation unit is parsed. This enables us to inline some calls when still
analyzing one function at a time.

Actions are classified into Function, CXXMethod, ObjCMethod,
ObjCImplementation.

This does not hurt performance much. The analysis time for sqlite3.c:

before:
real    17m52.440s
user    17m49.460s
sys    0m2.010s

after:
real    18m0.500s
user    17m56.900s
sys    0m2.330s

DisplayProgress option is broken now. -inine-call action is removed. It
will be reenabled in another form, perhaps as an indenpendant option.

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

14 years agoFix a tentative-parse error with unqualified template ids in cast expressions.
John McCall [Fri, 30 Apr 2010 03:11:01 +0000 (03:11 +0000)]
Fix a tentative-parse error with unqualified template ids in cast expressions.
Also resolve a long-working FIXME in the test case I modified.

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

14 years agoFix pasto in this test
Douglas Gregor [Fri, 30 Apr 2010 03:07:23 +0000 (03:07 +0000)]
Fix pasto in this test

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

14 years agoAdd Clang version inspection macros. Fixes PR6681.
Douglas Gregor [Fri, 30 Apr 2010 02:51:06 +0000 (02:51 +0000)]
Add Clang version inspection macros. Fixes PR6681.

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

14 years agoFix -fno-rtti -fexceptions by forcing the emission of (non-"builtin") RTTI
John McCall [Fri, 30 Apr 2010 01:15:21 +0000 (01:15 +0000)]
Fix -fno-rtti -fexceptions by forcing the emission of (non-"builtin") RTTI
when used by the exceptions routines.  Fixes PR 6974.

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

14 years agological ops, unary ops, pairwise ops
Nate Begeman [Fri, 30 Apr 2010 00:46:57 +0000 (00:46 +0000)]
logical ops, unary ops, pairwise ops

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

14 years agoTeach EHCleanupBlock to deal appropriately with the possibility that there
John McCall [Fri, 30 Apr 2010 00:06:43 +0000 (00:06 +0000)]
Teach EHCleanupBlock to deal appropriately with the possibility that there
might not have been an insertion block set at start.  Fixes PR6975.

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

14 years agoGet the base class addresses before calling EmitClassCopyAssignment.
Anders Carlsson [Fri, 30 Apr 2010 00:04:01 +0000 (00:04 +0000)]
Get the base class addresses before calling EmitClassCopyAssignment.

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

14 years agoRemove an unnecessary argument to EmitClassCopyAssignment.
Anders Carlsson [Thu, 29 Apr 2010 23:51:42 +0000 (23:51 +0000)]
Remove an unnecessary argument to EmitClassCopyAssignment.

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

14 years agoRebuild the nested name specifiers in member-pointer declarator chunks when
John McCall [Thu, 29 Apr 2010 23:50:39 +0000 (23:50 +0000)]
Rebuild the nested name specifiers in member-pointer declarator chunks when
entering the current instantiation.  Set up a little to preserve type location
information for typename types while we're in there.

Fixes a Boost failure.

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

14 years agoComparisons.
Nate Begeman [Thu, 29 Apr 2010 23:36:09 +0000 (23:36 +0000)]
Comparisons.

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

14 years agoDo not enable '-analyze-check-security-syntactic' by default when using '--analyze...
Ted Kremenek [Thu, 29 Apr 2010 22:50:22 +0000 (22:50 +0000)]
Do not enable '-analyze-check-security-syntactic' by default when using '--analyze'.  There
are several known issues to address for it should be turned on by default.

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

14 years agoWhen determining a standard conversion sequence involves resolving the
Douglas Gregor [Thu, 29 Apr 2010 18:24:40 +0000 (18:24 +0000)]
When determining a standard conversion sequence involves resolving the
address of an overloaded function (or function template), perform that
resolution prior to determining the implicit conversion
sequence. This resolution is not part of the implicit conversion
sequence itself.

Previously, we would always consider this resolution to be a
function pointer decay, which was a lie: there might be an explicit &
in the expression, in which case decay should not occur. This caused
the CodeGen assertion in PR6973 (where we created a
pointer to a pointer to a function when we should have had a pointer
to a function), but it's likely that there are corner cases of
overload resolution where this would have failed.

Cleaned up the code involved in determining the type that will
produced afer resolving the overloaded function reference, and added
an assertion to make sure the result is correct. Fixes PR6973.

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

14 years agoProperties cannot be synthesized by-dafult in
Fariborz Jahanian [Thu, 29 Apr 2010 17:52:18 +0000 (17:52 +0000)]
Properties cannot be synthesized by-dafult in
categories. Issue usual warnings instead of
confusing error message. Radar 7920807

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

14 years agoUse clang::VarDecl name instead of llvm::GlobalVariable name.
Devang Patel [Thu, 29 Apr 2010 17:48:37 +0000 (17:48 +0000)]
Use clang::VarDecl name instead of llvm::GlobalVariable name.
llvm::GLobalVariable name may not match user visibile name for function static variables.

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

14 years agoAdd USR support for 'static inline' functions (which can be declared in header files).
Ted Kremenek [Thu, 29 Apr 2010 17:43:29 +0000 (17:43 +0000)]
Add USR support for 'static inline' functions (which can be declared in header files).
Add USR support for 'static' functions and local variables, which can be handy for resolving named variables within a translation unit.

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

14 years agoRemove USRGenerator::VisitBlockDecl(). We don't need to generate USRs for blocks...
Ted Kremenek [Thu, 29 Apr 2010 17:43:26 +0000 (17:43 +0000)]
Remove USRGenerator::VisitBlockDecl().  We don't need to generate USRs for blocks, since
they have no linkage and by definition are anonymous.

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

14 years agoAdd test case for __has_feature(objc_weak_class).
Ted Kremenek [Thu, 29 Apr 2010 17:43:21 +0000 (17:43 +0000)]
Add test case for __has_feature(objc_weak_class).

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

14 years agoStart stamping out the __builtin_neon stuff.
Nate Begeman [Thu, 29 Apr 2010 17:37:19 +0000 (17:37 +0000)]
Start stamping out the __builtin_neon stuff.

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

14 years agoAdd FunctionDecl::isVariadic() to match BlockDecl::isVariadic() and ObjCMethodDecl...
Ted Kremenek [Thu, 29 Apr 2010 16:49:01 +0000 (16:49 +0000)]
Add FunctionDecl::isVariadic() to match BlockDecl::isVariadic() and ObjCMethodDecl::isVariadic().
Do some minor refactoring along the way.

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

14 years agoRename BlockDecl::IsVariadic() to BlockDecl::isVariadic() to match the casing
Ted Kremenek [Thu, 29 Apr 2010 16:48:58 +0000 (16:48 +0000)]
Rename BlockDecl::IsVariadic() to BlockDecl::isVariadic() to match the casing
for similar methods.  No functionality change.

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

14 years agoIRgen/NeXT: Put the synthesized _objc_super, _message_ref_t decls in a valid DeclCont...
Daniel Dunbar [Thu, 29 Apr 2010 16:29:11 +0000 (16:29 +0000)]
IRgen/NeXT: Put the synthesized _objc_super, _message_ref_t decls in a valid DeclContext, to satisfy the invariants that should hold on a RecordDecl.

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

14 years agoRemove a FIXME that is unlikely to be fixed (streaming code generation).
Daniel Dunbar [Thu, 29 Apr 2010 16:29:09 +0000 (16:29 +0000)]
Remove a FIXME that is unlikely to be fixed (streaming code generation).

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

14 years agoFrontend: Tie backend verification passes to CodeGenOptions::VerifyModule,
Daniel Dunbar [Thu, 29 Apr 2010 16:29:06 +0000 (16:29 +0000)]
Frontend: Tie backend verification passes to CodeGenOptions::VerifyModule,
instead of NDEBUG.

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

14 years agoBump Clang version number.
Ted Kremenek [Thu, 29 Apr 2010 15:30:51 +0000 (15:30 +0000)]
Bump Clang version number.

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

14 years agoWhen performing partial ordering of class template partial
Douglas Gregor [Thu, 29 Apr 2010 06:31:36 +0000 (06:31 +0000)]
When performing partial ordering of class template partial
specializations, substitute the deduced template arguments and check
the resulting substitution before concluding that template argument
deduction succeeds. This marvelous little fix makes a bunch of
Boost.Spirit tests start working.

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

14 years agoFor template argument deduction from class template partial
Douglas Gregor [Thu, 29 Apr 2010 06:21:43 +0000 (06:21 +0000)]
For template argument deduction from class template partial
specializations, separate out the deduction part from the checking and
substitution of the deduced arguments.

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

14 years agoA not equal for an unordered relation should return true as specified in IEEE-754...
Mon P Wang [Thu, 29 Apr 2010 05:53:29 +0000 (05:53 +0000)]
A not equal for an unordered relation should return true as specified in IEEE-754, e.g.,
NAN != NAN ? 1 : 0 should return 1.  Also fix the case for complex.

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

14 years agoIt turns out that we *can* end up having to display template argument
Douglas Gregor [Thu, 29 Apr 2010 04:55:13 +0000 (04:55 +0000)]
It turns out that we *can* end up having to display template argument
bindings when the template argument is still an expression; it happens
while checking the template arguments of a class template partial
specializations. Fixes PR6964.

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

14 years agoAdd '__has_feature' support for weak ObjC classes.
Ted Kremenek [Thu, 29 Apr 2010 02:06:46 +0000 (02:06 +0000)]
Add '__has_feature' support for weak ObjC classes.

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

14 years agoSort '__has_feature' cases. No functionality change.
Ted Kremenek [Thu, 29 Apr 2010 02:06:42 +0000 (02:06 +0000)]
Sort '__has_feature' cases.  No functionality change.

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

14 years agoTest case for r102578.
John McCall [Thu, 29 Apr 2010 01:20:45 +0000 (01:20 +0000)]
Test case for r102578.

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

14 years agoAccess-check during template argument deduction from the context of the
John McCall [Thu, 29 Apr 2010 01:18:58 +0000 (01:18 +0000)]
Access-check during template argument deduction from the context of the
template decl itself, not its context.  Testcase to follow;  fixes selfhost.

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

14 years agoFix CFG crasher involving statement expressions reported in PR 6938.
Ted Kremenek [Thu, 29 Apr 2010 01:10:26 +0000 (01:10 +0000)]
Fix CFG crasher involving statement expressions reported in PR 6938.

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

14 years agoProperly switch into the declaring scope of a template when performing
John McCall [Thu, 29 Apr 2010 00:35:03 +0000 (00:35 +0000)]
Properly switch into the declaring scope of a template when performing
template argument deduction or (more importantly) the final substitution
required by such deduction.  Makes access control magically work in these
cases.

Fixes PR6967.

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

14 years agoTeach __builtin_offsetof to compute the offsets of members of base
Douglas Gregor [Thu, 29 Apr 2010 00:18:15 +0000 (00:18 +0000)]
Teach __builtin_offsetof to compute the offsets of members of base
classes, since we only warn (not error) on offsetof() for non-POD
types. We store the base path within the OffsetOfExpr itself, then
evaluate the offsets within the constant evaluator.

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

14 years agobuild: Add CLANG_NO_RUNTIME build variable, which disables building clang
Daniel Dunbar [Wed, 28 Apr 2010 23:36:26 +0000 (23:36 +0000)]
build: Add CLANG_NO_RUNTIME build variable, which disables building clang
runtime library stuff, even if compiler-rt is available.

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

14 years agoDriver: Add support for -fobjc-abi-version=.
Daniel Dunbar [Wed, 28 Apr 2010 23:25:24 +0000 (23:25 +0000)]
Driver: Add support for -fobjc-abi-version=.
 - <rdar://problem/7919678>

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

14 years agoEnsure that cv-qualifiers are correctly removed for post-inc/decrements
Sean Hunt [Wed, 28 Apr 2010 23:02:27 +0000 (23:02 +0000)]
Ensure that cv-qualifiers are correctly removed for post-inc/decrements
as well as pre- and post-inc/decrements in C (not that I think it
matters for any C code).

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

14 years agoFix template instantiation for __builtin_offfsetof expressions that refer to members...
Douglas Gregor [Wed, 28 Apr 2010 22:43:14 +0000 (22:43 +0000)]
Fix template instantiation for __builtin_offfsetof expressions that refer to members of anonymous structs/unions

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

14 years agoA bit more neon work, adds work (but the ABI is wrong), types mostly stamped out.
Nate Begeman [Wed, 28 Apr 2010 22:37:01 +0000 (22:37 +0000)]
A bit more neon work, adds work (but the ABI is wrong), types mostly stamped out.

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

14 years agoDiagnose __builtin_offsetof expressions that refer to bit-fields
Douglas Gregor [Wed, 28 Apr 2010 22:36:06 +0000 (22:36 +0000)]
Diagnose __builtin_offsetof expressions that refer to bit-fields

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

14 years agoSupport for construct/destruct of ivar array
Fariborz Jahanian [Wed, 28 Apr 2010 22:30:33 +0000 (22:30 +0000)]
Support for construct/destruct of ivar array
of c++ objects (NeXt runtime).
radar 7900343.

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

14 years agoCompletely reimplement __builtin_offsetof, based on a patch by Roberto
Douglas Gregor [Wed, 28 Apr 2010 22:16:22 +0000 (22:16 +0000)]
Completely reimplement __builtin_offsetof, based on a patch by Roberto
Amadini.

This change introduces a new expression node type, OffsetOfExpr, that
describes __builtin_offsetof. Previously, __builtin_offsetof was
implemented using a unary operator whose subexpression involved
various synthesized array-subscript and member-reference expressions,
which was ugly and made it very hard to instantiate as a
template. OffsetOfExpr represents the AST more faithfully, with proper
type source information and a more compact representation.

OffsetOfExpr also has support for dependent __builtin_offsetof
expressions; it can be value-dependent, but will never be
type-dependent (like sizeof or alignof). This commit introduces
template instantiation for __builtin_offsetof as well.

There are two major caveats to this patch:

  1) CodeGen cannot handle the case where __builtin_offsetof is not a
  constant expression, so it produces an error. So, to avoid
  regressing in C, we retain the old UnaryOperator-based
  __builtin_offsetof implementation in C while using the shiny new
  OffsetOfExpr implementation in C++. The old implementation can go
  away once we have proper CodeGen support for this case, which we
  expect won't cause much trouble in C++.

  2) __builtin_offsetof doesn't work well with non-POD class types,
  particularly when the designated field is found within a base
  class. I will address this in a subsequent patch.

Fixes PR5880 and a bunch of assertions when building Boost.Python
tests.

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

14 years agoIRGen for initialization/destruction of
Fariborz Jahanian [Wed, 28 Apr 2010 21:28:56 +0000 (21:28 +0000)]
IRGen for initialization/destruction of
ivar class objects (NeXt runtime).
(radar 7900343).

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

14 years agoadd regex support for -verify mode. You can now do things like
Chris Lattner [Wed, 28 Apr 2010 20:02:30 +0000 (20:02 +0000)]
add regex support for -verify mode.  You can now do things like
expected-error-re {{someregex}}

Patch by mike-m!

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

14 years agoChanged signature of GenerateMessageSend() function to pass the ObjCInterfaceDecl...
David Chisnall [Wed, 28 Apr 2010 19:33:36 +0000 (19:33 +0000)]
Changed signature of GenerateMessageSend() function to pass the ObjCInterfaceDecl for class messages and removed the boolean IsClassMessage argument, which wasn't used anywhere.

Emitted some metadata on message sends to allow a later pass to do some speculative inlining of class methods (GNU runtime).  Speculative inlining of instance methods requires type feedback to be useful (work in progress), but for class methods it works quite nicely.

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

14 years agoStub out NEON support, more to come.
Nate Begeman [Wed, 28 Apr 2010 18:37:32 +0000 (18:37 +0000)]
Stub out NEON support, more to come.

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

14 years agoRevert "Fix for PR6953: per gcc, regparm and noreturn affect the compatibility of...
Daniel Dunbar [Wed, 28 Apr 2010 16:20:58 +0000 (16:20 +0000)]
Revert "Fix for PR6953: per gcc, regparm and noreturn affect the compatibility of", it is breaking the builds of quite a few projects (emacs, dovecot, gnutar, bison).

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

14 years agoMore of Sema to implement initialization of
Fariborz Jahanian [Wed, 28 Apr 2010 16:11:27 +0000 (16:11 +0000)]
More of Sema to implement initialization of
ivar of c++ object types.

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

14 years agoRemove unused function.
Benjamin Kramer [Wed, 28 Apr 2010 15:54:45 +0000 (15:54 +0000)]
Remove unused function.

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

14 years agoReduce string trashing in getQualifiedNameAsString.
Benjamin Kramer [Wed, 28 Apr 2010 14:33:51 +0000 (14:33 +0000)]
Reduce string trashing in getQualifiedNameAsString.

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

14 years agoEmit the correct symbol name for the class (GNU runtime).
David Chisnall [Wed, 28 Apr 2010 14:29:56 +0000 (14:29 +0000)]
Emit the correct symbol name for the class (GNU runtime).

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

14 years agoWritten storage class for declarations inside linkage specifications without braces...
Abramo Bagnara [Wed, 28 Apr 2010 13:11:54 +0000 (13:11 +0000)]
Written storage class for declarations inside linkage specifications without braces is none.

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

14 years agoWhen the qualifier of a id-expression is non-dependent but not
Douglas Gregor [Wed, 28 Apr 2010 07:04:26 +0000 (07:04 +0000)]
When the qualifier of a id-expression is non-dependent but not
complete, return an error rather than falling back to building a
dependent declaration reference, since we might not be in a dependent
context. Fixes a fiendish crash-on-invalid in Boost.FunctionTypes that
I wasn't able to reduce to anything useful.

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

14 years agoImprove name mangling for dependent template names (e.g., typename
Douglas Gregor [Wed, 28 Apr 2010 05:58:56 +0000 (05:58 +0000)]
Improve name mangling for dependent template names (e.g., typename
T::template apply<U>), handling a few cases where we previously failed
and performing substitutions on such dependent names. Fixes a crash in
Boost.PropertyTree.

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

14 years agoWhen instantiating a function template specialization following
Douglas Gregor [Wed, 28 Apr 2010 04:52:24 +0000 (04:52 +0000)]
When instantiating a function template specialization following
template argument deduction, use the lexical declaration context as
the owner for friend function templates. Fixes 2 failures in
Boost.Graph.

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

14 years agoProperly pass the address of a lazily-generated function declaration with
John McCall [Wed, 28 Apr 2010 00:00:30 +0000 (00:00 +0000)]
Properly pass the address of a lazily-generated function declaration with
incomplete type.  Fixes PR6911.

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

14 years agoIt's okay to refer to non-type template parameters anywhere they are
Douglas Gregor [Tue, 27 Apr 2010 21:10:04 +0000 (21:10 +0000)]
It's okay to refer to non-type template parameters anywhere they are
visible. Fixes the remaining two failures in Boost.ScopeExit.

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

14 years agoRemoved spaces at end of line. (Test commit.)
Abramo Bagnara [Tue, 27 Apr 2010 21:08:25 +0000 (21:08 +0000)]
Removed spaces at end of line. (Test commit.)

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

14 years agoFix for PR6953: per gcc, regparm and noreturn affect the compatibility of
Eli Friedman [Tue, 27 Apr 2010 21:07:06 +0000 (21:07 +0000)]
Fix for PR6953: per gcc, regparm and noreturn affect the compatibility of
function types.

This could potentially have unexpected side-effects, so look here if there are
new regressions.

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

14 years agoWhen explicitly building a temporary object (CXXTemporaryObjectExpr),
Douglas Gregor [Tue, 27 Apr 2010 20:36:09 +0000 (20:36 +0000)]
When explicitly building a temporary object (CXXTemporaryObjectExpr),
keep track of whether we need to zero-initialize storage prior to
calling its constructor. Previously, we were only tracking this when
implicitly constructing the object (a CXXConstructExpr).

Fixes Boost's value-initialization tests, which means that the
Boost.Config library now passes all of its tests.

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

14 years agoFixed message send to void (broken by my last commit - GNU runtime).
David Chisnall [Tue, 27 Apr 2010 20:33:30 +0000 (20:33 +0000)]
Fixed message send to void (broken by my last commit - GNU runtime).

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

14 years agoDiagnose the use of abstract types as array element types. Previously,
Douglas Gregor [Tue, 27 Apr 2010 19:38:14 +0000 (19:38 +0000)]
Diagnose the use of abstract types as array element types. Previously,
we were relying on checking for abstract class types when an array
type was actually used to declare a variable, parameter, etc. However,
we need to check when the construct the array for, e.g., SFINAE
purposes (see DR337). Fixes problems with Boost's is_abstract type
trait.

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

14 years agoDuring template instantiation, set the naming class of
Douglas Gregor [Tue, 27 Apr 2010 18:19:34 +0000 (18:19 +0000)]
During template instantiation, set the naming class of
UnresolvedLookupExpr and UnresolvedMemberExpr by substituting the
naming class we computed when building the expression in the
template...

... which we didn't always do correctly. Teach
UnresolvedMemberExpr::getNamingClass() all about the new
representation of injected-class-names in templates, so that it can
return a naming class that is the current instantiation.

Also, when decomposing a template-id into its template name and its
arguments, be sure to set the naming class on the LookupResult
structure.

Fixes PR6947 the right way.

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

14 years agoMore simplifications.
Benjamin Kramer [Tue, 27 Apr 2010 17:47:25 +0000 (17:47 +0000)]
More simplifications.

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

14 years agoMove CollectIvarsToConstructOrDestruct to Sema
Fariborz Jahanian [Tue, 27 Apr 2010 17:18:58 +0000 (17:18 +0000)]
Move CollectIvarsToConstructOrDestruct to Sema
from AST, consider ivar array of objects
(per Doug's comment).

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

14 years agoSimplify some code. No change in functionality.
Benjamin Kramer [Tue, 27 Apr 2010 17:12:11 +0000 (17:12 +0000)]
Simplify some code. No change in functionality.

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

14 years agoWhen checking the redeclaration context of a typedef that refers to a
Douglas Gregor [Tue, 27 Apr 2010 16:26:47 +0000 (16:26 +0000)]
When checking the redeclaration context of a typedef that refers to a
tag of the same name, compare the lookup contexts rather than the
actual contexts. Fixes PR6923.

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

14 years agoDon't look into incomplete types when trying to warn about unused
Douglas Gregor [Tue, 27 Apr 2010 16:20:13 +0000 (16:20 +0000)]
Don't look into incomplete types when trying to warn about unused
variables. Fixes PR6948.

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

14 years agoCMake: Fix DESTDIR-related installation problem on Windows, from the
Douglas Gregor [Tue, 27 Apr 2010 16:14:06 +0000 (16:14 +0000)]
CMake: Fix DESTDIR-related installation problem on Windows, from the
mysterious Elrood on IRC.

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

14 years agoWhen instantiating UnresolvedLookupExpr and UnresolvedMemberExpr
Douglas Gregor [Tue, 27 Apr 2010 16:10:10 +0000 (16:10 +0000)]
When instantiating UnresolvedLookupExpr and UnresolvedMemberExpr
expressions, be sure to set the naming class of the LookupResult
structure. Fixes PR6947.

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

14 years agoSimplify.
Daniel Dunbar [Tue, 27 Apr 2010 15:35:03 +0000 (15:35 +0000)]
Simplify.

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

14 years agoAdd Driver support for -fno-constant-cfstrings.
Daniel Dunbar [Tue, 27 Apr 2010 15:34:57 +0000 (15:34 +0000)]
Add Driver support for -fno-constant-cfstrings.

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

14 years agoEnsure return from a message to nil is always 0 (GNU runtime).
David Chisnall [Tue, 27 Apr 2010 15:08:48 +0000 (15:08 +0000)]
Ensure return from a message to nil is always 0 (GNU runtime).

This works around stack corruption / crashes resulting from PR6944, and also
works around people who expect 'what works on my machine' to work everywhere
(GCC crashes in a number of cases on SPARC that should now work correctly with
clang).

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

14 years agoFix comments.
Daniel Dunbar [Tue, 27 Apr 2010 14:51:07 +0000 (14:51 +0000)]
Fix comments.

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

14 years agoWrap a couple of long lines. (Test commit.)
Enea Zaffanella [Tue, 27 Apr 2010 07:38:32 +0000 (07:38 +0000)]
Wrap a couple of long lines. (Test commit.)

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

14 years agoImprove the diagnostic you get when making a qualified member access
John McCall [Tue, 27 Apr 2010 01:43:38 +0000 (01:43 +0000)]
Improve the diagnostic you get when making a qualified member access
with a qualifier referencing a different type.

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

14 years agoMake the InjectedClassNameType the canonical type of the current instantiation
John McCall [Tue, 27 Apr 2010 00:57:59 +0000 (00:57 +0000)]
Make the InjectedClassNameType the canonical type of the current instantiation
of a class template or class template partial specialization.  That is to
say, in
  template <class T> class A { ... };
or
  template <class T> class B<const T*> { ... };
make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType
when written inside the appropriate context.  This allows us to track the
current instantiation appropriately even inside AST routines.  It also allows
us to compute a DeclContext for a type much more efficiently, at some extra
cost every time we write a template specialization (which can be optimized,
but I've left it simple in this patch).

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

14 years agoNew method to construct/destruct ivars that have non-trivial default
Fariborz Jahanian [Mon, 26 Apr 2010 23:51:25 +0000 (23:51 +0000)]
New method to construct/destruct ivars that have non-trivial default
constructors or destructors, not used yet.

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

14 years agoEnable debug info for local variables at -O1+.
Devang Patel [Mon, 26 Apr 2010 23:28:46 +0000 (23:28 +0000)]
Enable debug info for local variables at -O1+.

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

14 years agoImprove source-location information in a C++ typeid (type) expression
Douglas Gregor [Mon, 26 Apr 2010 22:37:10 +0000 (22:37 +0000)]
Improve source-location information in a C++ typeid (type) expression
by using TypeSourceInfo, cleaning up the representation
somewhat. Teach getTypeOperand() to strip references and
cv-qualifiers, providing the semantic view of the type without
requiring any extra storage (the unmodified type remains within the
TypeSourceInfo). This fixes a bug found by Boost's call_traits test.

Finally, clean up semantic analysis, by splitting the ActOnCXXTypeid
routine into ActOnCXXTypeId (the parser action) and two BuildCXXTypeId
functions, which perform the semantic analysis for typeid(type) and
typeid(expression), respectively. We now perform less work at template
instantiation time (we don't look for std::type_info again) and can
give better diagnostics.

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

14 years agofix PR6936: don't generate line marker directives when preprocessing
Chris Lattner [Mon, 26 Apr 2010 22:08:10 +0000 (22:08 +0000)]
fix PR6936: don't generate line marker directives when preprocessing
.S files.  "# 123" is passed through as-is, not treated as a line
marker in this mode.  No testcase, because it would be nasty and isn't
worth it.

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

14 years agoDiagnose declaration of reference typed ivars.
Fariborz Jahanian [Mon, 26 Apr 2010 22:07:03 +0000 (22:07 +0000)]
Diagnose declaration of reference typed ivars.

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

14 years agowordsmith an objc warning, rdar://7900756
Chris Lattner [Mon, 26 Apr 2010 21:44:01 +0000 (21:44 +0000)]
wordsmith an objc warning, rdar://7900756

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

14 years agoIntroduce Type::isStructureOrClassType(), which does the obvious
Douglas Gregor [Mon, 26 Apr 2010 21:31:17 +0000 (21:31 +0000)]
Introduce Type::isStructureOrClassType(), which does the obvious
thing. Audit all uses of Type::isStructure(), changing those calls to
isStructureOrClassType() as needed (which is alsmost
everywhere). Fixes the remaining failure in Boost.Utility/Swap.

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

14 years agoCleanup error recovery for a missing '-'|'+'
Fariborz Jahanian [Mon, 26 Apr 2010 21:18:08 +0000 (21:18 +0000)]
Cleanup error recovery for a missing '-'|'+'
on a method declaration (radar 7822196).

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

14 years agoImplement template instantiation for implicit property references in
Douglas Gregor [Mon, 26 Apr 2010 21:04:54 +0000 (21:04 +0000)]
Implement template instantiation for implicit property references in
Objective-C++. This is the last bit of (non-blocks-related) template
instantiation logic for Objective-C++. Yay!

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

14 years agoImplement template instantiation for ObjCPropertyRefExpr.
Douglas Gregor [Mon, 26 Apr 2010 20:47:02 +0000 (20:47 +0000)]
Implement template instantiation for ObjCPropertyRefExpr.

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

14 years agoemit dtors with the right calling convention in -fno-use-cxa-atexit
Chris Lattner [Mon, 26 Apr 2010 20:35:54 +0000 (20:35 +0000)]
emit dtors with the right calling convention in -fno-use-cxa-atexit
mode.

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

14 years agoImplement template instantiation for value-dependent Objective-C ivar
Douglas Gregor [Mon, 26 Apr 2010 20:11:03 +0000 (20:11 +0000)]
Implement template instantiation for value-dependent Objective-C ivar
references and isa expressions. Also, test template instantiation of
unresolved member references to Objective-C ivar references and isa
expressions.

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