Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ORNL Quantum Computing Institute
qcor
Commits
7547a60f
Commit
7547a60f
authored
Jul 08, 2019
by
Mccaskey, Alex
Browse files
minor updates
Signed-off-by:
Alex McCaskey
<
mccaskeyaj@ornl.gov
>
parent
d28c80bb
Pipeline
#62479
failed with stages
in 2 minutes and 54 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
compiler/clang/QCORPragmaHandler.hpp
0 → 100644
View file @
7547a60f
#ifndef COMPILER_CLANG_QCORPRAGMAHANDLER_HPP__
#define COMPILER_CLANG_QCORPRAGMAHANDLER_HPP__
#include "clang/AST/AST.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/Basic/TokenKinds.def"
#include "clang/Lex/LexDiagnostic.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Rewrite/Core/Rewriter.h"
#include <iostream>
#include <sstream>
using
namespace
clang
;
namespace
qcor
{
namespace
compiler
{
class
QCORPragmaHandler
:
public
PragmaHandler
{
protected:
Rewriter
&
rewriter
;
public:
QCORPragmaHandler
(
Rewriter
&
r
)
:
PragmaHandler
(
"qcor"
),
rewriter
(
r
)
{}
void
HandlePragma
(
Preprocessor
&
PP
,
PragmaIntroducerKind
Introducer
,
Token
&
FirstTok
)
override
{
std
::
cout
<<
"QCOR HANDLING PRAGMA:
\n
"
;
Token
Tok
;
// first slurp the directive content in a string.
std
::
stringstream
ss
;
SmallVector
<
Token
,
16
>
Pragmas
;
int
found
=
-
1
;
auto
sl
=
FirstTok
.
getLocation
();
sl
.
dump
(
PP
.
getSourceManager
());
std
::
string
declaration
;
// FirstTok.getAnnotationRange().dump(PP.getSourceManager());
while
(
true
)
{
PP
.
Lex
(
Tok
);
if
(
Tok
.
is
(
tok
::
r_brace
)
&&
found
==
0
)
{
auto
end
=
Tok
.
getLocation
();
sl
.
dump
(
PP
.
getSourceManager
());
end
.
dump
(
PP
.
getSourceManager
());
rewriter
.
ReplaceText
(
SourceRange
(
sl
,
end
),
"{}
\n
"
);
PP
.
EnterToken
(
Tok
);
break
;
}
if
(
Tok
.
is
(
tok
::
l_brace
))
{
if
(
found
==
-
1
)
{
declaration
=
ss
.
str
();
ss
=
std
::
stringstream
();
}
found
++
;
}
if
(
Tok
.
is
(
tok
::
r_brace
))
{
found
--
;
}
// if(Tok.isNot(tok::eod))
ss
<<
PP
.
getSpelling
(
Tok
);
}
std
::
cout
<<
"declaration: "
<<
declaration
<<
"
\n
"
;
std
::
cout
<<
"body: "
<<
ss
.
str
()
<<
"
\n
"
;
// Tok.startToken();
// // Tok.setKind(tok::annotannot_pragma_unused);//annot_pragma_my_annotate);
// Tok.setLocation(FirstTok.getLocation());
// Tok.setAnnotationEndLoc(FirstTok.getLocation());
// // there should be something better that this strdup :-/
// Tok.setAnnotationValue(strdup(ss.str().c_str()));
// PP.EnterToken(Tok);
// SourceLocation PragmaLocation = Tok.getLocation();
// PragmaLocation.dump(PP.getSourceManager());
// Tok.getEndLoc().dump(PP.getSourceManager());
// std::cout << "LOCATION: " << PragmaLocation.
}
};
}
// namespace compiler
}
// namespace qcor
#endif
\ No newline at end of file
docker/dev/Dockerfile
View file @
7547a60f
FROM
theiaide/theia-full:
nex
t
FROM
theiaide/theia-full:
lates
t
USER
root
RUN
apt-get
-y
update
\
&&
apt-get
-y
update
&&
apt-get
install
-y
libcurl4-openssl-dev libssl-dev
\
RUN
apt-get
-y
update
&&
apt-get
install
-y
libcurl4-openssl-dev libssl-dev
\
python3 libpython3-dev python3-pip gdb gfortran libblas-dev
\
liblapack-dev pkg-config software-properties-common
RUN
apt-get update
\
liblapack-dev pkg-config software-properties-common
\
&&
python3
-m
pip
install
cmake
RUN
apt-get
-y
update
\
&& wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
&& add-apt-repository "deb http://apt.llvm.org/
jessie
/ llvm-toolchain-
jessie
main" \
&& add-apt-repository "deb http://apt.llvm.org/
bionic
/ llvm-toolchain-
bionic
main" \
&& apt-get -y update && apt-get -y install libclang-9-dev llvm-9-dev clang-9 \
&& ln -s /usr/bin/llvm-config-9 /usr/bin/llvm-config
&& python3 -m pip install cmake
&& ln -s /usr/bin/llvm-config-9 /usr/bin/llvm-config
ADD
settings.json /home/.theia/
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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