]> granicus.if.org Git - clang/log
clang
15 years agoCleanups.
Mike Stump [Sat, 5 Sep 2009 08:47:24 +0000 (08:47 +0000)]
Cleanups.

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

15 years agoCleanups.
Mike Stump [Sat, 5 Sep 2009 08:45:02 +0000 (08:45 +0000)]
Cleanups.

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

15 years agoCleanups.
Mike Stump [Sat, 5 Sep 2009 08:40:18 +0000 (08:40 +0000)]
Cleanups.

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

15 years agoCleanups.
Mike Stump [Sat, 5 Sep 2009 08:37:03 +0000 (08:37 +0000)]
Cleanups.

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

15 years agoCleanups.
Mike Stump [Sat, 5 Sep 2009 08:07:32 +0000 (08:07 +0000)]
Cleanups.

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

15 years agoOverhaul the mangler to use a visitor pattern, at least for types. We can safely
John McCall [Sat, 5 Sep 2009 07:56:18 +0000 (07:56 +0000)]
Overhaul the mangler to use a visitor pattern, at least for types.  We can safely
ignore non-canonical type classes, but apparently we need to know how to mangle
dependent names.

The missing cases are much more obvious now.

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

15 years agoCleanups. WIP.
Mike Stump [Sat, 5 Sep 2009 07:49:12 +0000 (07:49 +0000)]
Cleanups.  WIP.

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

15 years agoPass the ConstructLoc to BuildCXXConstructExpr.
Anders Carlsson [Sat, 5 Sep 2009 07:40:38 +0000 (07:40 +0000)]
Pass the ConstructLoc to BuildCXXConstructExpr.

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

15 years agoInstall thunks later to fixup overrides. Track space taken by vbase
Mike Stump [Sat, 5 Sep 2009 07:20:32 +0000 (07:20 +0000)]
Install thunks later to fixup overrides.  Track space taken by vbase
offsets better for thunk refinements.  Cleanups.  WIP.

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

15 years agopass the correct predecessor node.
Zhongxing Xu [Sat, 5 Sep 2009 06:46:12 +0000 (06:46 +0000)]
pass the correct predecessor node.

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

15 years agoStart emitting ElaboratedTypes in C++ mode. Support the effort in various
John McCall [Sat, 5 Sep 2009 06:31:47 +0000 (06:31 +0000)]
Start emitting ElaboratedTypes in C++ mode.  Support the effort in various
ways:  remove elab types during desugaring, enhance pretty-printing to allow
tags to be suppressed without suppressing scopes, look through elab types
when associating a typedef name with an anonymous record type.

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

15 years agoDo not call FlushReports() in GRBugReporter's dtor. We already call it in
Zhongxing Xu [Sat, 5 Sep 2009 06:06:49 +0000 (06:06 +0000)]
Do not call FlushReports() in GRBugReporter's dtor. We already call it in
ActionGRExprEngine().

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

15 years agoReport errors for member functions correctly.
Anders Carlsson [Sat, 5 Sep 2009 05:38:54 +0000 (05:38 +0000)]
Report errors for member functions correctly.

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

15 years agoUse a separate diagnostic for default function argument expressions.
Anders Carlsson [Sat, 5 Sep 2009 05:14:19 +0000 (05:14 +0000)]
Use a separate diagnostic for default function argument expressions.

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

15 years agoRefactor builtin function evaluation code into its own function.
Zhongxing Xu [Sat, 5 Sep 2009 05:00:57 +0000 (05:00 +0000)]
Refactor builtin function evaluation code into its own function.

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

15 years agoAdd missing include.
Daniel Dunbar [Sat, 5 Sep 2009 00:48:32 +0000 (00:48 +0000)]
Add missing include.

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

15 years agoBasic support for representing elaborated type specifiers
John McCall [Sat, 5 Sep 2009 00:15:47 +0000 (00:15 +0000)]
Basic support for representing elaborated type specifiers
directly in the AST.  The current thinking is to create these
only in C++ mode for efficiency.  But for now, they're not being
created at all; patch to follow.

This will let us do things like verify that tags match during
template instantation, as well as signal that an elaborated type
specifier was used for clients that actually care.

Optimally, the TypeLoc hierarchy should be adjusted to carry tag
location information as well.

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

