]> granicus.if.org Git - clang/log
clang
15 years agoRefine handling for return value conversions with respect to virtual
Mike Stump [Tue, 13 Oct 2009 10:55:21 +0000 (10:55 +0000)]
Refine handling for return value conversions with respect to virtual
offsets for covariant thunks.

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

15 years agoSimplify pointer creation with the new Type::getInt*Ptr methods.
Benjamin Kramer [Tue, 13 Oct 2009 10:07:13 +0000 (10:07 +0000)]
Simplify pointer creation with the new Type::getInt*Ptr methods.

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

15 years agoTeach sema and codegen about the difference between address of labels,
Chris Lattner [Tue, 13 Oct 2009 07:14:16 +0000 (07:14 +0000)]
Teach sema and codegen about the difference between address of labels,
which is a common idiom to improve PIC'ness of code using the addr of
label extension.  This implementation is a gross hack, but the only other
alternative would be to teach evalutate about this horrid combination.
While GCC allows things like "&&foo - &&bar + 1", people don't use this
in practice.  This implements PR5131.

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

15 years agoreimplement codegen for indirect goto with the following advantages:
Chris Lattner [Tue, 13 Oct 2009 06:55:33 +0000 (06:55 +0000)]
reimplement codegen for indirect goto with the following advantages:

1. CGF now has fewer bytes of state (one pointer instead of a vector).
2. The generated code is determinstic, instead of getting labels in
   'map order' based on pointer addresses.
3. Clang now emits one 'indirect goto switch' for each function, instead
   of one for each indirect goto.  This fixes an M*N = N^2 IR size issue
   when there are lots of address-taken labels and lots of indirect gotos.
4. This also makes the default cause do something useful, reducing the
   size of the jump table needed (by one).

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

15 years agomerge an indirect goto test into statements, add another
Chris Lattner [Tue, 13 Oct 2009 06:52:43 +0000 (06:52 +0000)]
merge an indirect goto test into statements, add another
hairier (but nonsensical) example.

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

15 years agoReturn the original state by default.
Zhongxing Xu [Tue, 13 Oct 2009 06:07:58 +0000 (06:07 +0000)]
Return the original state by default.

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

15 years agonumber address-taken labels from 1. This allows 0 to be used as a sentinel
Chris Lattner [Tue, 13 Oct 2009 06:04:29 +0000 (06:04 +0000)]
number address-taken labels from 1.  This allows 0 to be used as a sentinel
for a null pointer.  In other words, "&&foo != NULL" will always work out to
true.

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

15 years agoUse the new Type::getInt8PtrTy method. This should probably be used in a lot
Chris Lattner [Tue, 13 Oct 2009 06:02:42 +0000 (06:02 +0000)]
Use the new Type::getInt8PtrTy method.  This should probably be used in a lot
more places in clang codegen now.

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

15 years agotest commit
John Thompson [Tue, 13 Oct 2009 05:45:19 +0000 (05:45 +0000)]
test commit

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

15 years agoadd rdar # I accidentally lost.
Chris Lattner [Tue, 13 Oct 2009 04:57:27 +0000 (04:57 +0000)]
add rdar # I accidentally lost.

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

15 years agomerge two tests.
Chris Lattner [Tue, 13 Oct 2009 04:56:49 +0000 (04:56 +0000)]
merge two tests.

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

15 years agomake the diagnostic in the 'unused result' warning more precise
Chris Lattner [Tue, 13 Oct 2009 04:53:48 +0000 (04:53 +0000)]
make the diagnostic in the 'unused result' warning more precise
about the reason, rdar://7186119.

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

15 years agofix PR4938 by recognizing % as a modifier on outputs,
Chris Lattner [Tue, 13 Oct 2009 04:32:07 +0000 (04:32 +0000)]
fix PR4938 by recognizing % as a modifier on outputs,
previously we only recognized it on inputs.

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

15 years agoNow we can call into another function with the CallInliner transfer function.
Zhongxing Xu [Tue, 13 Oct 2009 02:36:42 +0000 (02:36 +0000)]
Now we can call into another function with the CallInliner transfer function.

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

