]> granicus.if.org Git - clang/log
clang
14 years agoIntroduce ASTVector, which is a std::vector-like class that allocates all memory
Ted Kremenek [Tue, 13 Apr 2010 23:39:09 +0000 (23:39 +0000)]
Introduce ASTVector, which is a std::vector-like class that allocates all memory
using the allocator associated with an ASTContext.  This is largely copy-and-paste
from SmallVector, and should be refactored one day.

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

14 years agoAdd cursor kind for C++ methods.
Ted Kremenek [Tue, 13 Apr 2010 23:39:06 +0000 (23:39 +0000)]
Add cursor kind for C++ methods.

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

14 years agoIRgen: Move EmitLoadOfBitfieldLValue to use new CGBitfieldInfo::AccessInfo decomposit...
Daniel Dunbar [Tue, 13 Apr 2010 23:34:15 +0000 (23:34 +0000)]
IRgen: Move EmitLoadOfBitfieldLValue to use new CGBitfieldInfo::AccessInfo decomposition, instead of computing the access policy itself.
 - This lets the method focus slightly more on emitting clean IR to honor the policy which has been selected. On 403.gcc's combine.c, x86_64, -O0, this reduces the number of lines in the .ll file (~= # of instructions) by 2.5%.

 - No intended functionality change -- at -O3 this should produce equivalent if not identical output. On 403.gcc's combine.c, x86_64, -O3, this isn't quite true and some of the changes are regressions, but I'm not going to worry about that until we move to a new access policy.

 - There is still some room for improvement in the generated IR, in particular we can usually fold the sign-extension of the bit-field into one of the component access. See the FIXME.

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

14 years agoFix an embarrasing memory error. I was apparently very tired when I wrote this
John McCall [Tue, 13 Apr 2010 22:18:28 +0000 (22:18 +0000)]
Fix an embarrasing memory error.  I was apparently very tired when I wrote this
code the first time.

Fixes PR6827.

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

14 years agoIRgen: Enhance CGBitFieldInfo with enough information to fully describe the "policy...
Daniel Dunbar [Tue, 13 Apr 2010 20:58:55 +0000 (20:58 +0000)]
IRgen: Enhance CGBitFieldInfo with enough information to fully describe the "policy" with which a bit-field should be accessed.
 - For now, these policies are computed to match the current IRgen strategy, although the new information isn't being used yet (except in -fdump-record-layouts).

 - Design comments appreciated.

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

14 years agoRemove unnecessary cast.
Daniel Dunbar [Tue, 13 Apr 2010 20:52:05 +0000 (20:52 +0000)]
Remove unnecessary cast.

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

14 years agoSupport befriending members of class template specializations.
John McCall [Tue, 13 Apr 2010 20:37:33 +0000 (20:37 +0000)]
Support befriending members of class template specializations.

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

14 years agoTwik to radar 7839485. Do not attach weak_import attribute to class
Fariborz Jahanian [Tue, 13 Apr 2010 20:22:35 +0000 (20:22 +0000)]
Twik to radar 7839485. Do not attach weak_import attribute to class
for non-fragile abi on darwin.

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

14 years agoTurn off warning about weak_import attribute
Fariborz Jahanian [Tue, 13 Apr 2010 19:02:07 +0000 (19:02 +0000)]
Turn off warning about weak_import attribute
on objc classes for Darwin. Radar 7839485.

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

14 years agoRemoves a FIXME.
Fariborz Jahanian [Tue, 13 Apr 2010 18:43:37 +0000 (18:43 +0000)]
Removes a FIXME.

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

14 years agoVariation of objc_copyStruct API generation when
Fariborz Jahanian [Tue, 13 Apr 2010 18:32:24 +0000 (18:32 +0000)]
Variation of objc_copyStruct API generation when
property (atomic/nonatomic) is of aggregate type with
gc'able member objects) (NeXT runtime).

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

14 years agoRework the ConstStructBuilder code to emit missing initializer
Chris Lattner [Tue, 13 Apr 2010 18:16:19 +0000 (18:16 +0000)]
Rework the ConstStructBuilder code to emit missing initializer
elements with explicit zero values instead of with tail padding.
On an example like this:

struct foo { int a; int b; };

struct foo fooarray[] = {
    {1, 2},
    {4},
};

We now lay this out as:

@fooarray = global [2 x %struct.foo] [%struct.foo { i32 1, i32 2 }, %struct.foo { i32 4, i32 0 }]

instead of as:

@fooarray = global %0 <{ %struct.foo { i32 1, i32 2 }, %1 { i32 4, [4 x i8] zeroinitializer } }>

Preserving both the struct type of the second element, but also the array type of the entire thing.

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

14 years agounbreak tests.
Chris Lattner [Tue, 13 Apr 2010 17:57:11 +0000 (17:57 +0000)]
unbreak tests.

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

14 years agomove a bunch of ConstStructBuilder methods out of line.
Chris Lattner [Tue, 13 Apr 2010 17:45:57 +0000 (17:45 +0000)]
move a bunch of ConstStructBuilder methods out of line.

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

14 years agominor cleanups
Chris Lattner [Tue, 13 Apr 2010 17:39:09 +0000 (17:39 +0000)]
minor cleanups

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

14 years agoTeach HasSideEffect about InitListExprs. Not having
Chris Lattner [Tue, 13 Apr 2010 17:34:23 +0000 (17:34 +0000)]
Teach HasSideEffect about InitListExprs.  Not having
this caused us to codegen dead globals like this:

struct foo { int a; int b; };

static struct foo fooarray[] = {
  {1, 2},
  {4},
};

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

14 years agomake the rewriter add a #ifndef around the #define of __attribute__.
Chris Lattner [Tue, 13 Apr 2010 17:33:56 +0000 (17:33 +0000)]
make the rewriter add a #ifndef around the #define of __attribute__.
Without it, there is no reason for a compiler that supports it to
emit the dead static globals that the rewriter labels attribute(used).

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

14 years agoRefactor and simplify the computation of implicit conversion sequences
Douglas Gregor [Tue, 13 Apr 2010 16:31:36 +0000 (16:31 +0000)]
Refactor and simplify the computation of implicit conversion sequences
for reference binding. The code attempted to handle both the
computation of the ICS and the actual conversion, but the latter is an
anachronism: we now use InitializationSequence for that.

Sema::CheckReferenceInit is now a static function TryReferenceInit
that's only use within overload resolution, and has been simplified
slightly. It still needs to be updated per C++ [over.ics.ref], by
eliminating more of the lvalue/rvalue checks.

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

14 years agoWhen returning the result of a call to an object of class type, do not
Douglas Gregor [Tue, 13 Apr 2010 15:50:39 +0000 (15:50 +0000)]
When returning the result of a call to an object of class type, do not
return a NULL expression; return either an error or a proper
expression. Fixes PR6078.

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

14 years agoDuring referencing binding, only consider conversion functions for
Douglas Gregor [Tue, 13 Apr 2010 15:07:45 +0000 (15:07 +0000)]
During referencing binding, only consider conversion functions for
direct reference binding when the source and target types are not
reference-related. Fixes PR6066.

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

14 years agoMake all cases that we don't handle explicit.
Zhongxing Xu [Tue, 13 Apr 2010 13:15:19 +0000 (13:15 +0000)]
Make all cases that we don't handle explicit.

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

14 years agoDispatch all C++ cast expr to VisitCast().
Zhongxing Xu [Tue, 13 Apr 2010 12:38:32 +0000 (12:38 +0000)]
Dispatch all C++ cast expr to VisitCast().

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

14 years agoCFGBuilder: always add C++ member call expr as block-level expr.
Zhongxing Xu [Tue, 13 Apr 2010 09:38:01 +0000 (09:38 +0000)]
CFGBuilder: always add C++ member call expr as block-level expr.

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

14 years agoAllow classes to befriend implicitly-declared members. Fixes PR6207 for
John McCall [Tue, 13 Apr 2010 07:45:41 +0000 (07:45 +0000)]
Allow classes to befriend implicitly-declared members.  Fixes PR6207 for
members of non-templated classes.

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

14 years agoAdd a cc1 option to specify the max number of nodes the analyzer can explore.
Zhongxing Xu [Tue, 13 Apr 2010 06:44:31 +0000 (06:44 +0000)]
Add a cc1 option to specify the max number of nodes the analyzer can explore.

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

