Commit Graph

7 Commits

Author SHA1 Message Date
Richard Smith 1ba0a07e46 Re-commit r214547 with tests fixed. Hopefully all the bots will be happy now.
Original message:

Fix iterator invalidation issues that are breaking my modules buildbot's
bootstrap.

llvm-svn: 214555
2014-08-01 20:39:36 +00:00
Hans Wennborg dfcb7d6a97 Defer codegen of inline method definitions to the end of current top level declaration
We would previously fail to emit a definition of bar() for the following code:

  struct __declspec(dllexport) S {
    void foo() {
      t->bar();
    }
    struct T {
      void bar() {}
    };
    T *t;
  };

Note that foo() is an exported method, but bar() is not. However, foo() refers
to bar() so we need to emit its definition. We would previously fail to
realise that bar() is used.

By deferring the method definitions until the end of the top level declaration,
we can simply call EmitTopLevelDecl on them and rely on the usual mechanisms
to decide whether the method should be emitted or not.

Differential Revision: http://reviews.llvm.org/D4038

llvm-svn: 210356
2014-06-06 17:36:17 +00:00
Hans Wennborg a926d84c4b Emit used/dllexport inline method definitions in nested classes (PR19743, PR11170)
The previous code that was supposed to handle this didn't work
since parsing of inline method definitions is delayed to the end
of the outer class definition. Thus, when HandleTagDeclDefinition()
got called for the inner class, the inline functions in that class
had not been parsed yet.

Richard suggested that the way to do this is by handling inline
method definitions through a new ASTConsumer callback.

I really wanted to call ASTContext::DeclMustBeEmitted() instead of
checking for attributes, but doing that causes us to compute linkage,
and then we fail with "error: unsupported: typedef changes linkage
of anonymous type, but linkage was already computed" on tests like
this: (from SemaCXX/undefined-internal.cpp) :-/

  namespace test7 {
    typedef struct {
      void bar();
      void foo() { bar(); }
    } A;
  }

Differential Revision: http://reviews.llvm.org/D3809

llvm-svn: 209549
2014-05-23 20:37:38 +00:00
Hans Wennborg c9bd88e681 Remove the -cxx-abi command-line flag.
This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples,
Itanium otherwise. It's no longer possible to do weird combinations.

To be able to run a test with a specific ABI without constraining it to a
specific triple, new substitutions are added to lit: %itanium_abi_triple and
%ms_abi_triple can be used to get the current target triple adjusted to the
desired ABI. For example, if the test suite is running with the i686-pc-win32
target, %itanium_abi_triple will expand to i686-pc-mingw32.

Differential Revision: http://llvm-reviews.chandlerc.com/D2545

llvm-svn: 199250
2014-01-14 19:35:09 +00:00
Hans Wennborg 442e4f7f5f Prepare for using MS ABI by default for Win32: update CodeGenCXX tests
llvm-svn: 197281
2013-12-13 22:43:52 +00:00
Eli Friedman a526f275e3 Whack a bunch of tests in CodeGenCXX to work on ARM (using ARM ABI). Batch 1 of 3 or so.
llvm-svn: 132945
2011-06-13 22:51:21 +00:00
Douglas Gregor e061015de8 Emit in-class member function definitions that are marked
"used". Fixes <rdar://problem/8684363>.

llvm-svn: 125579
2011-02-15 18:11:42 +00:00