diff --git a/llvm/include/llvm/AsmParser/LLParser.h b/llvm/include/llvm/AsmParser/LLParser.h --- a/llvm/include/llvm/AsmParser/LLParser.h +++ b/llvm/include/llvm/AsmParser/LLParser.h @@ -18,70 +18,79 @@ #include "llvm/ADT/StringMap.h" #include "llvm/AsmParser/Parser.h" #include "llvm/IR/Attributes.h" +#include "llvm/IR/GlobalVariable.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/ModuleSummaryIndex.h" #include "llvm/IR/Operator.h" -#include "llvm/IR/Type.h" #include namespace llvm { - class Module; - class Function; - class Value; - class BasicBlock; - class Instruction; - class Constant; - class GlobalValue; - class Comdat; - class MDString; - class MDNode; - struct SlotMapping; +class BasicBlock; +class Comdat; +class Constant; +class Instruction; +class Function; +class FunctionType; +class GlobalValue; +class MDString; +class MDNode; +class Module; +struct SlotMapping; +class Type; +class Value; - /// ValID - Represents a reference of a definition of some sort with no type. - /// There are several cases where we have to parse the value but where the - /// type can depend on later context. This may either be a numeric reference - /// or a symbolic (%var) reference. This is just a discriminated union. - struct ValID { - enum { - t_LocalID, t_GlobalID, // ID in UIntVal. - t_LocalName, t_GlobalName, // Name in StrVal. - t_APSInt, t_APFloat, // Value in APSIntVal/APFloatVal. - t_Null, t_Undef, t_Zero, t_None, t_Poison, // No value. - t_EmptyArray, // No value: [] - t_Constant, // Value in ConstantVal. - t_InlineAsm, // Value in FTy/StrVal/StrVal2/UIntVal. - t_ConstantStruct, // Value in ConstantStructElts. - t_PackedConstantStruct // Value in ConstantStructElts. - } Kind = t_LocalID; +/// ValID - Represents a reference of a definition of some sort with no type. +/// There are several cases where we have to parse the value but where the +/// type can depend on later context. This may either be a numeric reference +/// or a symbolic (%var) reference. This is just a discriminated union. +struct ValID { + enum { + t_LocalID, + t_GlobalID, // ID in UIntVal. + t_LocalName, + t_GlobalName, // Name in StrVal. + t_APSInt, + t_APFloat, // Value in APSIntVal/APFloatVal. + t_Null, + t_Undef, + t_Zero, + t_None, + t_Poison, // No value. + t_EmptyArray, // No value: [] + t_Constant, // Value in ConstantVal. + t_InlineAsm, // Value in FTy/StrVal/StrVal2/UIntVal. + t_ConstantStruct, // Value in ConstantStructElts. + t_PackedConstantStruct // Value in ConstantStructElts. + } Kind = t_LocalID; - LLLexer::LocTy Loc; - unsigned UIntVal; - FunctionType *FTy = nullptr; - std::string StrVal, StrVal2; - APSInt APSIntVal; - APFloat APFloatVal{0.0}; - Constant *ConstantVal; - std::unique_ptr ConstantStructElts; - bool NoCFI = false; + LLLexer::LocTy Loc; + unsigned UIntVal; + FunctionType *FTy = nullptr; + std::string StrVal, StrVal2; + APSInt APSIntVal; + APFloat APFloatVal{0.0}; + Constant *ConstantVal; + std::unique_ptr ConstantStructElts; + bool NoCFI = false; - ValID() = default; - ValID(const ValID &RHS) - : Kind(RHS.Kind), Loc(RHS.Loc), UIntVal(RHS.UIntVal), FTy(RHS.FTy), - StrVal(RHS.StrVal), StrVal2(RHS.StrVal2), APSIntVal(RHS.APSIntVal), - APFloatVal(RHS.APFloatVal), ConstantVal(RHS.ConstantVal), - NoCFI(RHS.NoCFI) { - assert(!RHS.ConstantStructElts); - } + ValID() = default; + ValID(const ValID &RHS) + : Kind(RHS.Kind), Loc(RHS.Loc), UIntVal(RHS.UIntVal), FTy(RHS.FTy), + StrVal(RHS.StrVal), StrVal2(RHS.StrVal2), APSIntVal(RHS.APSIntVal), + APFloatVal(RHS.APFloatVal), ConstantVal(RHS.ConstantVal), + NoCFI(RHS.NoCFI) { + assert(!RHS.ConstantStructElts); + } - bool operator<(const ValID &RHS) const { - if (Kind == t_LocalID || Kind == t_GlobalID) - return UIntVal < RHS.UIntVal; - assert((Kind == t_LocalName || Kind == t_GlobalName || - Kind == t_ConstantStruct || Kind == t_PackedConstantStruct) && - "Ordering not defined for this ValID kind yet"); - return StrVal < RHS.StrVal; - } - }; + bool operator<(const ValID &RHS) const { + if (Kind == t_LocalID || Kind == t_GlobalID) + return UIntVal < RHS.UIntVal; + assert((Kind == t_LocalName || Kind == t_GlobalName || + Kind == t_ConstantStruct || Kind == t_PackedConstantStruct) && + "Ordering not defined for this ValID kind yet"); + return StrVal < RHS.StrVal; + } +}; class LLParser { public: @@ -599,6 +608,6 @@ bool parseUseListOrderIndexes(SmallVectorImpl &Indexes); bool sortUseListOrder(Value *V, ArrayRef Indexes, SMLoc Loc); }; -} // End llvm namespace + } // namespace llvm #endif diff --git a/llvm/include/llvm/BinaryFormat/Dwarf.h b/llvm/include/llvm/BinaryFormat/Dwarf.h --- a/llvm/include/llvm/BinaryFormat/Dwarf.h +++ b/llvm/include/llvm/BinaryFormat/Dwarf.h @@ -19,13 +19,9 @@ #ifndef LLVM_BINARYFORMAT_DWARF_H #define LLVM_BINARYFORMAT_DWARF_H -#include "llvm/Support/Compiler.h" -#include "llvm/Support/DataTypes.h" -#include "llvm/Support/ErrorHandling.h" +#include "llvm/ADT/Triple.h" #include "llvm/Support/Format.h" #include "llvm/Support/FormatVariadicDetails.h" -#include "llvm/ADT/Triple.h" - #include namespace llvm { @@ -34,7 +30,6 @@ namespace dwarf { - //===----------------------------------------------------------------------===// // DWARF constants as gleaned from the DWARF Debugging Information Format V.5 // reference manual http://www.dwarfstd.org/. diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/lib/AsmParser/LLParser.cpp @@ -12,7 +12,6 @@ #include "llvm/AsmParser/LLParser.h" #include "llvm/ADT/APSInt.h" -#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/None.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallPtrSet.h" @@ -39,11 +38,7 @@ #include "llvm/IR/Module.h" #include "llvm/IR/Value.h" #include "llvm/IR/ValueSymbolTable.h" -#include "llvm/Support/Casting.h" -#include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MathExtras.h" #include "llvm/Support/SaveAndRestore.h" -#include "llvm/Support/raw_ostream.h" #include #include #include