15 years agoAdd two utility methods.
Zhongxing Xu [Tue, 13 Oct 2009 02:29:58 +0000 (02:29 +0000)]
Add two utility methods.

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

15 years agoAdd an initial implementation of EnterStackFrame() to the StoreManager.
Zhongxing Xu [Tue, 13 Oct 2009 02:24:55 +0000 (02:24 +0000)]
Add an initial implementation of EnterStackFrame() to the StoreManager.

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

15 years agoDisable tests that check debug info intrinsic. This does not work if debug info intri...
Devang Patel [Mon, 12 Oct 2009 23:46:58 +0000 (23:46 +0000)]
Disable tests that check debug info intrinsic. This does not work if debug info intrinsics are not used to encode debug info.

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

15 years agoEnable "debug info attached to an instruction" mode.
Devang Patel [Mon, 12 Oct 2009 23:31:25 +0000 (23:31 +0000)]
Enable "debug info attached to an instruction" mode.

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

15 years agoMinor CSS fix
Douglas Gregor [Mon, 12 Oct 2009 23:15:14 +0000 (23:15 +0000)]
Minor CSS fix

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

15 years agoWhen declaring a class template whose name is qualified, make sure
Douglas Gregor [Mon, 12 Oct 2009 23:11:44 +0000 (23:11 +0000)]
When declaring a class template whose name is qualified, make sure
that the scope in which it is being declared is complete. Also, when
instantiating a member class template's ClassTemplateDecl, be sure to
delay type creation so that the resulting type is dependent. Ick.

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

15 years agoMinor margin fix
Douglas Gregor [Mon, 12 Oct 2009 22:52:00 +0000 (22:52 +0000)]
Minor margin fix

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

15 years agoTest explicit specialization involving multiple template<> headers
Douglas Gregor [Mon, 12 Oct 2009 22:33:31 +0000 (22:33 +0000)]
Test explicit specialization involving multiple template<> headers

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

15 years agoThere is no need to attach debug location info with alloca instruction.
Devang Patel [Mon, 12 Oct 2009 22:29:02 +0000 (22:29 +0000)]
There is no need to attach debug location info with alloca instruction.

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

15 years agoEncode long double.
Devang Patel [Mon, 12 Oct 2009 22:28:31 +0000 (22:28 +0000)]
Encode long double.

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

15 years agoPermit explicit specialization of member functions of class templates
Douglas Gregor [Mon, 12 Oct 2009 22:27:17 +0000 (22:27 +0000)]
Permit explicit specialization of member functions of class templates
that are declarations (rather than definitions). Also, be sure to set
the access specifiers properly when instantiating the declarations of
member function templates.

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

15 years agoMore appropriate API usage.
John McCall [Mon, 12 Oct 2009 22:25:59 +0000 (22:25 +0000)]
More appropriate API usage.

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

15 years agoImplement -Wparentheses: warn about using assignments in contexts that require
John McCall [Mon, 12 Oct 2009 21:59:07 +0000 (21:59 +0000)]
Implement -Wparentheses:  warn about using assignments in contexts that require
conditions.  Add a fixit to insert the parentheses.  Also fix a very minor
possible memory leak in 'for' conditions.

Fixes PR 4876 and rdar://problem/7289172

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

15 years agoTest explicit specializations of static data members that are declarations, not defin...
Douglas Gregor [Mon, 12 Oct 2009 21:37:59 +0000 (21:37 +0000)]
Test explicit specializations of static data members that are declarations, not definitions

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

15 years agoYet another test for explicit specialization, this one involving linkage
Douglas Gregor [Mon, 12 Oct 2009 21:21:22 +0000 (21:21 +0000)]
Yet another test for explicit specialization, this one involving linkage

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

15 years agoStore the key function of a record decl inside CGRecordLayout.
Anders Carlsson [Mon, 12 Oct 2009 21:16:22 +0000 (21:16 +0000)]
Store the key function of a record decl inside CGRecordLayout.

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

