LLVM  13.0.0git
DiagnosticPrinter.cpp
Go to the documentation of this file.
1 //===- llvm/Support/DiagnosticInfo.cpp - Diagnostic Definitions -*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines a diagnostic printer relying on raw_ostream.
10 //
11 //===----------------------------------------------------------------------===//
12 
14 #include "llvm/ADT/Twine.h"
15 #include "llvm/IR/Module.h"
16 #include "llvm/IR/Value.h"
17 #include "llvm/Support/SourceMgr.h"
19 
20 using namespace llvm;
21 
23  Stream << C;
24  return *this;
25 }
26 
28  Stream << C;
29  return *this;
30 }
31 
33  Stream << C;
34  return *this;
35 }
36 
38  Stream << Str;
39  return *this;
40 }
41 
43  Stream << Str;
44  return *this;
45 }
46 
48  const std::string &Str) {
49  Stream << Str;
50  return *this;
51 }
52 
54  Stream << N;
55  return *this;
56 }
58  Stream << N;
59  return *this;
60 }
61 
63  unsigned long long N) {
64  Stream << N;
65  return *this;
66 }
67 
69  Stream << N;
70  return *this;
71 }
72 
74  Stream << P;
75  return *this;
76 }
77 
79  Stream << N;
80  return *this;
81 }
82 
84  Stream << N;
85  return *this;
86 }
87 
89  Stream << N;
90  return *this;
91 }
92 
94  Str.print(Stream);
95  return *this;
96 }
97 
98 // IR related types.
100  Stream << V.getName();
101  return *this;
102 }
103 
105  Stream << M.getModuleIdentifier();
106  return *this;
107 }
108 
109 // Other types.
111 operator<<(const SMDiagnostic &Diag) {
112  // We don't have to print the SMDiagnostic kind, as the diagnostic severity
113  // is printed by the diagnostic handler.
114  Diag.print("", Stream, /*ShowColors=*/true, /*ShowKindLabel=*/false);
115  return *this;
116 }
llvm
Definition: AllocatorList.h:23
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
Module.h
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
Twine.h
llvm::SMDiagnostic
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a ca...
Definition: SourceMgr.h:251
llvm::DiagnosticPrinterRawOStream::operator<<
DiagnosticPrinter & operator<<(char C) override
Definition: DiagnosticPrinter.cpp:22
llvm::DiagnosticPrinter
Interface for custom diagnostic printing.
Definition: DiagnosticPrinter.h:31
SourceMgr.h
llvm::SMDiagnostic::print
void print(const char *ProgName, raw_ostream &S, bool ShowColors=true, bool ShowKindLabel=true) const
Definition: SourceMgr.cpp:473
llvm::DiagnosticPrinterRawOStream::Stream
raw_ostream & Stream
Definition: DiagnosticPrinter.h:63
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::Value::getName
StringRef getName() const
Return a constant reference to the value's name.
Definition: Value.cpp:294
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:80
N
#define N
raw_ostream.h
DiagnosticPrinter.h
Value.h
llvm::Value
LLVM Value Representation.
Definition: Value.h:75