15 years agoImprove the AST representation and semantic analysis for extern
Douglas Gregor [Fri, 4 Sep 2009 22:48:11 +0000 (22:48 +0000)]
Improve the AST representation and semantic analysis for extern
templates. We now distinguish between an explicit instantiation
declaration and an explicit instantiation definition, and know not to
instantiate explicit instantiation declarations. Unfortunately, there
is some remaining confusion w.r.t. instantiation of out-of-line member
function definitions that causes trouble here.

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

15 years agoDon't generate any code for an explicit call to a trivial destructor.
Douglas Gregor [Fri, 4 Sep 2009 19:04:08 +0000 (19:04 +0000)]
Don't generate any code for an explicit call to a trivial destructor.

Now that parsing, semantic analysis, and (I think) code generation of
pseudo-destructor expressions and explicit destructor calls works,
update the example-dynarray.cpp test to destroy the objects it
allocates and update the test to actually compile + link.
The code seems correct, but the Clang-compiled version dies with a
malloc error. Time to debug!

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

15 years agoCleanup.
Mike Stump [Fri, 4 Sep 2009 18:54:10 +0000 (18:54 +0000)]
Cleanup.

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

15 years agoMerge libgcc spec changes for darwin::Link::ConstructJob.
Daniel Dunbar [Fri, 4 Sep 2009 18:35:47 +0000 (18:35 +0000)]
Merge libgcc spec changes for darwin::Link::ConstructJob.

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

15 years agoTweak darwin::Link::AddLinkArgs.
Daniel Dunbar [Fri, 4 Sep 2009 18:35:41 +0000 (18:35 +0000)]
Tweak darwin::Link::AddLinkArgs.

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

15 years agoImplement darwin::Link::AddDarwinArch for ARM.
Daniel Dunbar [Fri, 4 Sep 2009 18:35:31 +0000 (18:35 +0000)]
Implement darwin::Link::AddDarwinArch for ARM.

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

15 years agoDarwin: Pass -iphoneos-version-min to ld when building for ARM.
Daniel Dunbar [Fri, 4 Sep 2009 18:35:21 +0000 (18:35 +0000)]
Darwin: Pass -iphoneos-version-min to ld when building for ARM.

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

15 years agoAlso compare stdout and stderr lines.
Daniel Dunbar [Fri, 4 Sep 2009 18:35:09 +0000 (18:35 +0000)]
Also compare stdout and stderr lines.

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

15 years agoAdd -ccc-install-dir option for faking installation path.
Daniel Dunbar [Fri, 4 Sep 2009 18:35:03 +0000 (18:35 +0000)]
Add -ccc-install-dir option for faking installation path.

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

15 years agoRename Darwin_X86 toolchain to just Darwin, this can support all platforms.
Daniel Dunbar [Fri, 4 Sep 2009 18:34:51 +0000 (18:34 +0000)]
Rename Darwin_X86 toolchain to just Darwin, this can support all platforms.

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

15 years agoIf a destructor is referenced or a pseudo-destructor expression is
Douglas Gregor [Fri, 4 Sep 2009 18:29:40 +0000 (18:29 +0000)]
If a destructor is referenced or a pseudo-destructor expression is
formed without a trailing '(', diagnose the error (these expressions
must be immediately called), emit a fix-it hint, and fix the code.

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

15 years agoAdd overidding for methods for vtable building for the secondary
Mike Stump [Fri, 4 Sep 2009 18:27:16 +0000 (18:27 +0000)]
Add overidding for methods for vtable building for the secondary
vtables.  Add thunk generation.  WIP.

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

15 years agoUse llvm::sys::getHostTriple, not LLVM_HOSTTRIPLE.
Daniel Dunbar [Fri, 4 Sep 2009 17:43:10 +0000 (17:43 +0000)]
Use llvm::sys::getHostTriple, not LLVM_HOSTTRIPLE.

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

15 years agoMake CmpDriver less stupid.
Daniel Dunbar [Fri, 4 Sep 2009 17:41:47 +0000 (17:41 +0000)]
Make CmpDriver less stupid.

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

15 years agoSupport 'make test TESTSUITE=CodeGen', etc.
Daniel Dunbar [Fri, 4 Sep 2009 17:40:27 +0000 (17:40 +0000)]
Support 'make test TESTSUITE=CodeGen', etc.

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

15 years agoRemove unused argument.
Daniel Dunbar [Fri, 4 Sep 2009 17:39:02 +0000 (17:39 +0000)]
Remove unused argument.

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