15 years agoUse a BumpPtrAllocator to allocate all aspects of CFG, including CFGBlocks, successor...
Ted Kremenek [Mon, 12 Oct 2009 20:55:07 +0000 (20:55 +0000)]
Use a BumpPtrAllocator to allocate all aspects of CFG, including CFGBlocks, successor and predecessor vectors, etc.

Speedup: when doing 'clang-cc -analyze -dump-cfg' (without actual printing, just
CFG building) on the amalgamated SQLite source (all of SQLite in one source
file), runtime reduced by 9%.

This fixes: <rdar://problem/7250745>

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

15 years agoFixup windows include paths. Patch by John Thompson.
Mike Stump [Mon, 12 Oct 2009 20:50:45 +0000 (20:50 +0000)]
Fixup windows include paths.  Patch by John Thompson.

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

15 years agoMore tests for explicit template specialization
Douglas Gregor [Mon, 12 Oct 2009 20:45:50 +0000 (20:45 +0000)]
More tests for explicit template specialization

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

15 years agoAdd test for last commit
Douglas Gregor [Mon, 12 Oct 2009 20:23:10 +0000 (20:23 +0000)]
Add test for last commit

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

15 years agoDiagnose the declaration of explicit specializations after an implicit
Douglas Gregor [Mon, 12 Oct 2009 20:18:28 +0000 (20:18 +0000)]
Diagnose the declaration of explicit specializations after an implicit
instantiation has already been required. To do so, keep track of the
point of instantiation for anything that can be instantiated.

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

15 years agoHandle built-in unary operators when reporting ambiguities.
Fariborz Jahanian [Mon, 12 Oct 2009 20:11:40 +0000 (20:11 +0000)]
Handle built-in unary operators when reporting ambiguities.
wip - To prune excessive reporting.

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

15 years agoFix test.
Anders Carlsson [Mon, 12 Oct 2009 20:06:34 +0000 (20:06 +0000)]
Fix test.

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

15 years agoEven more devirtualization cleverness.
Anders Carlsson [Mon, 12 Oct 2009 19:59:15 +0000 (19:59 +0000)]
Even more devirtualization cleverness.

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

15 years agoAllow BumpVectorContext to conditionally own the underlying BumpPtrAllocator.
Ted Kremenek [Mon, 12 Oct 2009 19:54:17 +0000 (19:54 +0000)]
Allow BumpVectorContext to conditionally own the underlying BumpPtrAllocator.

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

15 years agoMore devirtualization improvements.
Anders Carlsson [Mon, 12 Oct 2009 19:51:33 +0000 (19:51 +0000)]
More devirtualization improvements.

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

15 years agoDevirtualize calls on temporaries. A().f() for example.
Anders Carlsson [Mon, 12 Oct 2009 19:45:47 +0000 (19:45 +0000)]
Devirtualize calls on temporaries. A().f() for example.

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

15 years agoFactor out devirtualization checking into a separate function and make it handle...
Anders Carlsson [Mon, 12 Oct 2009 19:41:04 +0000 (19:41 +0000)]
Factor out devirtualization checking into a separate function and make it handle references correctly.

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

15 years agoUse CanQualType (instead of QualType) to store collection of visible
Fariborz Jahanian [Mon, 12 Oct 2009 18:36:50 +0000 (18:36 +0000)]
Use CanQualType (instead of QualType) to store collection of visible
canonical conversion types.

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

15 years agoIf built-in operators could not be selected because of ambiguity in
Fariborz Jahanian [Mon, 12 Oct 2009 17:51:19 +0000 (17:51 +0000)]
If built-in operators could not be selected because of ambiguity in
user-defined type conversions, issue list of ambiguites in addition
to the diagnostic. So, clang now issues the following:

b.cpp:19:19: error: left hand operand to ->* must be a pointer to class compatible with the right hand operand, but is 'struct C1'
        int i = c1->*pmf;
                ~~^
b.cpp:19:19: note: because of ambiguity in conversion of 'struct C1' to 'struct E *'
b.cpp:5:5: note: candidate function
    operator E*();
    ^
