]> granicus.if.org Git - llvm/commitdiff
Add vtable anchor to classes.
authorRichard Trieu <rtrieu@google.com>
Sat, 29 Dec 2018 02:02:13 +0000 (02:02 +0000)
committerRichard Trieu <rtrieu@google.com>
Sat, 29 Dec 2018 02:02:13 +0000 (02:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350142 91177308-0d34-0410-b5e6-96231b3b80d8

16 files changed:
include/llvm/CodeGen/GlobalISel/CallLowering.h
include/llvm/CodeGen/SelectionDAG.h
include/llvm/IR/DiagnosticInfo.h
include/llvm/Object/Error.h
include/llvm/Support/Error.h
include/llvm/Support/FormatVariadicDetails.h
include/llvm/Support/VirtualFileSystem.h
include/llvm/Support/raw_ostream.h
lib/CodeGen/GlobalISel/CallLowering.cpp
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/IR/DiagnosticInfo.cpp
lib/Object/Error.cpp
lib/Support/Error.cpp
lib/Support/FormatVariadic.cpp
lib/Support/VirtualFileSystem.cpp
lib/Support/raw_ostream.cpp

index 32980ce149c1c15098c12f35b98d7b499a0155e6..ab498e8f070b097709309db836a55de108cb6380 100644 (file)
@@ -40,6 +40,7 @@ class Value;
 class CallLowering {
   const TargetLowering *TLI;
 
+  virtual void anchor();
 public:
   struct ArgInfo {
     unsigned Reg;
@@ -108,6 +109,9 @@ public:
     MachineIRBuilder &MIRBuilder;
     MachineRegisterInfo &MRI;
     CCAssignFn *AssignFn;
+
+  private:
+    virtual void anchor();
   };
 
 protected:
index 04c13dded3a96316b724c96801a82765d886dfa8..67fe87fc96af6bfede28b2b42308485c347de77f 100644 (file)
@@ -308,6 +308,9 @@ public:
         : DAGUpdateListener(DAG), Callback(std::move(Callback)) {}
 
     void NodeDeleted(SDNode *N, SDNode *E) override { Callback(N, E); }
+
+   private:
+    virtual void anchor();
   };
 
   /// When true, additional steps are taken to
index b5ed2c7d5097812d4fc8e2640fcc96442f788624..3a55a7dca7f46513f946a87848a973914cd45b21 100644 (file)
@@ -101,6 +101,7 @@ private:
   /// Severity gives the severity of the diagnostic.
   const DiagnosticSeverity Severity;
 
+  virtual void anchor();
 public:
   DiagnosticInfo(/* DiagnosticKind */ int Kind, DiagnosticSeverity Severity)
       : Kind(Kind), Severity(Severity) {}
@@ -210,6 +211,7 @@ public:
 };
 
 class DiagnosticInfoStackSize : public DiagnosticInfoResourceLimit {
+  virtual void anchor() override;
 public:
   DiagnosticInfoStackSize(const Function &Fn, uint64_t StackSize,
                           DiagnosticSeverity Severity = DS_Warning,
@@ -360,6 +362,7 @@ public:
 
 /// Common features for diagnostics with an associated location.
 class DiagnosticInfoWithLocationBase : public DiagnosticInfo {
+  virtual void anchor() override;
 public:
   /// \p Fn is the function where the diagnostic is being emitted. \p Loc is
   /// the location information to use in the diagnostic.
@@ -598,6 +601,7 @@ operator<<(RemarkT &R,
 /// Common features for diagnostics dealing with optimization remarks
 /// that are used by IR passes.
 class DiagnosticInfoIROptimization : public DiagnosticInfoOptimizationBase {
+  virtual void anchor() override;
 public:
   /// \p PassName is the name of the pass emitting this diagnostic. \p
   /// RemarkName is a textual identifier for the remark (single-word,
@@ -818,6 +822,7 @@ private:
 /// Diagnostic information for optimization analysis remarks related to
 /// floating-point non-commutativity.
 class OptimizationRemarkAnalysisFPCommute : public OptimizationRemarkAnalysis {
+  virtual void anchor();
 public:
   /// \p PassName is the name of the pass emitting this diagnostic. If this name
   /// matches the regular expression given in -Rpass-analysis=, then the
@@ -859,6 +864,7 @@ private:
 /// Diagnostic information for optimization analysis remarks related to
 /// pointer aliasing.
 class OptimizationRemarkAnalysisAliasing : public OptimizationRemarkAnalysis {
+  virtual void anchor();
 public:
   /// \p PassName is the name of the pass emitting this diagnostic. If this name
   /// matches the regular expression given in -Rpass-analysis=, then the
index eb938338715d64793dd3eed8e725975c2097869c..a15f8b9236eb280227ecd7dba51fe42e39263d8c 100644 (file)
@@ -50,6 +50,7 @@ inline std::error_code make_error_code(object_error e) {
 /// Currently inherits from ECError for easy interoperability with
 /// std::error_code, but this will be removed in the future.
 class BinaryError : public ErrorInfo<BinaryError, ECError> {
+  virtual void anchor();
 public:
   static char ID;
   BinaryError() {
index 4962812e750e6007ce0024c1217c82506c7fff64..ee2cbeec97a81c6cb800c9feacf423e8014a81f9 100644 (file)
@@ -1066,6 +1066,8 @@ private:
 class ECError : public ErrorInfo<ECError> {
   friend Error errorCodeToError(std::error_code);
 
+  virtual void anchor() override;
+
 public:
   void setErrorCode(std::error_code EC) { this->EC = EC; }
   std::error_code convertToErrorCode() const override { return EC; }
index 56dda430efda31fde92ab1ef8d9c07ed76cbd2d9..e8bd90f50941c757261727d6d783da6373a6d2b6 100644 (file)
@@ -21,6 +21,8 @@ class Error;
 
 namespace detail {
 class format_adapter {
+  virtual void anchor();
+
 protected:
   virtual ~format_adapter() {}
 
index 3d4094eeb11106c13b27dadbdd7611028b124fe6..606a81e494e8998394da3ab7a075a5187f6bdf61 100644 (file)
@@ -383,6 +383,8 @@ protected:
 
 private:
   IntrusiveRefCntPtr<FileSystem> FS;
+
+  virtual void anchor();
 };
 
 namespace detail {
index 9a86f3a371e087b9fe9563cf8baf9908f55a73a8..d062e716209ddc32b07497c6f8c693ef8d74cc10 100644 (file)
@@ -554,6 +554,8 @@ class buffer_ostream : public raw_svector_ostream {
   raw_ostream &OS;
   SmallVector<char, 0> Buffer;
 
+  virtual void anchor() override;
+
 public:
   buffer_ostream(raw_ostream &OS) : raw_svector_ostream(Buffer), OS(OS) {}
   ~buffer_ostream() override { OS << str(); }
index da972eae756c9816169f05158d0c65cf229172c2..724ecedf3b3fb9f099a08f2f497b24f3c5ef0594 100644 (file)
@@ -23,6 +23,8 @@
 
 using namespace llvm;
 
+void CallLowering::anchor() {}
+
 bool CallLowering::lowerCall(
     MachineIRBuilder &MIRBuilder, ImmutableCallSite CS, unsigned ResReg,
     ArrayRef<unsigned> ArgRegs, std::function<unsigned()> GetCalleeReg) const {
@@ -180,3 +182,5 @@ unsigned CallLowering::ValueHandler::extendRegister(unsigned ValReg,
   }
   llvm_unreachable("unable to extend register");
 }
+
+void CallLowering::ValueHandler::anchor() {}
index 3ae7bd90554c8b76a0af93c5f369580b22cb291b..2f26a150b501f452c52e302dfbe7e91babaad6fe 100644 (file)
@@ -87,6 +87,8 @@ static SDVTList makeVTList(const EVT *VTs, unsigned NumVTs) {
 void SelectionDAG::DAGUpdateListener::NodeDeleted(SDNode*, SDNode*) {}
 void SelectionDAG::DAGUpdateListener::NodeUpdated(SDNode*) {}
 
+void SelectionDAG::DAGNodeDeletedListener::anchor() {}
+
 #define DEBUG_TYPE "selectiondag"
 
 static cl::opt<bool> EnableMemCpyDAGOpt("enable-memcpy-dag-opt",
index 3c6665bbcb7eac8e2c4689516ab706cc5a41a879..dc957ab7dad96fe1c99243f6d6e2d8e48c832dcb 100644 (file)
@@ -104,6 +104,11 @@ void DiagnosticInfoPGOProfile::print(DiagnosticPrinter &DP) const {
   DP << getMsg();
 }
 
+void DiagnosticInfo::anchor() {}
+void DiagnosticInfoStackSize::anchor() {}
+void DiagnosticInfoWithLocationBase::anchor() {}
+void DiagnosticInfoIROptimization::anchor() {}
+
 DiagnosticLocation::DiagnosticLocation(const DebugLoc &DL) {
   if (!DL)
     return;
@@ -366,6 +371,9 @@ std::string DiagnosticInfoOptimizationBase::getMsg() const {
   return OS.str();
 }
 
+void OptimizationRemarkAnalysisFPCommute::anchor() {}
+void OptimizationRemarkAnalysisAliasing::anchor() {}
+
 namespace llvm {
 namespace yaml {
 
index 7d43a84f3e0e069e625b5e8c35d53a47a822f568..6fa23e06c409d71b216dea2a2fac0dd46e675778 100644 (file)
@@ -57,6 +57,7 @@ std::string _object_error_category::message(int EV) const {
                    "defined.");
 }
 
+void BinaryError::anchor() {}
 char BinaryError::ID = 0;
 char GenericBinaryError::ID = 0;
 
index 0b0be8d48fa7a72b9088293b08b598ef6de4c929..bb5c31a2a35b174a6a0d67f272f7e6ac10c3b1ef 100644 (file)
@@ -54,6 +54,7 @@ namespace llvm {
 void ErrorInfoBase::anchor() {}
 char ErrorInfoBase::ID = 0;
 char ErrorList::ID = 0;
+void ECError::anchor() {};
 char ECError::ID = 0;
 char StringError::ID = 0;
 char FileError::ID = 0;
index 6dd133e6c50a2c7e643189525a77d84dd5d7e056..1f3505d5f74fac501e91f9a1c8089eb19b5c82cb 100644 (file)
@@ -152,3 +152,5 @@ formatv_object_base::parseFormatString(StringRef Fmt) {
   }
   return Replacements;
 }
+
+void detail::format_adapter::anchor() { }
index 24581944fa81ef82a22f25b14f42658fc8150b44..360f8d0061fb2af0d73de9e27e344799efe71535 100644 (file)
@@ -472,6 +472,8 @@ directory_iterator OverlayFileSystem::dir_begin(const Twine &Dir,
       std::make_shared<OverlayFSDirIterImpl>(Dir, *this, EC));
 }
 
+void ProxyFileSystem::anchor() {}
+
 namespace llvm {
 namespace vfs {
 
index 81df38f341c620124df491afa87d29eda97c09c6..21dde7ff914aa7dc46b264b14777ae0635a143d8 100644 (file)
@@ -914,3 +914,5 @@ void raw_null_ostream::pwrite_impl(const char *Ptr, size_t Size,
                                    uint64_t Offset) {}
 
 void raw_pwrite_stream::anchor() {}
+
+void buffer_ostream::anchor() {}