Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F3999586
latecontextcompiler2.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
Thu, Jul 9, 2:36 AM
Size
1 KB
Mime Type
text/x-c++
Expires
Sat, Jul 11, 2:36 AM (1 d, 7 h)
Engine
blob
Format
Raw Data
Handle
273133
Attached To
rXR Xreate
latecontextcompiler2.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/.
*
* LateContextCompiler2.h
*
* Created on: 02/10, 2016
* Author: pgess <v.melnychenko@xreate.org>
*/
//TOTEST compile several context arguments
#ifndef LATECONTEXTCOMPILER2_H_
#define LATECONTEXTCOMPILER2_H_
#include "serialization.h"
namespace llvm {
class Value;
class Function;
}
namespace xreate {
class CompilePass;
namespace compilation {
class IFunctionUnit;
}}
namespace xreate {namespace context{
typedef unsigned int ScopePacked;
/** \brief Encapsulates compilation of Late Context
* \sa xreate::context::ContextQuery, xreate::compilation::BasicCodeScopeUnit
*/
class LateContextCompiler2 {
public:
llvm::Value* rawContextArgument = nullptr;
LateContextCompiler2(compilation::IFunctionUnit* f, CompilePass* p);
/** \brief Finds function with regard to late context*/
llvm::Value* findFunction(const std::string& calleeName, llvm::Function* specializationDefault, ScopePacked scopeCaller);
llvm::Value* compileContextArgument(const std::string& callee, ScopePacked scopeCaller);
size_t getFunctionDemandSize() const;
private:
//boost::bimap<size_t, std::string> __decisions;
//std::vector<Domain> __scheme;
compilation::IFunctionUnit* function;
CompilePass* pass;
size_t __sizeOfDemand;
llvm::Value* compileDependentDecision(const Expression& topic, ScopePacked scopeCaller);
llvm::Value* compileDecisionSelectorAsSwitch(llvm::Value* selector, std::vector<llvm::Function*> vectorVariants, llvm::Function* variantDefault);
};
}} /* namespace xreate::context */
#endif /* LATECONTEXTCOMPILER2_H_ */
Event Timeline
Log In to Comment