Skip to content

Commit

Permalink
[nomp] Print canonical types to expand typedefs
Browse files Browse the repository at this point in the history
  • Loading branch information
thilinarmtb committed Sep 20, 2023
1 parent ade6a17 commit a2997e3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions clang/lib/Parse/ParseNomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ static void GetExtVarsAndKnl(std::set<VarDecl *> &EV, std::string &KnlStr,

clang::PrintingPolicy Policy(Opts);
Policy.SuppressInitializers = true;
Policy.PrintCanonicalTypes = true;

llvm::raw_string_ostream KnlStream(KnlStr);
KnlStream << "void " << KnlName << "(";
Expand All @@ -592,12 +593,8 @@ static void GetExtVarsAndKnl(std::set<VarDecl *> &EV, std::string &KnlStr,
}
KnlStream << " {\n";

SourceLocation BL = FS->getBeginLoc(), EL = FS->getEndLoc();
llvm::StringRef bfr = SM.getBufferData(SM.getFileID(BL));
unsigned s = SM.getFileOffset(BL), e = SM.getFileOffset(EL), n = e;
for (; n < bfr.size() && bfr[n] != ';' && bfr[n] != '}'; n++)
;
KnlStream << std::string(bfr.data() + s, n - s + 2) << "}";
FS->printPretty(KnlStream, nullptr, Policy, 0);
KnlStream << "}";
}

static void CreateNompJitCall(llvm::SmallVector<Stmt *, 16> &Stmts,
Expand Down

0 comments on commit a2997e3

Please sign in to comment.