Skip to content

Commit d7cff1b

Browse files
author
Alex B
committed
Address [Some] Feedback Nr 3 - Rest pending YAML format
1 parent 087cdea commit d7cff1b

File tree

3 files changed

+11
-20
lines changed

3 files changed

+11
-20
lines changed

llvm/include/llvm/DebugInfo/GSYM/CallSiteInfo.h

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,17 @@
99
#ifndef LLVM_DEBUGINFO_GSYM_CALLSITEINFO_H
1010
#define LLVM_DEBUGINFO_GSYM_CALLSITEINFO_H
1111

12-
#include "llvm/ADT/DenseMap.h"
12+
#include "llvm/ADT/BitmaskEnum.h"
1313
#include "llvm/ADT/StringRef.h"
1414
#include "llvm/ADT/StringSet.h"
15-
#include "llvm/DebugInfo/GSYM/ExtractRanges.h"
16-
#include "llvm/Support/YAMLParser.h"
17-
#include <string>
18-
#include <unordered_map>
15+
#include "llvm/Support/Error.h"
1916
#include <vector>
2017

2118
namespace llvm {
2219
class DataExtractor;
2320
class raw_ostream;
24-
class StringTableBuilder;
25-
class CachedHashStringRef;
2621

2722
namespace yaml {
28-
struct CallSiteYAML;
29-
struct FunctionYAML;
3023
struct FunctionsYAML;
3124
} // namespace yaml
3225

@@ -43,6 +36,8 @@ struct CallSiteInfo {
4336
// This flag specifies that the call site can only call a function outside
4437
// the link unit that the call site is in.
4538
ExternalCall = 1 << 1,
39+
40+
LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue*/ ExternalCall),
4641
};
4742

4843
/// The return address of the call site.
@@ -90,11 +85,7 @@ class CallSiteInfoLoader {
9085
/// Constructor that initializes the CallSiteInfoLoader with necessary data
9186
/// structures.
9287
///
93-
/// \param StringOffsetMap A reference to a DenseMap that maps existing string
94-
/// offsets to CachedHashStringRef.
95-
/// \param StrTab A reference to a StringTableBuilder used for managing
96-
/// looking up and creating new strings. \param StringStorage A reference to a
97-
/// StringSet for storing the data for generated strings.
88+
/// \param GCreator A reference to the GsymCreator.
9889
CallSiteInfoLoader(GsymCreator &GCreator) : GCreator(GCreator) {}
9990

10091
/// This method reads the specified YAML file, parses its content, and updates

llvm/lib/DebugInfo/GSYM/CallSiteInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ Error CallSiteInfoLoader::loadYAML(std::vector<FunctionInfo> &Funcs,
159159
std::unique_ptr<MemoryBuffer> Buffer = std::move(*BufferOrError);
160160

161161
// Step 2: Parse YAML content
162-
yaml::FunctionsYAML functionsYAML;
162+
yaml::FunctionsYAML FuncsYAML;
163163
yaml::Input yin(Buffer->getMemBufferRef());
164-
yin >> functionsYAML;
164+
yin >> FuncsYAML;
165165
if (yin.error())
166166
return createStringError(yin.error(), "Error parsing YAML file: %s\n",
167167
Buffer->getBufferIdentifier().str().c_str());
@@ -170,7 +170,7 @@ Error CallSiteInfoLoader::loadYAML(std::vector<FunctionInfo> &Funcs,
170170
auto FuncMap = buildFunctionMap(Funcs);
171171

172172
// Step 4: Process parsed YAML functions and update FuncMap
173-
return processYAMLFunctions(functionsYAML, FuncMap);
173+
return processYAMLFunctions(FuncsYAML, FuncMap);
174174
}
175175

176176
StringMap<FunctionInfo *>

llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ llvm::Expected<uint64_t> FunctionInfo::encode(FileWriter &Out,
218218
// writing the CallSites out with the number of bytes that were written.
219219
Out.writeU32(0);
220220
const auto StartOffset = Out.tell();
221-
llvm::Error err = CallSites->encode(Out);
222-
if (err)
223-
return std::move(err);
221+
Error Err = CallSites->encode(Out);
222+
if (Err)
223+
return std::move(Err);
224224
const auto Length = Out.tell() - StartOffset;
225225
if (Length > UINT32_MAX)
226226
return createStringError(std::errc::invalid_argument,

0 commit comments

Comments
 (0)