search for: instantiation

Displaying 20 results from an estimated 1774 matches for "instantiation".

2009 Dec 04
4
[LLVMdev] r72619
...s only one function in >> it. Both the one you sent and duncan.ll have more than one >> function. It's not the fact that more than one function is showing >> up, but these functions in particular shouldn't be there because of >> the implicit/explicit template instantiation stuff. > > there are several functions in the example you sent, some linkonce > and some > available_externally. Which ones shouldn't be there and why? Can > you please > give more details about why it is a problem - it was kind of hand- > wavy so > far :) > On...
2009 Dec 04
0
[LLVMdev] r72619
...c_string class template as a non-inline definition: > > template<typename _CharT, typename _Traits, typename _Alloc> > basic_string<_CharT, _Traits, _Alloc>:: > basic_string(const _CharT* __s, const _Alloc& __a) > > Second, there is an explicit template instantiation declaration: > > extern template class basic_string<char>; > > That extern template instantiation declaration is supposed to suppress > the implicit instantiation of non-inline member functions like that > basic_string constructor. I had tripped over something simi...
2012 Sep 28
4
[LLVMdev] Clang bug?
...edef typename A<C*>::type type; }; B<int> b; ... produces ... <stdin>:3:38: error: no type named 'type' in 'A<B<int>::C *>' struct C { typedef typename A<C*>::type type; }; ~~~~~~~~~~~~~~~~^~~~ <stdin>:1:54: note: in instantiation of member class 'B<int>::C' requested here template<typename T> struct A { typedef decltype(T() + 0) type; }; ^ <stdin>:4:20: note: in instantiation of template class 'A<B<int>::C *>' requested here...
2012 May 04
1
[LLVMdev] Any way how to instantiate templates even when it is not necessary for the compilation?
...er need to know the full structure because I need to generate the glue layer for the enumerator.   It seems to me that this would be quite a common problem for similar tools and someone might have stumbled upon it already, and because of this I'd like to ask: is there any clean way how to force instantiation of templates that do not strictly have to be instantiated? Because if it isn't, this means that I will either have to somehow analyze the headers and generate code which forces the instantiation (which is not really trivial) or try to hack the code somehow to force the instantiation (probably p...
2009 Dec 04
0
[LLVMdev] r72619
...tice that orig.ll has only one function in it. Both the > one you sent and duncan.ll have more than one function. It's not the > fact that more than one function is showing up, but these functions in > particular shouldn't be there because of the implicit/explicit template > instantiation stuff. there are several functions in the example you sent, some linkonce and some available_externally. Which ones shouldn't be there and why? Can you please give more details about why it is a problem - it was kind of hand-wavy so far :) Thanks, Duncan.
2009 Dec 04
2
[LLVMdev] r72619
...> } >> The c'tor for std::string is emitted as code from llvm-gcc. It is >> then inlined. And a weak external for the `_S_construct' variable >> is created. However, C++ rules stipulate that it shouldn't be, >> because of explicit & implicit template instantiation rules that >> Doug knows about but which makes my head spin. > > I can't reproduce this on x86-64 linux (but maybe I misunderstood > what the > problem is?). I've attached the bitcode I get at -O4. > >> I'm going to need to revert at least some of these c...
2018 Jul 10
2
Is it really valid to discard externally instantiated functions from a TU when marked inline?
...o include the definition of `__init` in the executable and to use the one available externally. Unfortunately, `__init` has hidden visibility, and so the definition in the .so is not visible to the executable, and the link fails. Where I think Clang/LLVM goes wrong is when it decides to remove the instantiation in the executable in favor of the one that is hypothetically provided externally. Indeed, the Standard says in [temp.explicit]/12 (http://eel.is/c++draft/temp.explicit#12): Except for inline functions and variables, declarations with types deduced from their initializer or return value ([dcl.s...
2012 Sep 29
0
[LLVMdev] Clang bug?
...}; > B<int> b; > > ... produces ... > > <stdin>:3:38: error: no type named 'type' in 'A<B<int>::C *>' > struct C { typedef typename A<C*>::type type; }; > ~~~~~~~~~~~~~~~~^~~~ > <stdin>:1:54: note: in instantiation of member class 'B<int>::C' requested > here > template<typename T> struct A { typedef decltype(T() + 0) type; }; > ^ > <stdin>:4:20: note: in instantiation of template class 'A<B<int>::C *>...
2009 Dec 04
2
[LLVMdev] r72619
...on-inline >> definition: >> >> template<typename _CharT, typename _Traits, typename _Alloc> >> basic_string<_CharT, _Traits, _Alloc>:: >> basic_string(const _CharT* __s, const _Alloc& __a) >> >> Second, there is an explicit template instantiation declaration: >> >> extern template class basic_string<char>; >> >> That extern template instantiation declaration is supposed to >> suppress >> the implicit instantiation of non-inline member functions like that >> basic_string constructor. I had...
2012 Sep 27
4
[LLVMdev] Clang bug?
...Templ8<int>::Member *, std::__1::less<int>, std::__1::allocator<std::__1::pair<const int, Templ8<int>::Member *>>>' typename map<K,Member*>::iterator it; ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ /usr/bin/../lib/c++/v1/type_traits:1184:57: note: in instantiation of member class 'Templ8<int>::Member' requested here decltype((_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>(), true_type())) ^ /usr/bin/../lib/c++/v1/type_traits:1186:1: note: while substituting deduced template argum...
2009 Jan 16
1
[LLVMdev] Problem using ilist container
Hi All, I have just started using LLVM . i am facing a issue while using ilist container. Here is a struct with ilist container as its one element. typedef ilist<Instruction *> InstListType; struct list_node { int Impact; InstListType InstList; }; list_node
2012 May 08
0
[LLVMdev] Any way how to instantiate templates even when it is not necessary for the compilation?
My gut tells me that if it isn't already available, then it will be difficult as the instantiation has to occur for the final compilation, but that must be occurring in a later phase of compilation than the one where the XML file is generated. Their is also a good chance that the instantiation depends on information that isn't available until after the XML file is generated (things like over...
2014 Aug 12
4
[LLVMdev] Explicit template instantiations in libc++
Most of libc++ doesn't have explicit template instantiations, which leads to a pretty significant build time and code size cost when using libc++, since a large number of common templates will be emitted by the compiler and coalesced by the linker. Notably, in include/__config, we have: #ifndef _LIBCPP_EXTERN_TEMPLATE #define _LIBCPP_EXTERN_TEMPLAT...
2009 Oct 01
2
Any way to avoid instantiating a class twice?
Hey everyone, I''m trying to find a work around for a performance problem I''ve been having. I have a class that builds paths (among other things) dynamically to many files and folders depending on what sets of information the user accesses. Once built, this class instantiation contains all the information necessary for several pages (controllers/views) to operate. However at times it can take up to 10 seconds to process. It could be incredibly time consuming to re-instantiate the class every time I load any related sub-views/controllers. The information contained in th...
2011 Nov 30
0
[LLVMdev] -Wunreachable-code and templates
...rn !b ? func1() : func2(); } int main() { return func<true>() + func<false>(); } $ clang++ -Wunreachable-code unreachable.cpp unreachable.cpp:5:15: warning: will never be executed [-Wunreachable-code] return !b ? func1() : func2(); ^~~~~ unreachable.cpp:9:10: note: in instantiation of function template specialization 'func<true>' requested here return func<true>() + func<false>(); ^ unreachable.cpp:5:25: warning: will never be executed [-Wunreachable-code] return !b ? func1() : func2(); ^~~~~ unreachable.cpp:9:25:...
2012 May 07
0
[LLVMdev] Any way how to instantiate templates even when it is not necessary for the compilation?
Is the original definition of the template available in the XML file, not just the reference to the specific instantiations (i.e. IMyEnumerator<int>). On Mon, May 7, 2012 at 12:08 PM, Ondrej Kolacek <natris1 at gmail.com> wrote: > (another try from different mail account; I hope I was able to clarify > my issue better. ) > > Hello, > I am working on a tool which takes c++ header files of a...
2012 Sep 28
0
[LLVMdev] Clang bug?
...er *, std::__1::less<int>, > std::__1::allocator<std::__1::pair<const int, Templ8<int>::Member > *>>>' > typename map<K,Member*>::iterator it; > ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ > /usr/bin/../lib/c++/v1/type_traits:1184:57: note: in instantiation of > member class 'Templ8<int>::Member' requested here > decltype((_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>(), true_type())) > ^ > /usr/bin/../lib/c++/v1/type_traits:1186:1: note: while substituting &gt...
2012 Sep 29
1
[LLVMdev] Clang bug?
...+ accepted this code.] There's two separate problems here. One is that given: typedef typename map<K,Member*>::iterator iterator_type; libc++'s std::map implementation was using a construct whose semantics depended on whether 'Member' is a complete type (thus triggering the instantiation of that type in the middle of instantiating map<K,Member*>, creating a dependency cycle between the two instantiations). I'm not at all clear on whether that is permissible behavior for a standard library implementation, but it still seems to be a problem in some cases. libc++'s is_as...
2012 Sep 29
2
[LLVMdev] Clang bug?
...gt; > ... produces ... > > > > <stdin>:3:38: error: no type named 'type' in 'A<B<int>::C *>' > > struct C { typedef typename A<C*>::type type; }; > > ~~~~~~~~~~~~~~~~^~~~ > > <stdin>:1:54: note: in instantiation of member class 'B<int>::C' > requested here > > template<typename T> struct A { typedef decltype(T() + 0) type; }; > > ^ > > <stdin>:4:20: note: in instantiation of template class 'A<B<int...
2006 Jan 25
0
Changing the instantiated table when using STI
Is there any way to get AR to instantiate a different class when using STI? Where it would normally instantiate Digit, I would like it to instantiate SkelDigit. Here''s why... My rails app has the following STI hierarchy: Digit < Glyph < ActiveRecord::Base My migrate script can''t use those classes directly however (backward compatibility issues), so I created some