Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ORNL Quantum Computing Institute
qcor
Commits
01b75235
Commit
01b75235
authored
Jul 09, 2019
by
Mccaskey, Alex
Browse files
removing old qcor plugin action
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
448b4b53
Changes
3
Hide whitespace changes
Inline
Side-by-side
compiler/clang/QCORPluginAction.cpp
deleted
100644 → 0
View file @
448b4b53
#include
"QCORPluginAction.hpp"
#include
"QCORASTConsumer.hpp"
#include
"XACC.hpp"
namespace
qcor
{
namespace
compiler
{
std
::
unique_ptr
<
ASTConsumer
>
QCORPluginAction
::
CreateASTConsumer
(
CompilerInstance
&
ci
,
llvm
::
StringRef
)
{
return
llvm
::
make_unique
<
QCORASTConsumer
>
(
ci
);
}
bool
QCORPluginAction
::
ParseArgs
(
const
CompilerInstance
&
ci
,
const
std
::
vector
<
std
::
string
>
&
args
)
{
if
(
!
xacc
::
isInitialized
())
{
std
::
vector
<
std
::
string
>
local
;
local
.
push_back
(
"--logger-name"
);
local
.
push_back
(
"qcor"
);
xacc
::
Initialize
(
local
);
}
auto
it
=
std
::
find
(
args
.
begin
(),
args
.
end
(),
"accelerator"
);
if
(
it
!=
args
.
end
())
{
int
index
=
std
::
distance
(
args
.
begin
(),
it
);
auto
acc
=
args
[
index
+
1
];
xacc
::
setAccelerator
(
acc
);
}
std
::
vector
<
std
::
string
>
transformations
;
it
=
args
.
begin
();
std
::
for_each
(
args
.
begin
(),
args
.
end
(),
[
&
](
const
std
::
string
&
value
)
{
if
(
value
==
"transform"
)
{
int
index
=
std
::
distance
(
args
.
begin
(),
it
);
auto
transformationName
=
args
[
index
+
1
];
transformations
.
push_back
(
transformationName
);
}
++
it
;
});
if
(
!
transformations
.
empty
())
{
std
::
string
transformNames
=
transformations
[
0
];
for
(
int
i
=
1
;
i
<
transformations
.
size
();
++
i
)
{
transformNames
+=
","
+
transformations
[
i
];
}
xacc
::
setOption
(
"qcor-transforms"
,
transformNames
);
}
return
true
;
}
// PluginASTAction::ActionType QCORPluginAction::getActionType() {
// return PluginASTAction::AddBeforeMainAction;
// }
}
// namespace compiler
}
// namespace qcor
static
FrontendPluginRegistry
::
Add
<
qcor
::
compiler
::
QCORPluginAction
>
X
(
"enable-quantum"
,
"Enable quantum language extension via XACC."
);
\ No newline at end of file
compiler/clang/QCORPluginAction.hpp
deleted
100644 → 0
View file @
448b4b53
#ifndef COMPILER_QCORPLUGINASTACTION_HPP_
#define COMPILER_QCORPLUGINASTACTION_HPP_
#include
"clang/Frontend/CompilerInstance.h"
#include
"clang/Frontend/FrontendAction.h"
#include
"clang/Frontend/FrontendPluginRegistry.h"
#include
"clang/Sema/Sema.h"
using
namespace
clang
;
namespace
qcor
{
namespace
compiler
{
class
QCORPluginAction
:
public
PluginASTAction
{
protected:
std
::
unique_ptr
<
ASTConsumer
>
CreateASTConsumer
(
CompilerInstance
&
CI
,
llvm
::
StringRef
)
override
;
bool
ParseArgs
(
const
CompilerInstance
&
CI
,
const
std
::
vector
<
std
::
string
>
&
args
)
override
;
// PluginASTAction::ActionType getActionType() override;
};
}
// namespace compiler
}
// namespace qcor
#endif
\ No newline at end of file
compiler/clang/tests/LambdaVisitorTester.in.cpp
View file @
01b75235
...
...
@@ -17,7 +17,6 @@
#include
"FuzzyParsingExternalSemaSource.hpp"
#include
"LambdaVisitor.hpp"
#include
"QCORASTConsumer.hpp"
#include
"QCORPluginAction.hpp"
#include
"DigitalGates.hpp"
#include
"CountGatesOfTypeVisitor.hpp"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment