diff options
Diffstat (limited to 'include/llvm/Bitcode')
-rw-r--r-- | include/llvm/Bitcode/BitcodeWriter.h | 10 | ||||
-rw-r--r-- | include/llvm/Bitcode/BitcodeWriterPass.h | 12 | ||||
-rw-r--r-- | include/llvm/Bitcode/BitstreamReader.h | 2 | ||||
-rw-r--r-- | include/llvm/Bitcode/BitstreamWriter.h | 4 | ||||
-rw-r--r-- | include/llvm/Bitcode/LLVMBitCodes.h | 32 |
5 files changed, 47 insertions, 13 deletions
diff --git a/include/llvm/Bitcode/BitcodeWriter.h b/include/llvm/Bitcode/BitcodeWriter.h index c78077525c8b..0010cf6c0544 100644 --- a/include/llvm/Bitcode/BitcodeWriter.h +++ b/include/llvm/Bitcode/BitcodeWriter.h @@ -86,7 +86,7 @@ class raw_ostream; /// Can be used to produce the same module hash for a minimized bitcode /// used just for the thin link as in the regular full bitcode that will /// be used in the backend. - void writeModule(const Module *M, bool ShouldPreserveUseListOrder = false, + void writeModule(const Module &M, bool ShouldPreserveUseListOrder = false, const ModuleSummaryIndex *Index = nullptr, bool GenerateHash = false, ModuleHash *ModHash = nullptr); @@ -97,7 +97,7 @@ class raw_ostream; /// /// ModHash is for use in ThinLTO incremental build, generated while the /// IR bitcode file writing. - void writeThinLinkBitcode(const Module *M, const ModuleSummaryIndex &Index, + void writeThinLinkBitcode(const Module &M, const ModuleSummaryIndex &Index, const ModuleHash &ModHash); void writeIndex( @@ -105,7 +105,7 @@ class raw_ostream; const std::map<std::string, GVSummaryMapTy> *ModuleToSummariesForIndex); }; - /// \brief Write the specified module to the specified raw output stream. + /// Write the specified module to the specified raw output stream. /// /// For streams where it matters, the given stream should be in "binary" /// mode. @@ -126,7 +126,7 @@ class raw_ostream; /// Can be used to produce the same module hash for a minimized bitcode /// used just for the thin link as in the regular full bitcode that will /// be used in the backend. - void WriteBitcodeToFile(const Module *M, raw_ostream &Out, + void WriteBitcodeToFile(const Module &M, raw_ostream &Out, bool ShouldPreserveUseListOrder = false, const ModuleSummaryIndex *Index = nullptr, bool GenerateHash = false, @@ -139,7 +139,7 @@ class raw_ostream; /// /// ModHash is for use in ThinLTO incremental build, generated while the IR /// bitcode file writing. - void WriteThinLinkBitcodeToFile(const Module *M, raw_ostream &Out, + void WriteThinLinkBitcodeToFile(const Module &M, raw_ostream &Out, const ModuleSummaryIndex &Index, const ModuleHash &ModHash); diff --git a/include/llvm/Bitcode/BitcodeWriterPass.h b/include/llvm/Bitcode/BitcodeWriterPass.h index 9ac6fba16b96..05044c9ae11c 100644 --- a/include/llvm/Bitcode/BitcodeWriterPass.h +++ b/include/llvm/Bitcode/BitcodeWriterPass.h @@ -21,9 +21,10 @@ namespace llvm { class Module; class ModulePass; +class Pass; class raw_ostream; -/// \brief Create and return a pass that writes the module to the specified +/// Create and return a pass that writes the module to the specified /// ostream. Note that this pass is designed for use with the legacy pass /// manager. /// @@ -40,7 +41,10 @@ ModulePass *createBitcodeWriterPass(raw_ostream &Str, bool EmitSummaryIndex = false, bool EmitModuleHash = false); -/// \brief Pass for writing a module of IR out to a bitcode file. +/// Check whether a pass is a BitcodeWriterPass. +bool isBitcodeWriterPass(Pass *P); + +/// Pass for writing a module of IR out to a bitcode file. /// /// Note that this is intended for use with the new pass manager. To construct /// a pass for the legacy pass manager, use the function above. @@ -51,7 +55,7 @@ class BitcodeWriterPass : public PassInfoMixin<BitcodeWriterPass> { bool EmitModuleHash; public: - /// \brief Construct a bitcode writer pass around a particular output stream. + /// Construct a bitcode writer pass around a particular output stream. /// /// If \c ShouldPreserveUseListOrder, encode use-list order so it can be /// reproduced when deserialized. @@ -65,7 +69,7 @@ public: : OS(OS), ShouldPreserveUseListOrder(ShouldPreserveUseListOrder), EmitSummaryIndex(EmitSummaryIndex), EmitModuleHash(EmitModuleHash) {} - /// \brief Run the bitcode writer pass, and output the module to the selected + /// Run the bitcode writer pass, and output the module to the selected /// output stream. PreservedAnalyses run(Module &M, ModuleAnalysisManager &); }; diff --git a/include/llvm/Bitcode/BitstreamReader.h b/include/llvm/Bitcode/BitstreamReader.h index b484fa2efbfb..72e7619d9e1c 100644 --- a/include/llvm/Bitcode/BitstreamReader.h +++ b/include/llvm/Bitcode/BitstreamReader.h @@ -429,7 +429,7 @@ public: // don't care what code widths are used inside of it. ReadVBR(bitc::CodeLenWidth); SkipToFourByteBoundary(); - unsigned NumFourBytes = Read(bitc::BlockSizeWidth); + size_t NumFourBytes = Read(bitc::BlockSizeWidth); // Check that the block wasn't partially defined, and that the offset isn't // bogus. diff --git a/include/llvm/Bitcode/BitstreamWriter.h b/include/llvm/Bitcode/BitstreamWriter.h index e276db5f92f6..c854769e0622 100644 --- a/include/llvm/Bitcode/BitstreamWriter.h +++ b/include/llvm/Bitcode/BitstreamWriter.h @@ -90,10 +90,10 @@ public: assert(BlockScope.empty() && CurAbbrevs.empty() && "Block imbalance"); } - /// \brief Retrieve the current position in the stream, in bits. + /// Retrieve the current position in the stream, in bits. uint64_t GetCurrentBitNo() const { return GetBufferOffset() * 8 + CurBit; } - /// \brief Retrieve the number of bits currently used to encode an abbrev ID. + /// Retrieve the number of bits currently used to encode an abbrev ID. unsigned GetAbbrevIDWidth() const { return CurCodeSize; } //===--------------------------------------------------------------------===// diff --git a/include/llvm/Bitcode/LLVMBitCodes.h b/include/llvm/Bitcode/LLVMBitCodes.h index 70194c043479..6723cf42dd2c 100644 --- a/include/llvm/Bitcode/LLVMBitCodes.h +++ b/include/llvm/Bitcode/LLVMBitCodes.h @@ -256,6 +256,18 @@ enum GlobalValueSummarySymtabCodes { // strings in strtab. // [n * name] FS_CFI_FUNCTION_DECLS = 18, + // Per-module summary that also adds relative block frequency to callee info. + // PERMODULE_RELBF: [valueid, flags, instcount, numrefs, + // numrefs x valueid, + // n x (valueid, relblockfreq)] + FS_PERMODULE_RELBF = 19, + // Index-wide flags + FS_FLAGS = 20, + // Maps type identifier to summary information for that type identifier. + // TYPE_ID: [typeid, kind, bitwidth, align, size, bitmask, inlinebits, + // n x (typeid, kind, name, numrba, + // numrba x (numarg, numarg x arg, kind, info, byte, bit))] + FS_TYPE_ID = 21, }; enum MetadataCodes { @@ -272,7 +284,7 @@ enum MetadataCodes { METADATA_ATTACHMENT = 11, // [m x [value, [n x [id, mdnode]]] METADATA_GENERIC_DEBUG = 12, // [distinct, tag, vers, header, n x md num] METADATA_SUBRANGE = 13, // [distinct, count, lo] - METADATA_ENUMERATOR = 14, // [distinct, value, name] + METADATA_ENUMERATOR = 14, // [isUnsigned|distinct, value, name] METADATA_BASIC_TYPE = 15, // [distinct, tag, name, size, align, enc] METADATA_FILE = 16, // [distinct, filename, directory, checksumkind, checksum] METADATA_DERIVED_TYPE = 17, // [distinct, ...] @@ -298,6 +310,7 @@ enum MetadataCodes { METADATA_GLOBAL_VAR_EXPR = 37, // [distinct, var, expr] METADATA_INDEX_OFFSET = 38, // [offset] METADATA_INDEX = 39, // [bitpos] + METADATA_LABEL = 40, // [distinct, scope, name, file, line] }; // The constants block (CONSTANTS_BLOCK_ID) describes emission for each @@ -395,6 +408,20 @@ enum OverflowingBinaryOperatorOptionalFlags { OBO_NO_SIGNED_WRAP = 1 }; +/// FastMath Flags +/// This is a fixed layout derived from the bitcode emitted by LLVM 5.0 +/// intended to decouple the in-memory representation from the serialization. +enum FastMathMap { + UnsafeAlgebra = (1 << 0), // Legacy + NoNaNs = (1 << 1), + NoInfs = (1 << 2), + NoSignedZeros = (1 << 3), + AllowReciprocal = (1 << 4), + AllowContract = (1 << 5), + ApproxFunc = (1 << 6), + AllowReassoc = (1 << 7) +}; + /// PossiblyExactOperatorOptionalFlags - Flags for serializing /// PossiblyExactOperator's SubclassOptionalData contents. enum PossiblyExactOperatorOptionalFlags { PEO_EXACT = 0 }; @@ -561,6 +588,9 @@ enum AttributeKindCodes { ATTR_KIND_SPECULATABLE = 53, ATTR_KIND_STRICT_FP = 54, ATTR_KIND_SANITIZE_HWADDRESS = 55, + ATTR_KIND_NOCF_CHECK = 56, + ATTR_KIND_OPT_FOR_FUZZING = 57, + ATTR_KIND_SHADOWCALLSTACK = 58, }; enum ComdatSelectionKindCodes { |