search for: printderived

Displaying 7 results from an estimated 7 matches for "printderived".

2012 Sep 29
2
[LLVMdev] Inlining and virtualization in Clang/LLVM
...er* inlining and constant propagation. It seems to me therefore that because of this we are missing optimization opportunities. Suppose the following example program: #include <cstdio> struct Base { virtual void foo() = 0; }; struct NothingDerived: Base { virtual void foo() {} }; struct PrintDerived: Base { virtual void foo() { printf("Hello World!"); } }; Base& select(int i) { static NothingDerived nd; static PrintDerived pd; if (i % 2 == 0) { return nd; } return pd; } int main() { Base& b = select(0); b.foo(); } Which gives the following main fun...
2012 Sep 30
2
[LLVMdev] [cfe-dev] Inlining and virtualization in Clang/LLVM
...er* inlining and constant propagation. It seems to me therefore that because of this we are missing optimization opportunities. Suppose the following example program: #include <cstdio> struct Base { virtual void foo() = 0; }; struct NothingDerived: Base { virtual void foo() {} }; struct PrintDerived: Base { virtual void foo() { printf("Hello World!"); } }; Base& select(int i) { static NothingDerived nd; static PrintDerived pd; if (i % 2 == 0) { return nd; } return pd; } int main() { Base& b = select(0); b.foo(); } Which gives the following main fun...
2012 Oct 03
3
[LLVMdev] [cfe-dev] Inlining and virtualization in Clang/LLVM
...e of this we are missing >> optimization opportunities. Suppose the following example program: >> >> #include <cstdio> >> >> struct Base { virtual void foo() = 0; }; >> >> struct NothingDerived: Base { virtual void foo() {} }; >> >> struct PrintDerived: Base { virtual void foo() { printf("Hello World!"); } }; >> >> Base& select(int i) { >> static NothingDerived nd; >> static PrintDerived pd; >> if (i % 2 == 0) { return nd; } >> return pd; >> } >> >> int main() { &...
2012 Oct 03
0
[LLVMdev] [cfe-dev] Inlining and virtualization in Clang/LLVM
...It seems to me therefore that because of this we are missing > optimization opportunities. Suppose the following example program: > > #include <cstdio> > > struct Base { virtual void foo() = 0; }; > > struct NothingDerived: Base { virtual void foo() {} }; > > struct PrintDerived: Base { virtual void foo() { printf("Hello World!"); } }; > > Base& select(int i) { > static NothingDerived nd; > static PrintDerived pd; > if (i % 2 == 0) { return nd; } > return pd; > } > > int main() { > Base& b = select(0); &gt...
2012 Oct 04
0
[LLVMdev] [cfe-dev] Inlining and virtualization in Clang/LLVM
...zation opportunities. Suppose the following example program: > >> > >> #include <cstdio> > >> > >> struct Base { virtual void foo() = 0; }; > >> > >> struct NothingDerived: Base { virtual void foo() {} }; > >> > >> struct PrintDerived: Base { virtual void foo() { printf("Hello > World!"); } }; > >> > >> Base& select(int i) { > >> static NothingDerived nd; > >> static PrintDerived pd; > >> if (i % 2 == 0) { return nd; } > >> return pd; > &gt...
2012 Oct 04
2
[LLVMdev] [cfe-dev] Inlining and virtualization in Clang/LLVM
...e following example program: >> >> >> >> #include <cstdio> >> >> >> >> struct Base { virtual void foo() = 0; }; >> >> >> >> struct NothingDerived: Base { virtual void foo() {} }; >> >> >> >> struct PrintDerived: Base { virtual void foo() { printf("Hello >> >> World!"); } }; >> >> >> >> Base& select(int i) { >> >> static NothingDerived nd; >> >> static PrintDerived pd; >> >> if (i % 2 == 0) { return nd; } >...
2012 Oct 04
0
[LLVMdev] [cfe-dev] Inlining and virtualization in Clang/LLVM
...;>> >> >>> >> #include <cstdio> >>> >> >>> >> struct Base { virtual void foo() = 0; }; >>> >> >>> >> struct NothingDerived: Base { virtual void foo() {} }; >>> >> >>> >> struct PrintDerived: Base { virtual void foo() { printf("Hello >>> >> World!"); } }; >>> >> >>> >> Base& select(int i) { >>> >> static NothingDerived nd; >>> >> static PrintDerived pd; >>> >> if (i % 2 =...