15 years agoImplement AST, semantics, and CodeGen for C++ pseudo-destructor
Douglas Gregor [Fri, 4 Sep 2009 17:36:40 +0000 (17:36 +0000)]
Implement AST, semantics, and CodeGen for C++ pseudo-destructor
expressions, e.g.,

  p->~T()

when p is a pointer to a scalar type.

We don't currently diagnose errors when pseudo-destructor expressions
are used in any way other than by forming a call.

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

15 years agoImplement accessors clang_getCursorKind(), clang_getCursorDecl().
Steve Naroff [Fri, 4 Sep 2009 15:44:05 +0000 (15:44 +0000)]
Implement accessors clang_getCursorKind(), clang_getCursorDecl().
Implement clang_getCursor() - wired up to Argiris's work.
Implement callbacks for CXCursor_ObjCProtocolRef.

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

15 years agoWhen searching for a default constructor or copy constructor, skip constructor templates
Douglas Gregor [Fri, 4 Sep 2009 14:46:39 +0000 (14:46 +0000)]
When searching for a default constructor or copy constructor, skip constructor templates

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

15 years agoParse extern templates, pass that information all the way to Sema,
Douglas Gregor [Fri, 4 Sep 2009 06:33:52 +0000 (06:33 +0000)]
Parse extern templates, pass that information all the way to Sema,
then drop it on the floor.

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

15 years agoIntroduce an egregious hack to fix PR4828.
Douglas Gregor [Fri, 4 Sep 2009 05:53:02 +0000 (05:53 +0000)]
Introduce an egregious hack to fix PR4828.

The problem this change addresses is that we treat __is_pod and
__is_empty as keywords in C++, because they are built-in type traits
in GCC >= 4.3. However, GNU libstdc++ 4.2 (and possibly earlier
versions) define implementation-detail struct templates named __is_pod
and __is_empty.

This commit solves the problem by recognizing

  struct __is_pod

and

  struct __is_empty

as special token sequences. When one of these token sequences is
encountered, the keyword (__is_pod or __is_empty) is implicitly
downgraded to an identifier so that parsing can continue. This is an
egregious hack, but it has the virtue of "just working" whether
someone is using libstdc++ 4.2 or not, without the need for special
flags.

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

15 years agoActually initialize HasQualifier and HasExplicitTemplateArgumentList in the EmptyShel...
Douglas Gregor [Fri, 4 Sep 2009 05:04:07 +0000 (05:04 +0000)]
Actually initialize HasQualifier and HasExplicitTemplateArgumentList in the EmptyShell constructor for MemberExpr. Should clear up some valgrind failures in PCH reading

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

15 years agoAdd a valgrind suppressions file for x86_64-pc-linux-gnu and gcc-4.3.3 which
Daniel Dunbar [Fri, 4 Sep 2009 02:53:57 +0000 (02:53 +0000)]
Add a valgrind suppressions file for x86_64-pc-linux-gnu and gcc-4.3.3 which
suppresses the overlapped memcpy in stable_sort that clang triggers.

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

15 years agoAdd --vg-arg option to clang test runner.
Daniel Dunbar [Fri, 4 Sep 2009 02:53:50 +0000 (02:53 +0000)]
Add --vg-arg option to clang test runner.
 - Passes additional argument through to valgrind.

Also, don't run valgrind with --leak-check=no by default.

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

15 years agomove the check into MarkNoReturnFunction.
Zhongxing Xu [Fri, 4 Sep 2009 02:17:35 +0000 (02:17 +0000)]
move the check into MarkNoReturnFunction.

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

15 years agoExtract mark-no-return-function code into a function.
Zhongxing Xu [Fri, 4 Sep 2009 02:13:36 +0000 (02:13 +0000)]
Extract mark-no-return-function code into a function.

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

15 years agoCorrectly handle elaborated template ids. Still not handled properly for friends.
John McCall [Fri, 4 Sep 2009 01:14:41 +0000 (01:14 +0000)]
Correctly handle elaborated template ids.  Still not handled properly for friends.

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

15 years agoPatch to instantiate destructors used to destruct
Fariborz Jahanian [Thu, 3 Sep 2009 23:18:17 +0000 (23:18 +0000)]
Patch to instantiate destructors used to destruct
base and data members when they are needed.

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

