]> granicus.if.org Git - clang/log
clang
14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 years agoRecord location info before emiting alloca for arguments. This allows arguments to...
Devang Patel [Thu, 8 Oct 2009 18:53:37 +0000 (18:53 +0000)]
Record location info before emiting alloca for arguments. This allows arguments to have proper location info.

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

14 years agoImplement [expr.mptr.oper]p6 for '->*' operator.
Fariborz Jahanian [Thu, 8 Oct 2009 18:00:39 +0000 (18:00 +0000)]
Implement [expr.mptr.oper]p6 for '->*' operator.

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

14 years agoRemove use of std::ofstream in HTMLDiagnostics.cpp.
Ted Kremenek [Thu, 8 Oct 2009 17:44:41 +0000 (17:44 +0000)]
Remove use of std::ofstream in HTMLDiagnostics.cpp.

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

14 years agoIf a global initializer has a non-trivial constructor or destructor, we never want...
Anders Carlsson [Thu, 8 Oct 2009 17:28:59 +0000 (17:28 +0000)]
If a global initializer has a non-trivial constructor or destructor, we never want to defer generation of it, even if it is declared static.

With this change we're finally able to compile and run the (infamous)

#include <string>
#include <iostream>

int main(int argc, char **argv) {
  std::cout << "Hello, World" << std::endl;
}

$ clang hello.cpp -lstdc++ -o hello
$ ./hello
Hello, World

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

14 years agoPort test over to FileCheck.
Anders Carlsson [Thu, 8 Oct 2009 17:22:47 +0000 (17:22 +0000)]
Port test over to FileCheck.

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

14 years agoMangle std::basic_ostream<char, std::char_traits<char>> as So.
Anders Carlsson [Thu, 8 Oct 2009 17:20:26 +0000 (17:20 +0000)]
Mangle std::basic_ostream<char, std::char_traits<char>> as So.

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

14 years agoAdd more testing for the properties of explicit specialization.
Douglas Gregor [Thu, 8 Oct 2009 16:41:22 +0000 (16:41 +0000)]
Add more testing for the properties of explicit specialization.

Also, eliminate a redundant diagnostic by marking a variable declared
with incomplete type as an invalid declaration.

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

14 years agoRefactoring to further simplify collection of visible conversion
Fariborz Jahanian [Thu, 8 Oct 2009 16:33:37 +0000 (16:33 +0000)]
Refactoring to further simplify collection of visible conversion
functions.

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

14 years agoDon't complain about out-of-line explicit specializations of member
Douglas Gregor [Thu, 8 Oct 2009 15:54:21 +0000 (15:54 +0000)]
Don't complain about out-of-line explicit specializations of member
function and member function templates that are not definitions. Add
more tests to ensure that explicit specializations of member function
templates prevent instantiation.

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

14 years agoMore testing for explicit specializations of member class templates
Douglas Gregor [Thu, 8 Oct 2009 15:27:05 +0000 (15:27 +0000)]
More testing for explicit specializations of member class templates

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

14 years agoImprove checking for specializations of member classes of class
Douglas Gregor [Thu, 8 Oct 2009 15:14:33 +0000 (15:14 +0000)]
Improve checking for specializations of member classes of class
templates, and keep track of how those member classes were
instantiated or specialized.

Make sure that we don't try to instantiate an explicitly-specialized
member class of a class template, when that explicit specialization
was a declaration rather than a definition.

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

14 years agoFor instantiations of static data members of class templates, keep
Douglas Gregor [Thu, 8 Oct 2009 07:24:58 +0000 (07:24 +0000)]
For instantiations of static data members of class templates, keep
track of the kind of specialization or instantiation. Also, check the
scope of the specialization and ensure that a specialization
declaration without an initializer is not a definition.

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

14 years agoMake sure to set the template specialization kind of an explicit
Douglas Gregor [Thu, 8 Oct 2009 01:19:17 +0000 (01:19 +0000)]
Make sure to set the template specialization kind of an explicit
template instantiation of a member function of a class template.
FIXME -= 2;

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

14 years agoCompress storage for MemberSpecializationInfo into a single
Douglas Gregor [Thu, 8 Oct 2009 00:19:07 +0000 (00:19 +0000)]
Compress storage for MemberSpecializationInfo into a single
pointer. Yay, PointerIntPair.

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

14 years agoOnly perform an implicit instantiation of a function if its template
Douglas Gregor [Thu, 8 Oct 2009 00:14:38 +0000 (00:14 +0000)]
Only perform an implicit instantiation of a function if its template
specialization kind is TSK_ImplicitInstantiation. Previously, we would
end up implicitly instantiating functions that had explicit
specialization declarations or explicit instantiation declarations
(with no corresponding definitions).

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

14 years agoKeep track of whether a member function instantiated from a member
Douglas Gregor [Wed, 7 Oct 2009 23:56:10 +0000 (23:56 +0000)]
Keep track of whether a member function instantiated from a member
function of a class template was implicitly instantiated, explicitly
instantiated (declaration or definition), or explicitly
specialized. The same MemberSpecializationInfo structure will be used
for static data members and member classes as well.

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

14 years agoRefactoring around friend class templates. Better error message for friend enums.
John McCall [Wed, 7 Oct 2009 23:34:25 +0000 (23:34 +0000)]
Refactoring around friend class templates.  Better error message for friend enums.
Don't create a new declaration for friend classes if a declaration already exists.

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

14 years agoType checking for specializations of member functions of class
Douglas Gregor [Wed, 7 Oct 2009 22:35:40 +0000 (22:35 +0000)]
Type checking for specializations of member functions of class
templates. Previously, these weren't handled as specializations at
all. The AST for representing these as specializations is still a work
in progress.

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

14 years agoHandle MemberExprs in ResolveAddressOfOverloadedFunction.
Anders Carlsson [Wed, 7 Oct 2009 22:26:29 +0000 (22:26 +0000)]
Handle MemberExprs in ResolveAddressOfOverloadedFunction.

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

14 years agoDead code elimination.
John McCall [Wed, 7 Oct 2009 22:04:40 +0000 (22:04 +0000)]
Dead code elimination.

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

14 years agoFixes problem in finding visible convertion functions of a class
Fariborz Jahanian [Wed, 7 Oct 2009 20:43:36 +0000 (20:43 +0000)]
Fixes problem in finding visible convertion functions of a class
where matching conversion types in base classes were still visible.
Plus refactoring and cleanup.
Added a test case.

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

14 years agoDiagnose explicit instantiations and specializations that occur in class scope
Douglas Gregor [Wed, 7 Oct 2009 17:30:37 +0000 (17:30 +0000)]
Diagnose explicit instantiations and specializations that occur in class scope

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

14 years agoWhen building candidate set for built-ins; when looking for
Fariborz Jahanian [Wed, 7 Oct 2009 17:26:09 +0000 (17:26 +0000)]
When building candidate set for built-ins; when looking for
convesion functions, look in base classes to.
(Removes a FIXME).

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

14 years agoClass template partial specializations can be declared anywhere that
Douglas Gregor [Wed, 7 Oct 2009 17:21:34 +0000 (17:21 +0000)]
Class template partial specializations can be declared anywhere that
its definition may be defined, including in a class.

Also, put in an assertion when trying to instantiate a class template
partial specialization of a member template, which is not yet
implemented.

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

14 years agoRemoved couple of unnecessary canonicalization
Fariborz Jahanian [Wed, 7 Oct 2009 16:56:50 +0000 (16:56 +0000)]
Removed couple of unnecessary canonicalization
per Doug's obsevation.

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

14 years agoAdd 'template' keyword to disambiguate the use of a member template within a template...
Ted Kremenek [Wed, 7 Oct 2009 06:20:14 +0000 (06:20 +0000)]
Add 'template' keyword to disambiguate the use of a member template within a templated class.  Hopefully this will please the buildbots.

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

14 years agoRevert r83443.
Ted Kremenek [Wed, 7 Oct 2009 03:21:11 +0000 (03:21 +0000)]
Revert r83443.

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

14 years agoMangle anonymous structs/unions correctly. Fixes PR5139.
Anders Carlsson [Wed, 7 Oct 2009 01:45:02 +0000 (01:45 +0000)]
Mangle anonymous structs/unions correctly. Fixes PR5139.

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

14 years agoFixup pathnames.
Mike Stump [Wed, 7 Oct 2009 01:11:54 +0000 (01:11 +0000)]
Fixup pathnames.

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

14 years agoAdd a MangleContext and pass it to all mangle functions. It will be used for keeping...
Anders Carlsson [Wed, 7 Oct 2009 01:06:45 +0000 (01:06 +0000)]
Add a MangleContext and pass it to all mangle functions. It will be used for keeping state, such as identifiers assigned to anonymous structs as well as scope encoding.

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

14 years agoMore testing of explicit specializations
Douglas Gregor [Wed, 7 Oct 2009 00:45:53 +0000 (00:45 +0000)]
More testing of explicit specializations

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

