本文整理汇总了C++中llvm::raw_ostream::changeColor方法的典型用法代码示例。如果您正苦于以下问题:C++ raw_ostream::changeColor方法的具体用法?C++ raw_ostream::changeColor怎么用?C++ raw_ostream::changeColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类llvm::raw_ostream
的用法示例。
在下文中一共展示了raw_ostream::changeColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OS
WithColor::WithColor(llvm::raw_ostream &OS, enum HighlightColor Type) : OS(OS) {
// Detect color from terminal type unless the user passed the --color option.
if (UseColor == cl::BOU_UNSET ? OS.has_colors() : UseColor == cl::BOU_TRUE) {
switch (Type) {
case Address: OS.changeColor(llvm::raw_ostream::YELLOW); break;
case String: OS.changeColor(llvm::raw_ostream::GREEN); break;
case Tag: OS.changeColor(llvm::raw_ostream::BLUE); break;
case Attribute: OS.changeColor(llvm::raw_ostream::CYAN); break;
case Enumerator: OS.changeColor(llvm::raw_ostream::MAGENTA); break;
}
}
}
示例2: assert
void Transaction::DelayCallInfo::print(llvm::raw_ostream& Out,
const PrintingPolicy& Policy,
unsigned Indent,
bool PrintInstantiation,
llvm::StringRef prependInfo /*=""*/) const {
static const char* const stateNames[Transaction::kCCINumStates] = {
"kCCINone",
"kCCIHandleTopLevelDecl",
"kCCIHandleInterestingDecl",
"kCCIHandleTagDeclDefinition",
"kCCIHandleVTable",
"kCCIHandleCXXImplicitFunctionInstantiation",
"kCCIHandleCXXStaticMemberVarInstantiation",
};
assert((sizeof(stateNames) /sizeof(void*)) == Transaction::kCCINumStates
&& "Missing states?");
if (!prependInfo.empty()) {
Out.changeColor(llvm::raw_ostream::RED);
Out << prependInfo;
Out.resetColor();
Out << ", ";
}
Out.changeColor(llvm::raw_ostream::BLUE);
Out << stateNames[m_Call];
Out.changeColor(llvm::raw_ostream::GREEN);
Out << " <- ";
Out.resetColor();
for (DeclGroupRef::const_iterator I = m_DGR.begin(), E = m_DGR.end();
I != E; ++I) {
if (*I)
(*I)->print(Out, Policy, Indent, PrintInstantiation);
else
Out << "<<NULL DECL>>";
Out << '\n';
}
}
示例3: Dump
void Table::Dump(llvm::raw_ostream &OS, llvm::StringRef Prefix) const {
for(unsigned I = 0, E = RowsCount(); I < E; ++I) {
if(!Prefix.empty()) {
OS.changeColor(llvm::raw_ostream::GREEN) << Prefix << ": ";
OS.resetColor();
}
for(unsigned J = 0, K = ColsCount(); J < K; ++J) {
llvm::StringRef Cell = Columns[J][I];
OS.indent(Columns[J].GetWidth() - Cell.size()) << Cell;
if(J != K - 1)
OS << " ";
}
OS << "\n";
}
}