15 years agoIf the alignment of the chosen field in a union is greater than the alignment of...
Anders Carlsson [Thu, 3 Sep 2009 22:56:02 +0000 (22:56 +0000)]
If the alignment of the chosen field in a union is greater than the alignment of the union, we need to use a packed LLVM struct. Fixes <rdar://problem/7184250>.

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

15 years agoImplement tree transformations for DeclarationNames. Among other
Douglas Gregor [Thu, 3 Sep 2009 22:13:48 +0000 (22:13 +0000)]
Implement tree transformations for DeclarationNames. Among other
things, this means that we can properly cope with member access
expressions such as

  t->operator T()

where T is a template parameter (or other dependent type).

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

15 years agoUpdate C++ status, since a bunch of the comments were out-of-date
Douglas Gregor [Thu, 3 Sep 2009 21:51:43 +0000 (21:51 +0000)]
Update C++ status, since a bunch of the comments were out-of-date

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

15 years agoImprove template instantiation for member access expressions that
Douglas Gregor [Thu, 3 Sep 2009 21:38:09 +0000 (21:38 +0000)]
Improve template instantiation for member access expressions that
involve qualified names, e.g., x->Base::f. We now maintain enough
information in the AST to compare the results of the name lookup of
"Base" in the scope of the postfix-expression (determined at template
definition time) and in the type of the object expression.

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

15 years agoMark constructors used in initialization of base(s) and fields
Fariborz Jahanian [Thu, 3 Sep 2009 21:32:41 +0000 (21:32 +0000)]
Mark constructors used in initialization of base(s) and fields
as referecned with location where they are used. Still
need to look at destructor aspects of them.

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

15 years agoIssue diagnostics in variety of situations involving
Fariborz Jahanian [Thu, 3 Sep 2009 19:36:46 +0000 (19:36 +0000)]
Issue diagnostics in variety of situations involving
reference/const data members when user has declared
the constructor. This necessitated some non-minor
refactoring.

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

15 years agoDon't use '%ll', this doesn't workin on Win32.
Daniel Dunbar [Thu, 3 Sep 2009 19:23:49 +0000 (19:23 +0000)]
Don't use '%ll', this doesn't workin on Win32.

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

15 years agoAdd ASTUnit::getOriginalSourceFileName() and use in clang_getTranslationUnitSpelling().
Steve Naroff [Thu, 3 Sep 2009 18:19:54 +0000 (18:19 +0000)]
Add ASTUnit::getOriginalSourceFileName() and use in clang_getTranslationUnitSpelling().

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

15 years agoImproved handling for dependent, qualified member access expressions, e.g.,
Douglas Gregor [Thu, 3 Sep 2009 16:14:30 +0000 (16:14 +0000)]
Improved handling for dependent, qualified member access expressions, e.g.,

  t->Base::f

where t has a dependent type. We save the nested-name-specifier in the
CXXUnresolvedMemberExpr then, during instantiation, substitute into
the nested-name-specifier with the (transformed) object type of t, so
that we get name lookup into the type of the object expression.

Note that we do not yet retain information about name lookup into the
lexical scope of the member access expression, so several regression
tests are still disabled.

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

15 years ago- Add back some harmless code that part of a reverted commit (r80859). I'll investiga...
Steve Naroff [Thu, 3 Sep 2009 15:49:00 +0000 (15:49 +0000)]
- Add back some harmless code that part of a reverted commit (r80859). I'll investigate the lifetime snafu (with ASTUnit) separately.
- Traverse category methods, add a "class ref" and make the little test harness a bit more flexible.

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

15 years agoSave/load POSIXThreads flag for PCH
Douglas Gregor [Thu, 3 Sep 2009 14:36:33 +0000 (14:36 +0000)]
Save/load POSIXThreads flag for PCH

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

15 years agoRevert "Visit function/method bodies and issue callback for parameters and local
Daniel Dunbar [Thu, 3 Sep 2009 05:59:50 +0000 (05:59 +0000)]
Revert "Visit function/method bodies and issue callback for parameters and local
variables.", this is breaking x86_64-apple-darwin10 and Linux tests.

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

15 years agoRevert "Remove redundant local variable (use newly created instance data).", the
Daniel Dunbar [Thu, 3 Sep 2009 05:59:35 +0000 (05:59 +0000)]
Revert "Remove redundant local variable (use newly created instance data).", the
previous commit this depends on is breaking x86_64-apple-darwin10 and Linux tests.

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

