Skip to content

Commit 1b558c2

Browse files
committed
incorporate comments
1 parent efbae3f commit 1b558c2

3 files changed

Lines changed: 11 additions & 31 deletions

File tree

include/phasar/PhasarLLVM/ControlFlow/Resolver/Resolver.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#ifndef PHASAR_PHASARLLVM_CONTROLFLOW_RESOLVER_RESOLVER_H_
1818
#define PHASAR_PHASARLLVM_CONTROLFLOW_RESOLVER_RESOLVER_H_
1919

20+
#include <optional>
2021
#include <set>
2122
#include <string>
2223

@@ -29,10 +30,6 @@ class Function;
2930
class StructType;
3031
} // namespace llvm
3132

32-
namespace std {
33-
template <class T> class optional;
34-
}
35-
3633
namespace psr {
3734
class ProjectIRDB;
3835
class LLVMTypeHierarchy;

include/phasar/PhasarLLVM/TypeHierarchy/LLVMTypeHierarchy.h

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,16 @@ class LLVMTypeHierarchy
8888
using out_edge_iterator = boost::graph_traits<bidigraph_t>::out_edge_iterator;
8989
using in_edge_iterator = boost::graph_traits<bidigraph_t>::in_edge_iterator;
9090

91-
static const std::string StructPrefix;
92-
93-
static const std::string ClassPrefix;
94-
95-
static const std::string VTablePrefix;
96-
97-
static const std::string VTablePrefixDemang;
98-
99-
static const std::string TypeInfoPrefix;
100-
101-
static const std::string TypeInfoPrefixDemang;
102-
103-
static const std::string PureVirtualCallName;
91+
static inline constexpr llvm::StringLiteral StructPrefix = "struct.";
92+
static inline constexpr llvm::StringLiteral ClassPrefix = "class.";
93+
static inline constexpr llvm::StringLiteral VTablePrefix = "_ZTV";
94+
static inline constexpr llvm::StringLiteral VTablePrefixDemang =
95+
"vtable for ";
96+
static inline constexpr llvm::StringLiteral TypeInfoPrefix = "_ZTI";
97+
static inline constexpr llvm::StringLiteral TypeInfoPrefixDemang =
98+
"typeinfo for ";
99+
static inline constexpr llvm::StringLiteral PureVirtualCallName =
100+
"__cxa_pure_virtual";
104101

105102
private:
106103
bidigraph_t TypeGraph;

lib/PhasarLLVM/TypeHierarchy/LLVMTypeHierarchy.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,6 @@ using namespace std;
4949

5050
namespace psr {
5151

52-
const std::string LLVMTypeHierarchy::StructPrefix = "struct.";
53-
54-
const std::string LLVMTypeHierarchy::ClassPrefix = "class.";
55-
56-
const std::string LLVMTypeHierarchy::VTablePrefix = "_ZTV";
57-
58-
const std::string LLVMTypeHierarchy::VTablePrefixDemang = "vtable for ";
59-
60-
const std::string LLVMTypeHierarchy::TypeInfoPrefix = "_ZTI";
61-
62-
const std::string LLVMTypeHierarchy::TypeInfoPrefixDemang = "typeinfo for ";
63-
64-
const std::string LLVMTypeHierarchy::PureVirtualCallName = "__cxa_pure_virtual";
65-
6652
LLVMTypeHierarchy::VertexProperties::VertexProperties(
6753
const llvm::StructType *Type)
6854
: Type(Type), ReachableTypes({Type}) {}

0 commit comments

Comments
 (0)