14 years agoParse constructor names in friend declarations. Part of the fix for
John McCall [Tue, 13 Apr 2010 06:39:49 +0000 (06:39 +0000)]
Parse constructor names in friend declarations.  Part of the fix for
PR6207.

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

14 years agoRemove this test for now until I can figure out
Fariborz Jahanian [Tue, 13 Apr 2010 02:16:35 +0000 (02:16 +0000)]
Remove this test for now until I can figure out
why it keeps failing on buildbot (but not for me).

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

14 years agoDon't try to find a scope corresponding to the search DC for an unfound
John McCall [Tue, 13 Apr 2010 01:44:10 +0000 (01:44 +0000)]
Don't try to find a scope corresponding to the search DC for an unfound
friend declaration;  this used to be important but is now just a waste of time
plus an unreasonable assertion.  Fixes PR6174.

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

14 years agoModify test to be darwin specific.
Fariborz Jahanian [Tue, 13 Apr 2010 01:10:57 +0000 (01:10 +0000)]
Modify test to be darwin specific.

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

14 years agoadd frontend support for -fdata-sections and -ffunction-sections,
Chris Lattner [Tue, 13 Apr 2010 00:38:24 +0000 (00:38 +0000)]
add frontend support for -fdata-sections and -ffunction-sections,
patch by Sylvere Teissier!

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

14 years agoAdd support for objc_copyStruct to enforce
Fariborz Jahanian [Tue, 13 Apr 2010 00:38:05 +0000 (00:38 +0000)]
Add support for objc_copyStruct to enforce
atomicity of aggregate properties in setter/getter
methods. wip.

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

14 years agoFix debug info for cleanup block.
Devang Patel [Tue, 13 Apr 2010 00:08:43 +0000 (00:08 +0000)]
Fix debug info for cleanup block.

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

14 years agocache the PP's SourceManager.
Chris Lattner [Tue, 13 Apr 2010 00:06:42 +0000 (00:06 +0000)]
cache the PP's SourceManager.

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

14 years agoDiagnose declarations of conversion functions with declarators other than '()'.
John McCall [Tue, 13 Apr 2010 00:04:31 +0000 (00:04 +0000)]
Diagnose declarations of conversion functions with declarators other than '()'.

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

14 years agomake the preprocessor listen to linemarker directives in -E mode,
Chris Lattner [Tue, 13 Apr 2010 00:01:41 +0000 (00:01 +0000)]
make the preprocessor listen to linemarker directives in -E mode,
PR6101.  This is based on a patch and testcase by Jordy Rose!

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

14 years agoRemove some dead FIXMEs
Douglas Gregor [Mon, 12 Apr 2010 23:52:24 +0000 (23:52 +0000)]
Remove some dead FIXMEs

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

14 years agoImplement C++ [over.ics.user]p3, which restricts the final conversion
Douglas Gregor [Mon, 12 Apr 2010 23:42:09 +0000 (23:42 +0000)]
Implement C++ [over.ics.user]p3, which restricts the final conversion
from a conversion function template specialization to one of exact
match rank. We only know how to test this in C++0x with default
function template arguments, but it's also in the C++03 spec. Fixes
PR6285.

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

14 years agoImprove source-location information for C++ conversion functions, by
Douglas Gregor [Mon, 12 Apr 2010 23:19:01 +0000 (23:19 +0000)]
Improve source-location information for C++ conversion functions, by
copying the type location information from the conversion-type-id into
the type location information for the function type. Do something
similar for constructors and destructors, by giving their "void"
return type source-location information.

In all of these cases, we previously left this type-source information
uninitialized, which led to various unfortunate crashes.

We still aren't tracking good source-location information for the
actual names. That's PR6357.

John, please check my sanity on this.

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

14 years agofix a minor bug I noticed while work with Jordy's patch for PR6101,
Chris Lattner [Mon, 12 Apr 2010 23:04:41 +0000 (23:04 +0000)]
fix a minor bug I noticed while work with Jordy's patch for PR6101,
in an input file like this:

# 42
int x;

we were emitting:

# <something>
 int x;

(with a space before the int) because we weren't clearing the leading
whitespace flag properly after the \n from the directive was handled.

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

14 years agoAdd fixit hint for missing ':' in ternary expressions.
Ted Kremenek [Mon, 12 Apr 2010 22:10:35 +0000 (22:10 +0000)]
Add fixit hint for missing ':' in ternary expressions.

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

14 years agofix PR6814 - Only print [-pedantic] on a diagnostic if -pedantic
Chris Lattner [Mon, 12 Apr 2010 21:53:11 +0000 (21:53 +0000)]
fix PR6814 - Only print [-pedantic] on a diagnostic if -pedantic
actually turned it on.  If a diag is produced by a warning which
is an extension but defaults to on, and has no warning group, don't
print any option info.

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

14 years agoAdd 'clang_getCursorLanguage' to return the "language" of the AST element (e.g.,...
Ted Kremenek [Mon, 12 Apr 2010 21:22:16 +0000 (21:22 +0000)]
Add 'clang_getCursorLanguage' to return the "language" of the AST element (e.g., distinguish between C and Objective-C language features).  Currently this only returns results for declarations.

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

14 years agoSort exports file.
Ted Kremenek [Mon, 12 Apr 2010 21:22:10 +0000 (21:22 +0000)]
Sort exports file.

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

14 years agofix PR6660/6168: emit padding as zeros instead of undef. Because
Chris Lattner [Mon, 12 Apr 2010 21:10:05 +0000 (21:10 +0000)]
fix PR6660/6168: emit padding as zeros instead of undef.  Because
trailing fields may not be represented in initializer lists, they
are being handled as padding and those fields *must* be zero
initialized.

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

14 years agoIRgen: Factor out ComputeBitFieldInfo.
Daniel Dunbar [Mon, 12 Apr 2010 21:01:28 +0000 (21:01 +0000)]
IRgen: Factor out ComputeBitFieldInfo.

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

14 years agoImplement C++ [temp.local]p4, which specifies how we eliminate
Douglas Gregor [Mon, 12 Apr 2010 20:54:26 +0000 (20:54 +0000)]
Implement C++ [temp.local]p4, which specifies how we eliminate
name-lookup ambiguities when there are multiple base classes that are
all specializations of the same class template. This is part of a
general cleanup for ambiguities in template-name lookup. Fixes
PR6717.

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

14 years agoFix null dereference in 'WriteSourceLocation' when the FileEntry is null.
Ted Kremenek [Mon, 12 Apr 2010 19:54:17 +0000 (19:54 +0000)]
Fix null dereference in 'WriteSourceLocation' when the FileEntry is null.

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

14 years agoPrune includes.
Benjamin Kramer [Mon, 12 Apr 2010 19:45:50 +0000 (19:45 +0000)]
Prune includes.

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

14 years agoUpdate doxygen comments about lifetime requirements of CXUnsaveFile data arguments.
Ted Kremenek [Mon, 12 Apr 2010 18:47:26 +0000 (18:47 +0000)]
Update doxygen comments about lifetime requirements of CXUnsaveFile data arguments.

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

14 years agoAdd some API code for future work.
Fariborz Jahanian [Mon, 12 Apr 2010 18:18:10 +0000 (18:18 +0000)]
Add some API code for future work.

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

14 years agoIRgen: Add CGRecordLayout::dump, and dump (irgen) record layouts as part of -fdump...
Daniel Dunbar [Mon, 12 Apr 2010 18:14:18 +0000 (18:14 +0000)]
IRgen: Add CGRecordLayout::dump, and dump (irgen) record layouts as part of -fdump-record-layouts.

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

14 years agofix PR6819
Chris Lattner [Mon, 12 Apr 2010 17:25:51 +0000 (17:25 +0000)]
fix PR6819

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

14 years agotighten the check for cast of super to avoid rejecting valid code,
Chris Lattner [Mon, 12 Apr 2010 17:09:27 +0000 (17:09 +0000)]
tighten the check for cast of super to avoid rejecting valid code,
rdar://7853261

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

14 years agoWhen creating the implicitly-declared special member functions, be
Douglas Gregor [Mon, 12 Apr 2010 17:09:20 +0000 (17:09 +0000)]
When creating the implicitly-declared special member functions, be
sure to introduce them into the current Scope (when we have one) in
addition to the DeclContext for the class, so that they can be found
by name lookup for inline members of the class. Fixes PR6570.

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

14 years agofix rdar://7852959 - Use of super within a block is actually ok.
Chris Lattner [Mon, 12 Apr 2010 17:03:29 +0000 (17:03 +0000)]
fix rdar://7852959 - Use of super within a block is actually ok.
(aka, Fariborz was right ;-)

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

14 years agoIssue warning when 'weak_import' attribute is applied on a class only
Fariborz Jahanian [Mon, 12 Apr 2010 16:57:31 +0000 (16:57 +0000)]
Issue warning when 'weak_import' attribute is applied on a class only
when it is not supported in versions of MacOs.

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

14 years agoRemove the blanket statement about Clang not supporting access control. It does now
Douglas Gregor [Mon, 12 Apr 2010 16:01:38 +0000 (16:01 +0000)]
Remove the blanket statement about Clang not supporting access control. It does now

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

14 years agoFix a crash-on-invalid involving name lookup of tag names, where we
Douglas Gregor [Mon, 12 Apr 2010 16:00:01 +0000 (16:00 +0000)]
Fix a crash-on-invalid involving name lookup of tag names, where we
ended up finding a function template that we didn't expect. Recover
more gracefully, and fix a similar issue for class templates.

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

14 years agoAdd another test case for r101029, which verifies that we now
Douglas Gregor [Mon, 12 Apr 2010 07:51:13 +0000 (07:51 +0000)]
Add another test case for r101029, which verifies that we now
correctly diagnose instantiation of a function parameter with Objective-C
class type (since Objective-C classes can't be passed by value).

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

14 years agoBe sure to instantiate the parameters of a function, even when the
Douglas Gregor [Mon, 12 Apr 2010 07:48:19 +0000 (07:48 +0000)]
Be sure to instantiate the parameters of a function, even when the
function's type is (strictly speaking) non-dependent. This ensures
that, e.g., default function arguments get instantiated properly.

And, since I couldn't resist, collapse the two implementations of
function-parameter instantiation into calls to a single, new function
(Sema::SubstParmVarDecl), since the two had nearly identical code (and
each had bugs the other didn't!). More importantly, factored out the
semantic analysis of a parameter declaration into
Sema::CheckParameter, which is called both by
Sema::ActOnParamDeclarator (when parameters are parsed) and when a
parameter is instantiated. Previously, we were missing some
Objective-C and address-space checks on instantiated function
parameters.

Fixes PR6733.

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

14 years agofix a bug I noticed by inspection, correcting two reject-valid bugs.
Chris Lattner [Mon, 12 Apr 2010 06:36:00 +0000 (06:36 +0000)]
fix a bug I noticed by inspection, correcting two reject-valid bugs.

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

14 years agofix a rejects-valid bug that I introduced, pointed out
Chris Lattner [Mon, 12 Apr 2010 06:27:57 +0000 (06:27 +0000)]
fix a rejects-valid bug that I introduced, pointed out
by David Chisnall

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

14 years agouse pointer comparison instead of isStr
Chris Lattner [Mon, 12 Apr 2010 06:22:50 +0000 (06:22 +0000)]
use pointer comparison instead of isStr

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

14 years agofix a rejects-valid testcase involving super that I dreamt up.
Chris Lattner [Mon, 12 Apr 2010 06:20:33 +0000 (06:20 +0000)]
fix a rejects-valid testcase involving super that I dreamt up.
This also fixes cases where super is used in a block in a
method which isn't valid.

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

14 years agochange Scope::WithinElse to be a normal scope flag, widen the
Chris Lattner [Mon, 12 Apr 2010 06:12:50 +0000 (06:12 +0000)]
change Scope::WithinElse to be a normal scope flag, widen the
fields to two 16-bit values instead of using bitfields.

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

14 years agofix this test.
Chris Lattner [Mon, 12 Apr 2010 05:47:20 +0000 (05:47 +0000)]
fix this test.

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

14 years agoxfail this test for now.
Chris Lattner [Mon, 12 Apr 2010 05:44:13 +0000 (05:44 +0000)]
xfail this test for now.

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

14 years agofix an invalid use of super, you can't use super like this in a block!
Chris Lattner [Mon, 12 Apr 2010 05:43:31 +0000 (05:43 +0000)]
fix an invalid use of super, you can't use super like this in a block!

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

14 years agoHave the parser decide whether a message to super is a variable or
Chris Lattner [Mon, 12 Apr 2010 05:38:43 +0000 (05:38 +0000)]
Have the parser decide whether a message to super is a variable or
type, instead of having sema do it.

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

14 years agoTypo.
Nick Lewycky [Mon, 12 Apr 2010 05:32:01 +0000 (05:32 +0000)]
Typo.

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

14 years agofix a fixme, stop evaluating getCurMethodDecl() repeatedly
Chris Lattner [Mon, 12 Apr 2010 05:10:17 +0000 (05:10 +0000)]
fix a fixme, stop evaluating getCurMethodDecl() repeatedly
in "LookupInObjCMethod".

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

14 years agoother half of r101005
Chris Lattner [Mon, 12 Apr 2010 02:18:49 +0000 (02:18 +0000)]
other half of r101005

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

14 years agofix PR6287 by accepting and ignoring the returns_twice attribute.
Chris Lattner [Mon, 12 Apr 2010 02:18:38 +0000 (02:18 +0000)]
fix PR6287 by accepting and ignoring the returns_twice attribute.

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

14 years agoHave the CXXBaseOrMemberInitializer keep track of whether an initializer initializes...
Anders Carlsson [Mon, 12 Apr 2010 00:51:03 +0000 (00:51 +0000)]
Have the CXXBaseOrMemberInitializer keep track of whether an initializer initializes a virtual base or not.

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

14 years agoUnbreak test on windows.
Ted Kremenek [Sun, 11 Apr 2010 22:25:18 +0000 (22:25 +0000)]
Unbreak test on windows.

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

14 years agoFix another bug where we wouldn't generate secondary vtables for construction vtables...
Anders Carlsson [Sun, 11 Apr 2010 22:20:36 +0000 (22:20 +0000)]
Fix another bug where we wouldn't generate secondary vtables for construction vtables in some cases.

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

14 years agoAdd initial USR support for macro definitions.
Ted Kremenek [Sun, 11 Apr 2010 22:20:34 +0000 (22:20 +0000)]
Add initial USR support for macro definitions.

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

14 years agoAugment clang_getCursorUSR() to not always expect that clang_getCursorDecl() does...
Ted Kremenek [Sun, 11 Apr 2010 22:20:26 +0000 (22:20 +0000)]
Augment clang_getCursorUSR() to not always expect that clang_getCursorDecl() does the right
thing if the cursor is not a decl (such as in the case of macros).

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

14 years agoMore renames.
Anders Carlsson [Sun, 11 Apr 2010 22:07:06 +0000 (22:07 +0000)]
More renames.

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

14 years agoRename a function parameter.
Anders Carlsson [Sun, 11 Apr 2010 22:03:57 +0000 (22:03 +0000)]
Rename a function parameter.

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

14 years agoAdd CIndex support for blocks.
Ted Kremenek [Sun, 11 Apr 2010 21:47:37 +0000 (21:47 +0000)]
Add CIndex support for blocks.

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

14 years agoUpdate checker build.
Ted Kremenek [Sun, 11 Apr 2010 21:02:52 +0000 (21:02 +0000)]
Update checker build.

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

14 years agoClarify an assertion.
Anders Carlsson [Sun, 11 Apr 2010 20:23:06 +0000 (20:23 +0000)]
Clarify an assertion.

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

14 years agoFix a bug where we were adding too many vcall offsets in some cases.
Anders Carlsson [Sun, 11 Apr 2010 20:04:11 +0000 (20:04 +0000)]
Fix a bug where we were adding too many vcall offsets in some cases.

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

14 years agoadd haiku support, patch by Paul Davey!
Chris Lattner [Sun, 11 Apr 2010 19:29:39 +0000 (19:29 +0000)]
add haiku support, patch by Paul Davey!

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

14 years agoavoid double negatives
Chris Lattner [Sun, 11 Apr 2010 18:53:08 +0000 (18:53 +0000)]
avoid double negatives

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

14 years agoFix CFG bug where bases of member expressions were not always evaluated in a lvalue...
Ted Kremenek [Sun, 11 Apr 2010 17:02:10 +0000 (17:02 +0000)]
Fix CFG bug where bases of member expressions were not always evaluated in a lvalue context.  Fixes <rdar://problem/7813989>.

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

14 years agoFix bug in AddStmtChoice:asLValue() where 'AsLValueNotAlwaysAdd' would not be treated...
Ted Kremenek [Sun, 11 Apr 2010 17:02:04 +0000 (17:02 +0000)]
Fix bug in AddStmtChoice:asLValue() where 'AsLValueNotAlwaysAdd' would not be treated as indicating an lvalue.

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

14 years agoSort visitor methods. No functionality change.
Ted Kremenek [Sun, 11 Apr 2010 17:01:59 +0000 (17:01 +0000)]
Sort visitor methods.  No functionality change.

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

14 years agoFix run line so this test actually tests something.
Benjamin Kramer [Sun, 11 Apr 2010 09:39:39 +0000 (09:39 +0000)]
Fix run line so this test actually tests something.

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

14 years agofix PR6811 by not parsing 'super' as a magic expression in
Chris Lattner [Sun, 11 Apr 2010 08:28:14 +0000 (08:28 +0000)]
fix PR6811 by not parsing 'super' as a magic expression in
LookupInObjCMethod.  Doing so allows all sorts of invalid code
to slip through to codegen.  This patch does not change the
AST representation of super, though that would now be a natural
thing to do since it can only be in the receiver position and
in the base of a ObjCPropertyRefExpr.

There are still several ugly areas handling super in the parser,
but this is definitely a step in the right direction.

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

14 years agoactually the interface grossness in the previous patch was due to
Chris Lattner [Sun, 11 Apr 2010 07:51:10 +0000 (07:51 +0000)]
actually the interface grossness in the previous patch was due to
typo correction.  However, now that the code has been factored out
of LookupMemberExpr, it can recurse to itself instead of to
LookupMemberExpr!  Remove grossness.

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

14 years agofactor the code that handles "expr.field" when expr is a
Chris Lattner [Sun, 11 Apr 2010 07:45:24 +0000 (07:45 +0000)]
factor the code that handles "expr.field" when expr is a
pointer to an objc interface out to a method in SemaExprObjC.
This is *much* uglier than it should be due to grossness in
LookupMemberExpr :(

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

14 years agofix a problem causing us to lose the ''s around objc interface names
Chris Lattner [Sun, 11 Apr 2010 07:04:01 +0000 (07:04 +0000)]
fix a problem causing us to lose the ''s around objc interface names
in a diagnostic.

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

14 years agoSimplify test, in the hopes of making linux happy.
Daniel Dunbar [Sun, 11 Apr 2010 01:10:44 +0000 (01:10 +0000)]
Simplify test, in the hopes of making linux happy.

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

14 years agoEnable an assert and remove a now unnecessary assert.
Anders Carlsson [Sat, 10 Apr 2010 21:50:08 +0000 (21:50 +0000)]
Enable an assert and remove a now unnecessary assert.

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

14 years agoFix another vbase layout bug.
Anders Carlsson [Sat, 10 Apr 2010 21:35:33 +0000 (21:35 +0000)]
Fix another vbase layout bug.

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

14 years agoAdd a simple debug-only verification pass to the record layout builder.
Anders Carlsson [Sat, 10 Apr 2010 21:24:48 +0000 (21:24 +0000)]
Add a simple debug-only verification pass to the record layout builder.

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

14 years agoFix a bug where we would add the same function twice in a vtable.
Anders Carlsson [Sat, 10 Apr 2010 20:39:29 +0000 (20:39 +0000)]
Fix a bug where we would add the same function twice in a vtable.

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

14 years agorevert 100942, pending discussion.
Chris Lattner [Sat, 10 Apr 2010 19:33:39 +0000 (19:33 +0000)]
revert 100942, pending discussion.

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