15 years agoAdd basic support for -pthread.
Daniel Dunbar [Thu, 3 Sep 2009 04:54:28 +0000 (04:54 +0000)]
Add basic support for -pthread.
 - Patch by David Chisnall, with PCH and Darwin support mixed in.

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

15 years agoTweak comment.
Daniel Dunbar [Thu, 3 Sep 2009 04:54:12 +0000 (04:54 +0000)]
Tweak comment.

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

15 years agoFix 80 column violations.
Ted Kremenek [Thu, 3 Sep 2009 03:02:58 +0000 (03:02 +0000)]
Fix 80 column violations.

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

15 years agoFixed bug introduced in r79900 where FreeBSD was turned into NetBSD, transposing...
David Chisnall [Thu, 3 Sep 2009 01:48:05 +0000 (01:48 +0000)]
Fixed bug introduced in r79900 where FreeBSD was turned into NetBSD, transposing the ABIs and breaking both platforms.

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

15 years agoFix regression introduced in r80786 and reported in PR 4867. We should use
Ted Kremenek [Thu, 3 Sep 2009 01:48:03 +0000 (01:48 +0000)]
Fix regression introduced in r80786 and reported in PR 4867. We should use
'dyn_cast' instead of 'cast' as the denominator value could be UnknownVal (and
is not guaranteed to be a DefinedVal).

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

15 years agoremove a debug output I introduced in the last commit.
Zhongxing Xu [Thu, 3 Sep 2009 01:31:59 +0000 (01:31 +0000)]
remove a debug output I introduced in the last commit.

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

15 years agoUpdate.
Mike Stump [Thu, 3 Sep 2009 01:30:36 +0000 (01:30 +0000)]
Update.

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

15 years agoAdd CastExpr::getCastKindName and use it in the StmtDumper.
Anders Carlsson [Thu, 3 Sep 2009 00:59:21 +0000 (00:59 +0000)]
Add CastExpr::getCastKindName and use it in the StmtDumper.

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

15 years agoRemove redundant local variable (use newly created instance data).
Steve Naroff [Thu, 3 Sep 2009 00:43:52 +0000 (00:43 +0000)]
Remove redundant local variable (use newly created instance data).

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

15 years agoThis patch does the following.
Fariborz Jahanian [Thu, 3 Sep 2009 00:43:07 +0000 (00:43 +0000)]
This patch does the following.
1) Issue digsnostics in non-fragile ABI, when an expression
   evaluates to an interface type (except when it is used to
   access a non-fragile ivar).
2) Issue unsupported error in fragile ABI when an expression
   evaluates to an interface type (except when it is used to
   access a fragile ivar).

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

15 years agoVisit function/method bodies and issue callback for parameters and local variables.
Steve Naroff [Thu, 3 Sep 2009 00:32:06 +0000 (00:32 +0000)]
Visit function/method bodies and issue callback for parameters and local variables.
Add clang_getTranslationUnitSpelling().

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

15 years agoAdd a wicked little test-case that illustrates what we have to deal
Douglas Gregor [Wed, 2 Sep 2009 23:58:38 +0000 (23:58 +0000)]
Add a wicked little test-case that illustrates what we have to deal
with to properly support member access expressions in templates. This
test is XFAIL'd, because we get it completely wrong, but I've made the
minimal changes to the representation to at least avoid a crash.

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

15 years agoDon't try to CodeGen using directives, from Anders Johnsen
Douglas Gregor [Wed, 2 Sep 2009 23:49:23 +0000 (23:49 +0000)]
Don't try to CodeGen using directives, from Anders Johnsen

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

15 years agoInitialize targets before parsing command line options, so --version shows registered...
Daniel Dunbar [Wed, 2 Sep 2009 23:20:15 +0000 (23:20 +0000)]
Initialize targets before parsing command line options, so --version shows registered targets.

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

15 years agoMinor refactoring of my last patch.
Fariborz Jahanian [Wed, 2 Sep 2009 23:11:48 +0000 (23:11 +0000)]
Minor refactoring of my last patch.

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

15 years agoReferenced instatiated default constructors
Fariborz Jahanian [Wed, 2 Sep 2009 23:02:57 +0000 (23:02 +0000)]
Referenced instatiated default constructors
must be defined. Fixed pr4853.

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

