Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F2731026
adhocfunctiondecorator.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Mar 14, 2:58 AM
Size
1 KB
Mime Type
text/x-c++
Expires
Mon, Mar 16, 2:58 AM (1 d, 15 h)
Engine
blob
Format
Raw Data
Handle
243788
Attached To
rXR Xreate
adhocfunctiondecorator.h
View Options
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* File: adhocfunctiondecorator.h
* Author: pgess <v.melnychenko@xreate.org>
*
* Created on July 29, 2017, 12:26 PM
*/
#ifndef ADHOCFUNCTIONDECORATOR_H
#define ADHOCFUNCTIONDECORATOR_H
#include "ast.h"
#include "llvmlayer.h"
using namespace xreate::compilation;
namespace xreate{ namespace adhoc{
template<class Parent>
class AdhocFunctionDecorator: public Parent{
public:
AdhocFunctionDecorator(ManagedFnPtr f, CompilePass* p)
: Parent(f, p) {}
protected:
llvm::Type* prepareResult(){
PassManager* man = Parent::pass->man;
CodeScope* entry = Parent::function->__entry;
LLVMLayer* llvm = Parent::pass->man->llvm;
AST* ast = Parent::pass->man->root;
adhoc::AdhocPass* adhocpass = reinterpret_cast<AdhocPass*>(man->getPassById(PassId::AdhocPass));
if (! Parent::function->isPrefunction){
return Parent::prepareResult();
}
adhocImplementation = adhocpass->findAssotiatedScheme(entry);
return llvm->toLLVMType(ast->expandType(adhocImplementation->getResultType()));
}
public:
AdhocScheme* adhocImplementation=nullptr;
};
}} //end of namespace xreate::adhoc
#endif /* ADHOCFUNCTIONDECORATOR_H */
Event Timeline
Log In to Comment