b.cpp:11:5: note: candidate function
    operator E*();
    ^

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

15 years agoDon't install Makefiles nor tablegen input in include/.
Axel Naumann [Mon, 12 Oct 2009 16:42:18 +0000 (16:42 +0000)]
Don't install Makefiles nor tablegen input in include/.
Fix exclusion of .tmp, which in turn enables installation of $(PROJ_OBJ_ROOT)/tools/clang/include/*.inc.

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

15 years agoTypo in AddGnuCPlusPlusIncludePaths.
Edward O'Callaghan [Mon, 12 Oct 2009 12:02:47 +0000 (12:02 +0000)]
Typo in AddGnuCPlusPlusIncludePaths.

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

15 years agoIf the base type of a member call is a record type we don't need to emit a virtual...
Anders Carlsson [Sun, 11 Oct 2009 23:55:52 +0000 (23:55 +0000)]
If the base type of a member call is a record type we don't need to emit a virtual call.

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

15 years agoRemove dead variable.
Benjamin Kramer [Sun, 11 Oct 2009 22:57:54 +0000 (22:57 +0000)]
Remove dead variable.

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

15 years agoAdd CGVtable.cpp to CMakeLists.
Benjamin Kramer [Sun, 11 Oct 2009 22:22:38 +0000 (22:22 +0000)]
Add CGVtable.cpp to CMakeLists.

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

15 years agoMove the vtable builder to CGVtable.cpp, general cleanup.
Anders Carlsson [Sun, 11 Oct 2009 22:13:54 +0000 (22:13 +0000)]
Move the vtable builder to CGVtable.cpp, general cleanup.

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

15 years agoChange mangleCXXVtable and mangleCXXRtti to take CXXRecordDecls instead of QualTypes.
Anders Carlsson [Sun, 11 Oct 2009 21:24:51 +0000 (21:24 +0000)]
Change mangleCXXVtable and mangleCXXRtti to take CXXRecordDecls instead of QualTypes.

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

15 years agoCMake mingw build fixes.
Benjamin Kramer [Sun, 11 Oct 2009 12:22:00 +0000 (12:22 +0000)]
CMake mingw build fixes.

- llvm's libs must be linked after clang's
- libLLVMSystem depends on psapi on win32 (get_system_libs has it)
- CIndex builds successfully on mingw now

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

15 years agoThis ought to complete exception spec support. Man, am I glad.
Sebastian Redl [Sun, 11 Oct 2009 09:14:57 +0000 (09:14 +0000)]
This ought to complete exception spec support. Man, am I glad.

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

15 years agoTypes appearing more than once in a spec shouldn't matter.
Sebastian Redl [Sun, 11 Oct 2009 09:11:23 +0000 (09:11 +0000)]
Types appearing more than once in a spec shouldn't matter.

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

15 years agoTest exception spec compatibility on return type and parameters.
Sebastian Redl [Sun, 11 Oct 2009 09:03:14 +0000 (09:03 +0000)]
Test exception spec compatibility on return type and parameters.

Along the way, use RequireCompleteType when testing exception spec types.
Separate all the ugly spec stuff into its own file.

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

15 years agoIntroduces a new BindingVal which combines direct and
Zhongxing Xu [Sun, 11 Oct 2009 08:08:02 +0000 (08:08 +0000)]
Introduces a new BindingVal which combines direct and
default binding for regions. This allows us to simply a lot of code. A
further simplification could be done is that many methods of
regionstore can only work on Store instead of GRState.

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

15 years agoMove our (non-existing) RTTI emission code into CGRtti.cpp. No functionality change.
Anders Carlsson [Sat, 10 Oct 2009 20:49:04 +0000 (20:49 +0000)]
Move our (non-existing) RTTI emission code into CGRtti.cpp. No functionality change.

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

15 years agoGenerate weak read barriers when reading a weak __block
Fariborz Jahanian [Sat, 10 Oct 2009 20:07:56 +0000 (20:07 +0000)]
Generate weak read barriers when reading a weak __block
variable inside the block.

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

15 years agoImplement the core checking for compatible exception specifications in assignment...
Sebastian Redl [Sat, 10 Oct 2009 12:04:10 +0000 (12:04 +0000)]
Implement the core checking for compatible exception specifications in assignment and initialization.

The exception specification of the assignee must be the same or a subset of the target. In addition, exception specifications on arguments and return types must be equivalent, but this is not implemented yet.
This currently produces two diagnostics for every invalid assignment/initialization, due to the diagnostic produced outside PerformImplicitConversion, e.g. in CheckSingleInitializer. I don't know how to suppress this; in any case I think it is the wrong place for a diagnostic, since there are other diagnostics produced inside the function. So I'm leaving it as it is for the moment.

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

15 years agoQualified lookup through using declarations. Diagnose a new type of ambiguity.
John McCall [Sat, 10 Oct 2009 05:48:19 +0000 (05:48 +0000)]
Qualified lookup through using declarations.  Diagnose a new type of ambiguity.
Split the various ambiguous result enumerators into their own enum.  Tests
for most of C++ [namespace.qual].

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

15 years agoCheck that the return type is complete when calling a member function.
Anders Carlsson [Sat, 10 Oct 2009 00:06:20 +0000 (00:06 +0000)]
Check that the return type is complete when calling a member function.

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

15 years agoAdd another test.
Anders Carlsson [Fri, 9 Oct 2009 23:58:25 +0000 (23:58 +0000)]
Add another test.

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

15 years agoAdd CheckCallReturnType and start using it for regular call expressions. This will...
Anders Carlsson [Fri, 9 Oct 2009 23:51:55 +0000 (23:51 +0000)]
Add CheckCallReturnType and start using it for regular call expressions. This will improve error messages. For

struct B;

B f();

void g() {
f();
}

We now get

t.cpp:6:3: error: calling 'f' with incomplete return type 'struct B'
  f();
  ^~~
t.cpp:3:3: note: 'f' declared here
B f();
  ^
t.cpp:1:8: note: forward declaration of 'struct B'
struct B;
       ^

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

15 years agoDead Code Elimination
Douglas Gregor [Fri, 9 Oct 2009 22:56:12 +0000 (22:56 +0000)]
Dead Code Elimination

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

15 years agoAdd some FIXMEs
Douglas Gregor [Fri, 9 Oct 2009 22:54:25 +0000 (22:54 +0000)]
Add some FIXMEs

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

15 years agoExperimental, ultra-hacking Emacs minor mode for Clang-based code completion.
Douglas Gregor [Fri, 9 Oct 2009 22:17:40 +0000 (22:17 +0000)]
Experimental, ultra-hacking Emacs minor mode for Clang-based code completion.

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

15 years agoMinor tweaks for code-completion:
Douglas Gregor [Fri, 9 Oct 2009 22:16:47 +0000 (22:16 +0000)]
Minor tweaks for code-completion:
  - Filter out unnamed declarations
  - Filter out declarations whose names are reserved for the
  implementation (e.g., __bar, _Foo)
  - Place OVERLOAD: or COMPLETION: at the beginning of each
  code-completion result, so we can easily separate them from other
  compilation results.

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

15 years agoUpdate Xcode project.
Anders Carlsson [Fri, 9 Oct 2009 22:16:24 +0000 (22:16 +0000)]
Update Xcode project.

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

15 years agoRevert 83567.
Devang Patel [Fri, 9 Oct 2009 22:06:15 +0000 (22:06 +0000)]
Revert 83567.

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

15 years agoRefactor the LookupResult API to simplify most common operations. Require users to
John McCall [Fri, 9 Oct 2009 21:13:30 +0000 (21:13 +0000)]
Refactor the LookupResult API to simplify most common operations.  Require users to
pass a LookupResult reference to lookup routines.  Call out uses which assume a single
result.

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

15 years agoWhen declaring a friend class template, we may end up finding an
Douglas Gregor [Fri, 9 Oct 2009 21:11:42 +0000 (21:11 +0000)]
When declaring a friend class template, we may end up finding an
injected-class-name (e.g., when we're referring to other
specializations of the current class template). Make sure that we see
the template rather than the injected-class-name. Fixes PR4768.

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

15 years agoEfficiency refinements.
Mike Stump [Fri, 9 Oct 2009 20:16:49 +0000 (20:16 +0000)]
Efficiency refinements.

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

15 years agoDo not install CMakeLists.txt (nor any other txt files) into include/ subdirectories
Axel Naumann [Fri, 9 Oct 2009 20:03:20 +0000 (20:03 +0000)]
Do not install CMakeLists.txt (nor any other txt files) into include/ subdirectories

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

15 years agoPush all the way out to 80.
Mike Stump [Fri, 9 Oct 2009 19:42:16 +0000 (19:42 +0000)]
Push all the way out to 80.

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

15 years agoPassing const Triple& is sufficient for AddDefaultSystemIncludePaths()
Axel Naumann [Fri, 9 Oct 2009 19:37:12 +0000 (19:37 +0000)]
Passing const Triple& is sufficient for AddDefaultSystemIncludePaths()

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

15 years agoAllow customization for the producer information in the debug output.
Mike Stump [Fri, 9 Oct 2009 18:38:12 +0000 (18:38 +0000)]
Allow customization for the producer information in the debug output.

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

15 years agoAllow customization for the version line.
Mike Stump [Fri, 9 Oct 2009 17:31:54 +0000 (17:31 +0000)]
Allow customization for the version line.

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

15 years agoProduce good looking diagnostics on ambiguous built-in operators.
Fariborz Jahanian [Fri, 9 Oct 2009 17:09:58 +0000 (17:09 +0000)]
Produce good looking diagnostics on ambiguous built-in operators.
Now we produce things like:
bug1.cpp:21:11: error: use of overloaded operator '->*' is ambiguous
        int i = c->*pmf;        // expected-error {{use of overloaded operator '->*' is ambiguous}} \
                ~^  ~~~
bug1.cpp:21:11: note: built-in candidate operator ->* ('struct A volatile *', 'int const struct A::*')
bug1.cpp:21:11: note: built-in candidate operator ->* ('struct A volatile *', 'int restrict struct A::*')
...

Still need to look at an issue (indicated as FIXME in the test case).

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

15 years agoUse the new API for applying the qualifiers on built-in '->*'
Fariborz Jahanian [Fri, 9 Oct 2009 16:34:40 +0000 (16:34 +0000)]
Use the new API for applying the qualifiers on built-in '->*'
operator's types.

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

15 years agoRemove unused code.
Zhongxing Xu [Fri, 9 Oct 2009 02:24:00 +0000 (02:24 +0000)]
Remove unused code.

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

15 years agoMake the behavior explicit by not using the method call.
Zhongxing Xu [Fri, 9 Oct 2009 02:18:31 +0000 (02:18 +0000)]
Make the behavior explicit by not using the method call.

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

15 years agoRemove unused code.
Zhongxing Xu [Fri, 9 Oct 2009 02:12:00 +0000 (02:12 +0000)]
Remove unused code.

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

15 years agoAvoid warning.
Mike Stump [Fri, 9 Oct 2009 01:25:47 +0000 (01:25 +0000)]
Avoid warning.

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

15 years agoImprove on reporting ambiguity involving built-in candidates.
Fariborz Jahanian [Fri, 9 Oct 2009 00:13:15 +0000 (00:13 +0000)]
Improve on reporting ambiguity involving built-in candidates.
I still don't like it but it is improvement over what we had.

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

15 years agoAdd a refactor pointer...
Mike Stump [Thu, 8 Oct 2009 23:57:53 +0000 (23:57 +0000)]
Add a refactor pointer...

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

15 years ago- Fixup SortCodeCompleteResult() to properly sort keywords on Mac OS (compare was...
Steve Naroff [Thu, 8 Oct 2009 23:45:10 +0000 (23:45 +0000)]
- Fixup SortCodeCompleteResult() to properly sort keywords on Mac OS (compare was system dependent). Worked on Linux, failed on Mac OS (which caused the recently added testcase to fail on Linux).
- Sort results in testcase.

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

15 years agoSet up include paths for VC++ and Cygwin headers, along with the
Mike Stump [Thu, 8 Oct 2009 23:29:47 +0000 (23:29 +0000)]
Set up include paths for VC++ and Cygwin headers, along with the
existing MinGW headers, plus the newer 4.4.0 version.  Patch by John
Thompson.

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

15 years agoSpeed up testing by avoiding stdio.h, also helps testing on windows.
Mike Stump [Thu, 8 Oct 2009 23:05:06 +0000 (23:05 +0000)]
Speed up testing by avoiding stdio.h, also helps testing on windows.
Patch by John Thompson.

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

15 years ago"Someone pointed out that in my previous Targets.cpp patch I didn't
Mike Stump [Thu, 8 Oct 2009 23:00:00 +0000 (23:00 +0000)]
"Someone pointed out that in my previous Targets.cpp patch I didn't
handle the long size difference for one of the Windows targets."  Patch
by John Thompson.

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

15 years agoThis fixes support for complex literals, reworked to avoid a goto, and
Mike Stump [Thu, 8 Oct 2009 22:55:36 +0000 (22:55 +0000)]
This fixes support for complex literals, reworked to avoid a goto, and
to add a flag noting the presence of a Microsoft extension suffix (i8,
i16, i32, i64).  Patch by John Thompson.

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

15 years agoTests for C++ [expr], from James Porter!
Douglas Gregor [Thu, 8 Oct 2009 22:38:14 +0000 (22:38 +0000)]
Tests for C++ [expr], from James Porter!

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

15 years agoTolerate .exe on executables. Patch by John Thompson. Changed * to .* by me.
Mike Stump [Thu, 8 Oct 2009 22:30:02 +0000 (22:30 +0000)]
Tolerate .exe on executables.  Patch by John Thompson.  Changed * to .* by me.

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

15 years agoTolerate .exe on executables. Patch by John Thompson.
Mike Stump [Thu, 8 Oct 2009 22:25:29 +0000 (22:25 +0000)]
Tolerate .exe on executables.  Patch by John Thompson.

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

15 years agoFix up error reporting when object cannot be constructed
Fariborz Jahanian [Thu, 8 Oct 2009 22:15:49 +0000 (22:15 +0000)]
Fix up error reporting when object cannot be constructed
because of missing default constructor of a member.
Fixes pr5154.

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

15 years agoInstallation of Clang libraries and headers, from Axel Naumann!
Douglas Gregor [Thu, 8 Oct 2009 22:15:31 +0000 (22:15 +0000)]
Installation of Clang libraries and headers, from Axel Naumann!

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

15 years agoIn VC++, the *printf functions put an extra "0" in the exponent part
Mike Stump [Thu, 8 Oct 2009 21:57:41 +0000 (21:57 +0000)]
In VC++, the *printf functions put an extra "0" in the exponent part
of a floating point number.  This add regular expressions to account
for this.  Patch by John Thompson.

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

15 years agoAdd code completion support for ObjC property declarations/attributes.
Steve Naroff [Thu, 8 Oct 2009 21:55:05 +0000 (21:55 +0000)]
Add code completion support for ObjC property declarations/attributes.

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

15 years agoConvert some tests to FileCheck to be more portable. Patch by John Thompson.
Mike Stump [Thu, 8 Oct 2009 21:52:07 +0000 (21:52 +0000)]
Convert some tests to FileCheck to be more portable.  Patch by John Thompson.

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

15 years agoImplement support for -Wunused-variable, from Oscar Bonilla!
Douglas Gregor [Thu, 8 Oct 2009 21:35:42 +0000 (21:35 +0000)]
Implement support for -Wunused-variable, from Oscar Bonilla!

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

15 years agoFix an assertion in the XML output, from Olaf Krzikalla!
Douglas Gregor [Thu, 8 Oct 2009 21:29:50 +0000 (21:29 +0000)]
Fix an assertion in the XML output, from Olaf Krzikalla!

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