llvm-project/clang/Driver
Douglas Gregor a11693bc37 Implement support for operator overloading using candidate operator
functions for built-in operators, e.g., the builtin

  bool operator==(int const*, int const*)

can be used for the expression "x1 == x2" given:

  struct X {
    operator int const*();
  } x1, x2;

The scheme for handling these built-in operators is relatively simple:
for each candidate required by the standard, create a special kind of
candidate function for the built-in. If overload resolution picks the
built-in operator, we perform the appropriate conversions on the
arguments and then let the normal built-in operator take care of it. 

There may be some optimization opportunity left: if we can reduce the
number of built-in operator overloads we generate, overload resolution
for these cases will go faster. However, one must be careful when
doing this: GCC generates too few operator overloads in our little
test program, and fails to compile it because none of the overloads it
generates match.

Note that we only support operator overload for non-member binary
operators at the moment. The other operators will follow.

As part of this change, ImplicitCastExpr can now be an lvalue.

llvm-svn: 59148
2008-11-12 17:17:38 +00:00
..
ASTConsumers.cpp Rename 'HTMLDiagnostics.h' to 'PathDiagnosticClients.h' 2008-11-03 22:31:48 +00:00
ASTConsumers.h Added driver option "-cxx-inheritance-view" for viewing the C++ hierarchy of a class in GraphViz. 2008-10-23 23:36:29 +00:00
Analyses.def Hook up the Plist diagnostic client to the driver. 2008-11-03 23:18:07 +00:00
AnalysisConsumer.cpp Patch by Nikita Zhuk: Add TranslationUnitActions to AnalysisConsumer. 2008-11-07 02:09:25 +00:00
AnalysisConsumer.h Hook up the Plist diagnostic client to the driver. 2008-11-03 23:18:07 +00:00
Backend.cpp Move backend output out of destructor. 2008-11-11 06:35:39 +00:00
CMakeLists.txt CMake: Builds and installs clang binary and libs (no docs yet). It 2008-10-26 00:56:18 +00:00
CacheTokens.cpp Added the start of a prototype implementation of PCH based on token caching. 2008-10-21 00:54:44 +00:00
DependencyFile.cpp Improve dependency file support. 2008-10-27 20:01:06 +00:00
DiagChecker.cpp Remove unneeded CheckASTConsumer function. 2008-10-27 22:03:52 +00:00
HTMLPrint.cpp More #include cleaning 2008-08-11 04:54:23 +00:00
Makefile Use LINK_COMPONENTS instead of hard coding LLVM libraries. 2008-10-24 06:24:13 +00:00
PrintParserCallbacks.cpp Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof expressions, both of values and types. 2008-11-11 17:56:53 +00:00
PrintPreprocessedOutput.cpp Rename Characteristic_t to CharacteristicKind 2008-10-27 01:19:25 +00:00
RewriteBlocks.cpp Fix <rdar://problem/6336774> clang block rewriter: Assertion failed: Offset+NumBytes <= size() && "Invalid region to erase!", file c:\cygwin\home\Administrator\llvm\to ols\clang\include\clang/Rewrite/RewriteRope.h, line 219. 2008-11-03 11:20:24 +00:00
RewriteMacros.cpp Change how raw lexers are handled: instead of creating them and then 2008-10-12 01:15:46 +00:00
RewriteObjC.cpp Implement support for operator overloading using candidate operator 2008-11-12 17:17:38 +00:00
RewriteTest.cpp Add newline at the end of file, to silence compiler warning. 2008-10-20 08:12:48 +00:00
SerializationTest.cpp Patch by Csaba Hruska! 2008-09-13 05:16:45 +00:00
clang.cpp Move backend output out of destructor. 2008-11-11 06:35:39 +00:00
clang.h Remove unused function declaration. 2008-11-11 04:48:20 +00:00