Index: llvm/include/llvm/Support/SyntaxHighlighting.h =================================================================== --- llvm/include/llvm/Support/SyntaxHighlighting.h +++ llvm/include/llvm/Support/SyntaxHighlighting.h @@ -7,14 +7,13 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_LIB_DEBUGINFO_SYNTAXHIGHLIGHTING_H -#define LLVM_LIB_DEBUGINFO_SYNTAXHIGHLIGHTING_H +#ifndef LLVM_SUPPORT_SYNTAXHIGHLIGHTING_H +#define LLVM_SUPPORT_SYNTAXHIGHLIGHTING_H namespace llvm { class raw_ostream; -namespace dwarf { namespace syntax { // Symbolic names for various syntax elements. @@ -30,8 +29,8 @@ Note }; -/// An RAII object that temporarily switches an output stream to a -/// specific color. +/// An RAII object that temporarily switches an output stream to a specific +/// color. class WithColor { raw_ostream &OS; /// Determine whether colors should be displayed. @@ -47,8 +46,6 @@ }; } // end namespace syntax -} // end namespace dwarf - } // end namespace llvm #endif // LLVM_LIB_DEBUGINFO_SYNTAXHIGHLIGHTING_H Index: llvm/lib/DebugInfo/DWARF/CMakeLists.txt =================================================================== --- llvm/lib/DebugInfo/DWARF/CMakeLists.txt +++ llvm/lib/DebugInfo/DWARF/CMakeLists.txt @@ -24,7 +24,6 @@ DWARFUnitIndex.cpp DWARFUnit.cpp DWARFVerifier.cpp - SyntaxHighlighting.cpp ADDITIONAL_HEADER_DIRS ${LLVM_MAIN_INCLUDE_DIR}/llvm/DebugInfo/DWARF Index: llvm/lib/DebugInfo/DWARF/DWARFDebugMacro.cpp =================================================================== --- llvm/lib/DebugInfo/DWARF/DWARFDebugMacro.cpp +++ llvm/lib/DebugInfo/DWARF/DWARFDebugMacro.cpp @@ -8,8 +8,8 @@ //===----------------------------------------------------------------------===// #include "llvm/DebugInfo/DWARF/DWARFDebugMacro.h" -#include "SyntaxHighlighting.h" #include "llvm/BinaryFormat/Dwarf.h" +#include "llvm/Support/SyntaxHighlighting.h" #include "llvm/Support/raw_ostream.h" #include Index: llvm/lib/DebugInfo/DWARF/DWARFDie.cpp =================================================================== --- llvm/lib/DebugInfo/DWARF/DWARFDie.cpp +++ llvm/lib/DebugInfo/DWARF/DWARFDie.cpp @@ -8,7 +8,6 @@ //===----------------------------------------------------------------------===// #include "llvm/DebugInfo/DWARF/DWARFDie.h" -#include "SyntaxHighlighting.h" #include "llvm/ADT/None.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/StringRef.h" @@ -23,6 +22,7 @@ #include "llvm/Support/DataExtractor.h" #include "llvm/Support/Format.h" #include "llvm/Support/MathExtras.h" +#include "llvm/Support/SyntaxHighlighting.h" #include "llvm/Support/raw_ostream.h" #include #include Index: llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp =================================================================== --- llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp +++ llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp @@ -8,7 +8,6 @@ //===----------------------------------------------------------------------===// #include "llvm/DebugInfo/DWARF/DWARFFormValue.h" -#include "SyntaxHighlighting.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/None.h" #include "llvm/ADT/Optional.h" @@ -19,6 +18,7 @@ #include "llvm/DebugInfo/DWARF/DWARFUnit.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Format.h" +#include "llvm/Support/SyntaxHighlighting.h" #include "llvm/Support/raw_ostream.h" #include #include Index: llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp =================================================================== --- llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp +++ llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#include "SyntaxHighlighting.h" #include "llvm/DebugInfo/DWARF/DWARFVerifier.h" +#include "llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h" #include "llvm/DebugInfo/DWARF/DWARFCompileUnit.h" #include "llvm/DebugInfo/DWARF/DWARFContext.h" #include "llvm/DebugInfo/DWARF/DWARFDebugLine.h" @@ -16,8 +16,8 @@ #include "llvm/DebugInfo/DWARF/DWARFExpression.h" #include "llvm/DebugInfo/DWARF/DWARFFormValue.h" #include "llvm/DebugInfo/DWARF/DWARFSection.h" -#include "llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h" #include "llvm/Support/FormatVariadic.h" +#include "llvm/Support/SyntaxHighlighting.h" #include "llvm/Support/raw_ostream.h" #include #include Index: llvm/lib/Support/CMakeLists.txt =================================================================== --- llvm/lib/Support/CMakeLists.txt +++ llvm/lib/Support/CMakeLists.txt @@ -109,6 +109,7 @@ StringPool.cpp StringSaver.cpp StringRef.cpp + SyntaxHighlighting.cpp SystemUtils.cpp TarWriter.cpp TargetParser.cpp Index: llvm/lib/Support/SyntaxHighlighting.cpp =================================================================== --- llvm/lib/Support/SyntaxHighlighting.cpp +++ llvm/lib/Support/SyntaxHighlighting.cpp @@ -7,12 +7,11 @@ // //===----------------------------------------------------------------------===// -#include "SyntaxHighlighting.h" +#include "llvm/Support/SyntaxHighlighting.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; -using namespace dwarf; using namespace syntax; static cl::opt @@ -30,15 +29,33 @@ // Detect color from terminal type unless the user passed the --color option. if (colorsEnabled(OS)) { switch (Type) { - case Address: OS.changeColor(raw_ostream::YELLOW); break; - case String: OS.changeColor(raw_ostream::GREEN); break; - case Tag: OS.changeColor(raw_ostream::BLUE); break; - case Attribute: OS.changeColor(raw_ostream::CYAN); break; - case Enumerator: OS.changeColor(raw_ostream::MAGENTA); break; - case Macro: OS.changeColor(raw_ostream::RED); break; - case Error: OS.changeColor(raw_ostream::RED, true); break; - case Warning: OS.changeColor(raw_ostream::MAGENTA, true); break; - case Note: OS.changeColor(raw_ostream::BLACK, true); break; + case Address: + OS.changeColor(raw_ostream::YELLOW); + break; + case String: + OS.changeColor(raw_ostream::GREEN); + break; + case Tag: + OS.changeColor(raw_ostream::BLUE); + break; + case Attribute: + OS.changeColor(raw_ostream::CYAN); + break; + case Enumerator: + OS.changeColor(raw_ostream::MAGENTA); + break; + case Macro: + OS.changeColor(raw_ostream::RED); + break; + case Error: + OS.changeColor(raw_ostream::RED, true); + break; + case Warning: + OS.changeColor(raw_ostream::MAGENTA, true); + break; + case Note: + OS.changeColor(raw_ostream::BLACK, true); + break; } } }