14 years agoChange ExplodedNode to have its NodeGroups all BumpPtrAllocated, avoiding malloc...
Ted Kremenek [Wed, 7 Oct 2009 00:42:52 +0000 (00:42 +0000)]
Change ExplodedNode to have its NodeGroups all BumpPtrAllocated, avoiding malloc() traffic when adding successors/predecessors to a node.  This was done by introducing BumpVector, which is essentially SmallVector with all memory being BumpPtrAllocated (this can certainly be cleaned up or moved into llvm/ADT).

This change yields a 1.8% speed increase when running the analyzer (with -analyzer-store=region) on a small benchmark file.

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

14 years agoForce a specific target triple in c-index-api-test.m, making the behavior of the...
Ted Kremenek [Wed, 7 Oct 2009 00:39:48 +0000 (00:39 +0000)]
Force a specific target triple in c-index-api-test.m, making the behavior of the test not be dependent on the host.

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

14 years agoRefactor checking of the scope of explicit template specialization
Douglas Gregor [Wed, 7 Oct 2009 00:13:32 +0000 (00:13 +0000)]
Refactor checking of the scope of explicit template specialization
declarations and explicit template instantiations, improving
diagnostics and making the code usable for function template
specializations (as well as class template specializations and partial
specializations).

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

14 years agoFix eof.
Mike Stump [Tue, 6 Oct 2009 23:38:59 +0000 (23:38 +0000)]
Fix eof.

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

14 years agoFix eof.
Mike Stump [Tue, 6 Oct 2009 23:38:31 +0000 (23:38 +0000)]
Fix eof.

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

14 years agoPatch to implement C++ [over.built]p11 of overload resolution.
Fariborz Jahanian [Tue, 6 Oct 2009 23:08:05 +0000 (23:08 +0000)]
Patch to implement C++ [over.built]p11 of overload resolution.
Doug, please review. There is a FIXME in the test case with a question
which is unrelated to this patch (that is, error is issued
before set of builtins are added to the candidate list).

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

14 years agoUncomment some commented out code.
Anders Carlsson [Tue, 6 Oct 2009 23:02:00 +0000 (23:02 +0000)]
Uncomment some commented out code.

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

14 years agoAdd codegen for __builtin_abort. Convert to FileCheck.
Mike Stump [Tue, 6 Oct 2009 22:58:45 +0000 (22:58 +0000)]
Add codegen for __builtin_abort.  Convert to FileCheck.

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

14 years agoChange GetAddressCXXOfBaseClass to use CXXBasePaths for calculating base class offset...
Anders Carlsson [Tue, 6 Oct 2009 22:43:30 +0000 (22:43 +0000)]
Change GetAddressCXXOfBaseClass to use CXXBasePaths for calculating base class offsets. Fix the code to handle virtual bases as well.

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

14 years agoAdd files to xcode project.
Anders Carlsson [Tue, 6 Oct 2009 22:07:00 +0000 (22:07 +0000)]
Add files to xcode project.

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

14 years agoWhen mangling names, always use the canonical decl. Fixes PR5144.
Anders Carlsson [Tue, 6 Oct 2009 21:58:01 +0000 (21:58 +0000)]
When mangling names, always use the canonical decl. Fixes PR5144.

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

14 years agoInsertSubprogramStart if ATTACH_DEBUG_INFO_TO_AN_INSN is not defined.
Devang Patel [Tue, 6 Oct 2009 21:53:41 +0000 (21:53 +0000)]
InsertSubprogramStart if ATTACH_DEBUG_INFO_TO_AN_INSN is not defined.

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

14 years agoTest explicit specialization for all of the various cases where
Douglas Gregor [Tue, 6 Oct 2009 21:27:51 +0000 (21:27 +0000)]
Test explicit specialization for all of the various cases where
explicit specializations can occur. Also, fix a minor recovery bug
where we should allow declarations coming from the parser to be NULL.

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

14 years agoAdd more of __builtin_abort, WIP, still missing codegen.
Mike Stump [Tue, 6 Oct 2009 20:30:09 +0000 (20:30 +0000)]
Add more of __builtin_abort, WIP, still missing codegen.

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

14 years agoUpdated checker build.
Ted Kremenek [Tue, 6 Oct 2009 20:19:01 +0000 (20:19 +0000)]
Updated checker build.

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

14 years agoAdd support to attach debug info to an instruction.
Devang Patel [Tue, 6 Oct 2009 18:36:08 +0000 (18:36 +0000)]
Add support to attach debug info to an instruction.
This is not yet enabled.

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

14 years agoFix test.
Anders Carlsson [Tue, 6 Oct 2009 18:12:12 +0000 (18:12 +0000)]
Fix test.

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