15 years agoRewrite of our handling of name lookup in C++ member access expressions, e.g.,
Douglas Gregor [Wed, 2 Sep 2009 22:59:36 +0000 (22:59 +0000)]
Rewrite of our handling of name lookup in C++ member access expressions, e.g.,

  x->Base::f

We no longer try to "enter" the context of the type that "x" points
to. Instead, we drag that object type through the parser and pass it
into the Sema routines that need to know how to perform lookup within
member access expressions.

We now implement most of the crazy name lookup rules in C++
[basic.lookup.classref] for non-templated code, including performing
lookup both in the context of the type referred to by the member
access and in the scope of the member access itself and then detecting
ambiguities when the two lookups collide (p1 and p4; p3 and p7 are
still TODO). This change also corrects our handling of name lookup
within template arguments of template-ids inside the
nested-name-specifier (p6; we used to look into the scope of the
object expression for them) and fixes PR4703.

I have disabled some tests that involve member access expressions
where the object expression has dependent type, because we don't yet
have the ability to describe dependent nested-name-specifiers starting
with an identifier.

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

15 years agoAdded a FIXME to the test case.
Fariborz Jahanian [Wed, 2 Sep 2009 21:24:14 +0000 (21:24 +0000)]
Added a FIXME to the test case.

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

15 years agoFix an assertion when initializing a union using a member initializer. (We weren...
Anders Carlsson [Wed, 2 Sep 2009 21:14:47 +0000 (21:14 +0000)]
Fix an assertion when initializing a union using a member initializer. (We weren't casting from the union type to the initializer type correctly).

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

15 years agoChanged abi mode for these test which are dereferencing
Fariborz Jahanian [Wed, 2 Sep 2009 21:06:27 +0000 (21:06 +0000)]
Changed abi mode for these test which are dereferencing
an interface pointer.

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

15 years agoFix a crash when referencing static data members.
Anders Carlsson [Wed, 2 Sep 2009 21:01:21 +0000 (21:01 +0000)]
Fix a crash when referencing static data members.

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

15 years agoUpdate checker build.
Ted Kremenek [Wed, 2 Sep 2009 20:27:08 +0000 (20:27 +0000)]
Update checker build.

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

15 years agoFix warnings.
Eli Friedman [Wed, 2 Sep 2009 20:07:26 +0000 (20:07 +0000)]
Fix warnings.

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

15 years agoBorrow a friend class's previous declaration's access specifier regardless of
John McCall [Wed, 2 Sep 2009 19:32:14 +0000 (19:32 +0000)]
Borrow a friend class's previous declaration's access specifier regardless of
whether the current context is dependent.

Thanks to Anders for pointing this out.

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

15 years agoFix a codegen crash when a class template has a constructor that does member initiali...
Anders Carlsson [Wed, 2 Sep 2009 19:17:55 +0000 (19:17 +0000)]
Fix a codegen crash when a class template has a constructor that does member initialization of an anonymous union.

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

15 years agoFix some newly added bugs uncovered by the RELEASE build.
Steve Naroff [Wed, 2 Sep 2009 18:58:52 +0000 (18:58 +0000)]
Fix some newly added bugs uncovered by the RELEASE build.

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

15 years agoStart issuing callback for references (add some predicates, refactor some code).
Steve Naroff [Wed, 2 Sep 2009 18:26:48 +0000 (18:26 +0000)]
Start issuing callback for references (add some predicates, refactor some code).

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

15 years agoPacked unions should be packed. Fixes an assert Daniel reported.
Anders Carlsson [Wed, 2 Sep 2009 17:51:33 +0000 (17:51 +0000)]
Packed unions should be packed. Fixes an assert Daniel reported.

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

15 years agoAllow null initialization of scalara data members
Fariborz Jahanian [Wed, 2 Sep 2009 17:10:17 +0000 (17:10 +0000)]
Allow null initialization of scalara data members
in constructors's initializer list. pr4854

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

15 years agoFlesh out CXCursorKind...
Steve Naroff [Wed, 2 Sep 2009 13:28:54 +0000 (13:28 +0000)]
Flesh out CXCursorKind...

- More declaration types (distinguish between struct/union/class, instance/class methods).
- Add definition types (class, category, function, instance/class method, etc.).

Add client data to clang_loadDeclaration() and implement.

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

15 years agoRefactor the check for bad divide into a checker.
Zhongxing Xu [Wed, 2 Sep 2009 13:26:26 +0000 (13:26 +0000)]
Refactor the check for bad divide into a checker.

Also fix a checker context bug: the Dst set is not always empty initially.
Because in GRExprEngine::CheckerVisit(), *CurrSet is used repeatedly.
So we removed the Dst.empty() condition in ~CheckerContext() when deciding
whether to do autotransision.

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

15 years agoDocument how we intepret C++ DR 382
Douglas Gregor [Wed, 2 Sep 2009 13:12:51 +0000 (13:12 +0000)]
Document how we intepret C++ DR 382

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

15 years agoAdd a few more typename-specifier tests that involve simple-template-ids in the neste...
Douglas Gregor [Wed, 2 Sep 2009 13:07:20 +0000 (13:07 +0000)]
Add a few more typename-specifier tests that involve simple-template-ids in the nested-name-specifier

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

15 years agoWhen parsing typename specifiers (with either the identifier or
Douglas Gregor [Wed, 2 Sep 2009 13:05:45 +0000 (13:05 +0000)]
When parsing typename specifiers (with either the identifier or
simple-template-id form), check whether the scope specifier is
computable as a declaration context rather than checking whether it is
dependent, so that we properly cope with members of the current
instantiation.

Improve testing for typename specifiers that terminate in a
simpe-template-id.

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

15 years agoRefactor bad callee check into a Checker.
Zhongxing Xu [Wed, 2 Sep 2009 08:10:35 +0000 (08:10 +0000)]
Refactor bad callee check into a Checker.
Now bad callee is checked as a PreVisit to the CallExpr.

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

15 years agoStill use BadArg bugtype in the checker. This saves us implement registerInitialVisitors
Zhongxing Xu [Wed, 2 Sep 2009 07:09:39 +0000 (07:09 +0000)]
Still use BadArg bugtype in the checker. This saves us implement registerInitialVisitors
in the BugReport.

When all internal bug checking logic are moved to checkers, BuiltinBug will
not reference GRExprEngine, and FlushReports() will be not necessary, since
all bugs are emitted into the equivalent classes immediately.

For now just add a ctor with no arguments.

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

15 years agoReplace uses of ImmutableSet in SymbolReaper with DenseSet. This was
Ted Kremenek [Wed, 2 Sep 2009 06:03:18 +0000 (06:03 +0000)]
Replace uses of ImmutableSet in SymbolReaper with DenseSet.  This was
motivated from Shark profiles that shows that 'markLive' was very
heavy when using --analyzer-store=region.  On my benchmark file, this
reduces the analysis time for --analyzer-store=region from 19.5s to
13.5s and for --analyzer-store=basic from 5.3s to 3.5s.  For the
benchmark file, this is a reduction of about 30% analysis time for
both analysis modes (a huge win).

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

15 years agoImplement: <rdar://problem/6337100> CWE-338: Use of cryptographically weak prng
Ted Kremenek [Wed, 2 Sep 2009 02:47:41 +0000 (02:47 +0000)]
Implement: <rdar://problem/6337100> CWE-338: Use of cryptographically weak prng
Patch by Geoff Keating!

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

15 years agoWhen adding a friend class declaration to the lookup tables, use the access specifier
John McCall [Wed, 2 Sep 2009 02:15:17 +0000 (02:15 +0000)]
When adding a friend class declaration to the lookup tables, use the access specifier
of any previous declaration in case we replace it in a class's declaration table.
Fixes bug 4858.  This sort of thing makes me reconsider putting friend declarations in
declaration lists.

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

15 years agoFix a little crasher in friend decls. Thanks again to Eli for finding this.
John McCall [Wed, 2 Sep 2009 01:07:03 +0000 (01:07 +0000)]
Fix a little crasher in friend decls.  Thanks again to Eli for finding this.

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

15 years agoAdd mangling for covariant thunks.
Mike Stump [Wed, 2 Sep 2009 00:56:18 +0000 (00:56 +0000)]
Add mangling for covariant thunks.

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

15 years agoEnsure that the tag decls of friend decls aren't added to the friending class's
John McCall [Wed, 2 Sep 2009 00:55:30 +0000 (00:55 +0000)]
Ensure that the tag decls of friend decls aren't added to the friending class's
decl list, and remove some workarounds that were due to this.  Thanks to Eli for
pointing this out and providing the test case.

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