r230477 - Revert r230448, "Reland r230314 "Fix codegen for virtual methods that are (re-) exported from multiple modules."", since I have reverted r230446.
NAKAMURA Takumi
geek4civic at gmail.com
Wed Feb 25 02:50:00 PST 2015
Author: chapuni
Date: Wed Feb 25 04:49:59 2015
New Revision: 230477
URL: http://llvm.org/viewvc/llvm-project?rev=230477&view=rev
Log:
Revert r230448, "Reland r230314 "Fix codegen for virtual methods that are (re-) exported from multiple modules."", since I have reverted r230446.
Removed:
cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/a.h
cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/b.h
cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/c.h
cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/merge-vtable-codegen.modulemap
cfe/trunk/test/Modules/merge-vtable-codegen.cpp
Modified:
cfe/trunk/lib/AST/VTableBuilder.cpp
Modified: cfe/trunk/lib/AST/VTableBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/VTableBuilder.cpp?rev=230477&r1=230476&r2=230477&view=diff
==============================================================================
--- cfe/trunk/lib/AST/VTableBuilder.cpp (original)
+++ cfe/trunk/lib/AST/VTableBuilder.cpp Wed Feb 25 04:49:59 2015
@@ -411,8 +411,7 @@ void FinalOverriders::dump(raw_ostream &
for (const auto *MD : RD->methods()) {
if (!MD->isVirtual())
continue;
- MD = MD->getCanonicalDecl();
-
+
OverriderInfo Overrider = getOverrider(MD, Base.getBaseOffset());
Out << " ";
@@ -696,7 +695,6 @@ void VCallAndVBaseOffsetBuilder::AddVCal
for (const auto *MD : RD->methods()) {
if (!MD->isVirtual())
continue;
- MD = MD->getCanonicalDecl();
CharUnits OffsetOffset = getCurrentOffsetOffset();
@@ -1516,7 +1514,6 @@ void ItaniumVTableBuilder::AddMethods(
for (const auto *MD : RD->methods()) {
if (!MD->isVirtual())
continue;
- MD = MD->getCanonicalDecl();
// Get the final overrider.
FinalOverriders::OverriderInfo Overrider =
@@ -2199,7 +2196,6 @@ void ItaniumVTableBuilder::dumpLayout(ra
// We only want virtual member functions.
if (!MD->isVirtual())
continue;
- MD = MD->getCanonicalDecl();
std::string MethodName =
PredefinedExpr::ComputeName(PredefinedExpr::PrettyFunctionNoVirtual,
Removed: cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/a.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/a.h?rev=230476&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/a.h (original)
+++ cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/a.h (removed)
@@ -1,8 +0,0 @@
-#ifndef A_H
-#define A_H
-
-struct A {
- virtual void x();
-};
-
-#endif
Removed: cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/b.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/b.h?rev=230476&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/b.h (original)
+++ cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/b.h (removed)
@@ -1,17 +0,0 @@
-#ifndef B_H
-#define B_H
-
-#include "a.h"
-
-class B : virtual public A {
- virtual void x() {}
-};
-
-void b(A* p) {
- p->x();
- // Instantiating a class that virtually inherits 'A'
- // triggers calculation of the vtable offsets in 'A'.
- B b;
-}
-
-#endif
Removed: cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/c.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/c.h?rev=230476&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/c.h (original)
+++ cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/c.h (removed)
@@ -1,6 +0,0 @@
-#ifndef C_H
-#define C_H
-
-#include "a.h"
-
-#endif
Removed: cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/merge-vtable-codegen.modulemap
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/merge-vtable-codegen.modulemap?rev=230476&view=auto
==============================================================================
--- cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/merge-vtable-codegen.modulemap (original)
+++ cfe/trunk/test/Modules/Inputs/merge-vtable-codegen/merge-vtable-codegen.modulemap (removed)
@@ -1,11 +0,0 @@
-module "a" {
- textual header "a.h"
-}
-
-module "b" {
- header "b.h"
-}
-
-module "c" {
- header "c.h"
-}
Removed: cfe/trunk/test/Modules/merge-vtable-codegen.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/merge-vtable-codegen.cpp?rev=230476&view=auto
==============================================================================
--- cfe/trunk/test/Modules/merge-vtable-codegen.cpp (original)
+++ cfe/trunk/test/Modules/merge-vtable-codegen.cpp (removed)
@@ -1,24 +0,0 @@
-// RUN: rm -rf %t
-
-// First, build two modules that both re-export the same header.
-// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fmodule-name=b -o %t/b.pcm -fmodule-maps \
-// RUN: -emit-module %S/Inputs/merge-vtable-codegen/merge-vtable-codegen.modulemap \
-// RUN: -I %S/Inputs/merge-vtable-codegen
-// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fmodule-name=c -o %t/c.pcm -fmodule-maps \
-// RUN: -emit-module %S/Inputs/merge-vtable-codegen/merge-vtable-codegen.modulemap \
-// RUN: -I %S/Inputs/merge-vtable-codegen
-
-// Use the two modules in a single compile.
-// RUN: %clang_cc1 -x c++ -std=c++11 -fmodules -fmodule-file=%t/b.pcm -fmodule-file=%t/c.pcm \
-// RUN: -fmodule-map-file=%S/Inputs/merge-vtable-codegen/merge-vtable-codegen.modulemap \
-// RUN: -emit-llvm -o %t/test.o %s
-
-// Note that order is important:
-// Module 'c' just reexports A, while module 'b' defines a method that uses a
-// virtual method of A.
-#include "Inputs/merge-vtable-codegen/c.h"
-#include "Inputs/merge-vtable-codegen/b.h"
-
-void t() {
- b(nullptr);
-}
More information about the cfe-commits
mailing list