LLVM  14.0.0git
DiagnosticInfo.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 the different classes involved in low level diagnostics.
10 //
11 // Diagnostics reporting is still done as part of the LLVMContext.
12 //===----------------------------------------------------------------------===//
13 
14 #include "llvm/IR/DiagnosticInfo.h"
15 #include "LLVMContextImpl.h"
16 #include "llvm/ADT/StringExtras.h"
17 #include "llvm/ADT/Twine.h"
19 #include "llvm/IR/BasicBlock.h"
20 #include "llvm/IR/Constants.h"
22 #include "llvm/IR/DerivedTypes.h"
24 #include "llvm/IR/Function.h"
25 #include "llvm/IR/GlobalValue.h"
26 #include "llvm/IR/Instruction.h"
27 #include "llvm/IR/LLVMContext.h"
28 #include "llvm/IR/Metadata.h"
29 #include "llvm/IR/Module.h"
30 #include "llvm/IR/Type.h"
31 #include "llvm/IR/Value.h"
32 #include "llvm/Support/Casting.h"
36 #include "llvm/Support/Path.h"
37 #include "llvm/Support/Regex.h"
40 #include <atomic>
41 #include <cassert>
42 #include <memory>
43 #include <string>
44 
45 using namespace llvm;
46 
48  static std::atomic<int> PluginKindID(DK_FirstPluginKind);
49  return ++PluginKindID;
50 }
51 
53 
55  const Twine &MsgStr,
56  DiagnosticSeverity Severity)
57  : DiagnosticInfo(DK_InlineAsm, Severity), MsgStr(MsgStr), Instr(&I) {
58  if (const MDNode *SrcLoc = I.getMetadata("srcloc")) {
59  if (SrcLoc->getNumOperands() != 0)
60  if (const auto *CI =
61  mdconst::dyn_extract<ConstantInt>(SrcLoc->getOperand(0)))
62  LocCookie = CI->getZExtValue();
63  }
64 }
65 
67  DP << getMsgStr();
68  if (getLocCookie())
69  DP << " at line " << getLocCookie();
70 }
71 
73  DP << getResourceName() << " (" << getResourceSize() << ") exceeds limit ("
74  << getResourceLimit() << ") in function '" << getFunction() << '\'';
75 }
76 
78  DP << "ignoring debug info with an invalid version (" << getMetadataVersion()
79  << ") in " << getModule();
80 }
81 
83  DiagnosticPrinter &DP) const {
84  DP << "ignoring invalid debug info in " << getModule().getModuleIdentifier();
85 }
86 
88  if (!FileName.empty()) {
89  DP << getFileName();
90  if (LineNum > 0)
91  DP << ":" << getLineNum();
92  DP << ": ";
93  }
94  DP << getMsg();
95 }
96 
98  if (getFileName())
99  DP << getFileName() << ": ";
100  DP << getMsg();
101 }
102 
103 void DiagnosticInfo::anchor() {}
104 void DiagnosticInfoStackSize::anchor() {}
105 void DiagnosticInfoWithLocationBase::anchor() {}
106 void DiagnosticInfoIROptimization::anchor() {}
107 
109  if (!DL)
110  return;
111  File = DL->getFile();
112  Line = DL->getLine();
113  Column = DL->getColumn();
114 }
115 
117  if (!SP)
118  return;
119 
120  File = SP->getFile();
121  Line = SP->getScopeLine();
122  Column = 0;
123 }
124 
126  return File->getFilename();
127 }
128 
130  StringRef Name = File->getFilename();
132  return std::string(Name);
133 
134  SmallString<128> Path;
135  sys::path::append(Path, File->getDirectory(), Name);
137 }
138 
140  return Loc.getAbsolutePath();
141 }
142 
144  unsigned &Line,
145  unsigned &Column) const {
146  RelativePath = Loc.getRelativePath();
147  Line = Loc.getLine();
148  Column = Loc.getColumn();
149 }
150 
152  StringRef Filename("<unknown>");
153  unsigned Line = 0;
154  unsigned Column = 0;
155  if (isLocationAvailable())
156  getLocation(Filename, Line, Column);
157  return (Filename + ":" + Twine(Line) + ":" + Twine(Column)).str();
158 }
159 
161  const Value *V)
162  : Key(std::string(Key)) {
163  if (auto *F = dyn_cast<Function>(V)) {
164  if (DISubprogram *SP = F->getSubprogram())
165  Loc = SP;
166  }
167  else if (auto *I = dyn_cast<Instruction>(V))
168  Loc = I->getDebugLoc();
169 
170  // Only include names that correspond to user variables. FIXME: We should use
171  // debug info if available to get the name of the user variable.
172  if (isa<llvm::Argument>(V) || isa<GlobalValue>(V))
173  Val = std::string(GlobalValue::dropLLVMManglingEscape(V->getName()));
174  else if (isa<Constant>(V)) {
176  V->printAsOperand(OS, /*PrintType=*/false);
177  } else if (auto *I = dyn_cast<Instruction>(V))
178  Val = I->getOpcodeName();
179 }
180 
182  : Key(std::string(Key)) {
184  OS << *T;
185 }
186 
188  : Key(std::string(Key)), Val(S.str()) {}
189 
191  : Key(std::string(Key)), Val(itostr(N)) {}
192 
194  : Key(std::string(Key)), Val(llvm::to_string(N)) {}
195 
197  : Key(std::string(Key)), Val(itostr(N)) {}
198 
200  : Key(std::string(Key)), Val(itostr(N)) {}
201 
203  : Key(std::string(Key)), Val(utostr(N)) {}
204 
206  unsigned long N)
207  : Key(std::string(Key)), Val(utostr(N)) {}
208 
210  unsigned long long N)
211  : Key(std::string(Key)), Val(utostr(N)) {}
212 
214  ElementCount EC)
215  : Key(std::string(Key)) {
217  EC.print(OS);
218 }
219 
222  : Key(std::string(Key)) {
224  C.print(OS);
225 }
226 
228  : Key(std::string(Key)), Loc(Loc) {
229  if (Loc) {
230  Val = (Loc->getFilename() + ":" + Twine(Loc.getLine()) + ":" +
231  Twine(Loc.getCol())).str();
232  } else {
233  Val = "<UNKNOWN LOCATION>";
234  }
235 }
236 
238  DP << getLocationStr() << ": " << getMsg();
239  if (Hotness)
240  DP << " (hotness: " << *Hotness << ")";
241 }
242 
245  const DiagnosticLocation &Loc,
246  const Value *CodeRegion)
249  *cast<BasicBlock>(CodeRegion)->getParent(), Loc, CodeRegion) {}
250 
252  StringRef RemarkName,
253  const Instruction *Inst)
255  RemarkName, *Inst->getParent()->getParent(),
256  Inst->getDebugLoc(), Inst->getParent()) {}
257 
258 static const BasicBlock *getFirstFunctionBlock(const Function *Func) {
259  return Func->empty() ? nullptr : &Func->front();
260 }
261 
263  StringRef RemarkName,
264  const Function *Func)
266  RemarkName, *Func, Func->getSubprogram(),
267  getFirstFunctionBlock(Func)) {}
268 
270  const Function &Fn = getFunction();
271  LLVMContext &Ctx = Fn.getContext();
273 }
274 
276  const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc,
277  const Value *CodeRegion)
280  *cast<BasicBlock>(CodeRegion)->getParent(), Loc, CodeRegion) {}
281 
283  StringRef RemarkName,
284  const Instruction *Inst)
286  PassName, RemarkName,
287  *Inst->getParent()->getParent(),
288  Inst->getDebugLoc(), Inst->getParent()) {}
289 
291  StringRef RemarkName,
292  const Function *Func)
294  DK_OptimizationRemarkMissed, DS_Remark, PassName, RemarkName, *Func,
295  Func->getSubprogram(), getFirstFunctionBlock(Func)) {}
296 
298  const Function &Fn = getFunction();
299  LLVMContext &Ctx = Fn.getContext();
301 }
302 
304  const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc,
305  const Value *CodeRegion)
308  *cast<BasicBlock>(CodeRegion)->getParent(), Loc, CodeRegion) {}
309 
311  StringRef RemarkName,
312  const Instruction *Inst)
314  PassName, RemarkName,
315  *Inst->getParent()->getParent(),
316  Inst->getDebugLoc(), Inst->getParent()) {}
317 
319  enum DiagnosticKind Kind, const char *PassName, StringRef RemarkName,
320  const DiagnosticLocation &Loc, const Value *CodeRegion)
322  *cast<BasicBlock>(CodeRegion)->getParent(),
323  Loc, CodeRegion) {}
324 
326  StringRef RemarkName,
327  const Function *Func)
329  DK_OptimizationRemarkAnalysis, DS_Remark, PassName, RemarkName, *Func,
330  Func->getSubprogram(), getFirstFunctionBlock(Func)) {}
331 
333  const Function &Fn = getFunction();
334  LLVMContext &Ctx = Fn.getContext();
337 }
338 
340  DP << Diagnostic;
341 }
342 
344  DP << Diagnostic;
345 }
346 
348  const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc,
349  const Value *CodeRegion)
352  *cast<BasicBlock>(CodeRegion)->getParent(), Loc, CodeRegion) {}
353 
355  // Only print warnings.
356  return getSeverity() == DS_Warning;
357 }
358 
360  std::string Str;
361  raw_string_ostream OS(Str);
362 
363  OS << getLocationStr() << ": in function " << getFunction().getName() << ' '
364  << *getFunction().getFunctionType() << ": " << Msg << '\n';
365  OS.flush();
366  DP << Str;
367 }
368 
370  DP << "Instruction selection used fallback path for " << getFunction();
371 }
372 
374  Args.emplace_back(S);
375 }
376 
378  Args.push_back(std::move(A));
379 }
380 
382  IsVerbose = true;
383 }
384 
386  FirstExtraArgIndex = Args.size();
387 }
388 
390  std::string Str;
391  raw_string_ostream OS(Str);
393  make_range(Args.begin(), FirstExtraArgIndex == -1
394  ? Args.end()
395  : Args.begin() + FirstExtraArgIndex))
396  OS << Arg.Val;
397  return OS.str();
398 }
399 
400 void OptimizationRemarkAnalysisFPCommute::anchor() {}
401 void OptimizationRemarkAnalysisAliasing::anchor() {}
402 
404  DP << "call to " << getFunctionName() << " marked \"dontcall\"";
405 }
llvm::DIScope::getFilename
StringRef getFilename() const
Definition: DebugInfoMetadata.h:639
llvm::DK_FirstPluginKind
@ DK_FirstPluginKind
Definition: DiagnosticInfo.h:83
llvm::InstructionCost
Definition: InstructionCost.h:29
llvm::DiagnosticInfoOptimizationBase::Argument::Val
std::string Val
Definition: DiagnosticInfo.h:423
llvm::DiagnosticLocation::DiagnosticLocation
DiagnosticLocation()=default
llvm::cast
std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > cast(const Y &Val)
Definition: Casting.h:254
llvm::DiagnosticInfoOptimizationBase::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:237
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::StringRef::empty
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:153
llvm::make_range
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
Definition: iterator_range.h:53
llvm::DiagnosticInfoIgnoringInvalidDebugMetadata::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:82
llvm::DiagnosticInfoDebugMetadataVersion::getModule
const Module & getModule() const
Definition: DiagnosticInfo.h:251
Metadata.h
llvm::ElementCount
Definition: TypeSize.h:386
DebugInfoMetadata.h
llvm::DiagnosticInfoSampleProfile::getFileName
StringRef getFileName() const
Definition: DiagnosticInfo.h:307
llvm::DiagnosticInfoOptimizationBase::Argument::Loc
DiagnosticLocation Loc
Definition: DiagnosticInfo.h:425
llvm::GlobalValue::dropLLVMManglingEscape
static StringRef dropLLVMManglingEscape(StringRef Name)
If the given string begins with the GlobalValue name mangling escape character '\1',...
Definition: GlobalValue.h:482
T
llvm::DiagnosticHandler::isMissedOptRemarkEnabled
virtual bool isMissedOptRemarkEnabled(StringRef PassName) const
Return true if missed optimization remarks are enabled, override to provide different implementation.
Definition: DiagnosticHandler.cpp:78
llvm::Function
Definition: Function.h:61
llvm::raw_string_ostream
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:625
llvm::DiagnosticInfoWithLocationBase::getLocation
DiagnosticLocation getLocation() const
Definition: DiagnosticInfo.h:396
llvm::sys::path::remove_leading_dotslash
StringRef remove_leading_dotslash(StringRef path, Style style=Style::native)
Remove redundant leading "./" pieces and consecutive separators.
Definition: Path.cpp:702
Path.h
llvm::DiagnosticInfoOptimizationBase::PassName
const char * PassName
Name of the pass that triggers this report.
Definition: DiagnosticInfo.h:510
llvm::DiagnosticInfoOptimizationBase::insert
void insert(StringRef S)
Definition: DiagnosticInfo.cpp:373
llvm::sys::path::is_absolute
bool is_absolute(const Twine &path, Style style=Style::native)
Is path absolute?
Definition: Path.cpp:669
llvm::DiagnosticInfoOptimizationBase::getPassName
StringRef getPassName() const
Definition: DiagnosticInfo.h:474
ErrorHandling.h
llvm::DiagnosticInfoPGOProfile::getMsg
const Twine & getMsg() const
Definition: DiagnosticInfo.h:338
llvm::DiagnosticInfoInlineAsm::getLocCookie
uint64_t getLocCookie() const
Definition: DiagnosticInfo.h:166
llvm::DiagnosticInfoSampleProfile::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:87
llvm::DiagnosticInfoOptimizationBase::Argument::Argument
Argument(StringRef Str="")
Definition: DiagnosticInfo.h:427
llvm::DiagnosticInfoResourceLimit::getResourceName
const char * getResourceName() const
Definition: DiagnosticInfo.h:205
llvm::OptimizationRemarkMissed::OptimizationRemarkMissed
OptimizationRemarkMissed(const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, const Value *CodeRegion)
PassName is the name of the pass emitting this diagnostic.
Definition: DiagnosticInfo.cpp:275
llvm::Function::getContext
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function.
Definition: Function.cpp:321
llvm::DiagnosticInfoUnsupported::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:359
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
Module.h
llvm::DiagnosticInfoOptimizationBase::RemarkName
StringRef RemarkName
Textual identifier for the remark (single-word, camel-case).
Definition: DiagnosticInfo.h:515
llvm::DiagnosticInfoISelFallback::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:369
llvm::DiagnosticInfoResourceLimit::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:72
llvm::DiagnosticInfoIROptimization
Common features for diagnostics dealing with optimization remarks that are used by IR passes.
Definition: DiagnosticInfo.h:617
llvm::DiagnosticInfoInlineAsm::DiagnosticInfoInlineAsm
DiagnosticInfoInlineAsm(const Twine &MsgStr, DiagnosticSeverity Severity=DS_Error)
MsgStr is the message to be reported to the frontend.
Definition: DiagnosticInfo.h:145
llvm::DiagnosticKind
DiagnosticKind
Defines the different supported kind of a diagnostic.
Definition: DiagnosticInfo.h:55
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::BasicBlock
LLVM Basic Block Representation.
Definition: BasicBlock.h:58
llvm::sys::path::append
void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
Definition: Path.cpp:454
Arg
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
Definition: AMDGPULibCalls.cpp:206
llvm::DiagnosticLocation::getRelativePath
StringRef getRelativePath() const
Return the file name relative to the compilation directory.
Definition: DiagnosticInfo.cpp:125
Instruction.h
CommandLine.h
llvm::OptimizationRemark::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:269
llvm::DiagnosticInfoPGOProfile::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:97
GlobalValue.h
llvm::OptimizationRemarkAnalysis::OptimizationRemarkAnalysis
OptimizationRemarkAnalysis(const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, const Value *CodeRegion)
PassName is the name of the pass emitting this diagnostic.
Definition: DiagnosticInfo.cpp:303
Constants.h
llvm::DS_Warning
@ DS_Warning
Definition: DiagnosticInfo.h:46
llvm::DiagnosticInfoMIRParser::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:339
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
Twine.h
llvm::DiagnosticInfoSampleProfile::getLineNum
unsigned getLineNum() const
Definition: DiagnosticInfo.h:308
llvm::AMDGPU::PALMD::Key
Key
PAL metadata keys.
Definition: AMDGPUMetadata.h:481
llvm::DiagnosticInfoWithLocationBase::getFunction
const Function & getFunction() const
Definition: DiagnosticInfo.h:395
llvm::DK_OptimizationRemarkAnalysis
@ DK_OptimizationRemarkAnalysis
Definition: DiagnosticInfo.h:67
llvm::Instruction
Definition: Instruction.h:45
llvm::DiagnosticSeverity
DiagnosticSeverity
Defines the different supported severity of a diagnostic.
Definition: DiagnosticInfo.h:44
LLVMContextImpl.h
llvm::raw_ostream::flush
void flush()
Definition: raw_ostream.h:186
llvm::DiagnosticInfoOptimizationFailure::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:354
llvm::DK_OptimizationRemarkMissed
@ DK_OptimizationRemarkMissed
Definition: DiagnosticInfo.h:66
llvm::DiagnosticInfo::getSeverity
DiagnosticSeverity getSeverity() const
Definition: DiagnosticInfo.h:117
llvm::DiagnosticInfo
This is the base abstract class for diagnostic reporting in the backend.
Definition: DiagnosticInfo.h:102
llvm::DiagnosticInfoDontCall::getFunctionName
StringRef getFunctionName() const
Definition: DiagnosticInfo.h:1081
llvm::DiagnosticPrinter
Interface for custom diagnostic printing.
Definition: DiagnosticPrinter.h:31
llvm::OptimizationRemarkMissed::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:297
llvm::StringRef::str
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
Definition: StringRef.h:245
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
llvm::OptimizationRemark::OptimizationRemark
OptimizationRemark(const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc, const Value *CodeRegion)
PassName is the name of the pass emitting this diagnostic.
Definition: DiagnosticInfo.cpp:243
llvm::DiagnosticInfoOptimizationBase::Hotness
Optional< uint64_t > Hotness
If profile information is available, this is the number of times the corresponding code was executed ...
Definition: DiagnosticInfo.h:519
Type.h
llvm::SmallString< 128 >
llvm::DiagnosticInfoOptimizationBase::Args
SmallVector< Argument, 4 > Args
Arguments collected via the streaming interface.
Definition: DiagnosticInfo.h:522
llvm::LLVMContext::getDiagHandlerPtr
const DiagnosticHandler * getDiagHandlerPtr() const
getDiagHandlerPtr - Returns const raw pointer of DiagnosticHandler set by setDiagnosticHandler.
Definition: LLVMContext.cpp:343
llvm::DK_InlineAsm
@ DK_InlineAsm
Definition: DiagnosticInfo.h:56
BasicBlock.h
llvm::DiagnosticInfoWithLocationBase::getLocationStr
std::string getLocationStr() const
Return a string with the location information for this diagnostic in the format "file:line:col".
Definition: DiagnosticInfo.cpp:151
llvm::DiagnosticInfoOptimizationBase::Argument
Used in the streaming interface as the general argument type.
Definition: DiagnosticInfo.h:421
llvm::DiagnosticInfoWithLocationBase::isLocationAvailable
bool isLocationAvailable() const
Return true if location information is available for this diagnostic.
Definition: DiagnosticInfo.h:380
llvm::DiagnosticInfoPGOProfile::getFileName
const char * getFileName() const
Definition: DiagnosticInfo.h:337
llvm::DiagnosticInfoResourceLimit::getFunction
const Function & getFunction() const
Definition: DiagnosticInfo.h:204
llvm::DS_Remark
@ DS_Remark
Definition: DiagnosticInfo.h:47
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::DiagnosticInfoWithLocationBase::getAbsolutePath
std::string getAbsolutePath() const
Return the absolute path tot the file.
Definition: DiagnosticInfo.cpp:139
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
I
#define I(x, y, z)
Definition: MD5.cpp:59
StringExtras.h
llvm::DiagnosticInfoOptimizationBase::FirstExtraArgIndex
int FirstExtraArgIndex
If positive, the index of the first argument that only appear in the optimization records and not in ...
Definition: DiagnosticInfo.h:530
llvm::DiagnosticInfoResourceLimit::getResourceSize
uint64_t getResourceSize() const
Definition: DiagnosticInfo.h:206
Regex.h
llvm::Module::getModuleIdentifier
const std::string & getModuleIdentifier() const
Get the module identifier which is, essentially, the name of the module.
Definition: Module.h:227
iterator_range.h
llvm::DiagnosticInfoOptimizationBase::setExtraArgs
When an instance of this is inserted into the stream, the arguments following will not appear in the ...
Definition: DiagnosticInfo.h:417
llvm::MDNode
Metadata node.
Definition: Metadata.h:906
llvm::DiagnosticInfoDebugMetadataVersion::getMetadataVersion
unsigned getMetadataVersion() const
Definition: DiagnosticInfo.h:252
llvm::Value::printAsOperand
void printAsOperand(raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const
Print the name of this Value out to the specified raw_ostream.
Definition: AsmWriter.cpp:4675
InstructionCost.h
getDebugLoc
static DebugLoc getDebugLoc(MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)
Return the first found DebugLoc that has a DILocation, given a range of instructions.
Definition: MachineInstrBundle.cpp:109
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::DK_OptimizationFailure
@ DK_OptimizationFailure
Definition: DiagnosticInfo.h:70
llvm::DiagnosticLocation
Definition: DiagnosticInfo.h:348
getParent
static const Function * getParent(const Value *V)
Definition: BasicAliasAnalysis.cpp:776
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
llvm::DiagnosticHandler::isAnalysisRemarkEnabled
virtual bool isAnalysisRemarkEnabled(StringRef PassName) const
Return true if analysis remarks are enabled, override to provide different implementation.
Definition: DiagnosticHandler.cpp:74
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::DiagnosticInfoInlineAsm::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:66
llvm::DiagnosticInfoDebugMetadataVersion::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:77
llvm::DIScope::getDirectory
StringRef getDirectory() const
Definition: DebugInfoMetadata.h:645
llvm::DiagnosticInfoDontCall::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:403
llvm::DiagnosticInfoISelFallback::getFunction
const Function & getFunction() const
Definition: DiagnosticInfo.h:958
llvm::Value::getName
StringRef getName() const
Return a constant reference to the value's name.
Definition: Value.cpp:309
llvm::DiagnosticHandler::isPassedOptRemarkEnabled
virtual bool isPassedOptRemarkEnabled(StringRef PassName) const
Return true if passed optimization remarks are enabled, override to provide different implementation.
Definition: DiagnosticHandler.cpp:82
llvm::OptimizationRemarkAnalysis::shouldAlwaysPrint
bool shouldAlwaysPrint() const
Definition: DiagnosticInfo.h:817
getFirstFunctionBlock
static const BasicBlock * getFirstFunctionBlock(const Function *Func)
Definition: DiagnosticInfo.cpp:258
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
std
Definition: BitVector.h:838
llvm::DiagnosticInfoOptimizationBase::getMsg
std::string getMsg() const
Definition: DiagnosticInfo.cpp:389
Casting.h
DiagnosticInfo.h
Function.h
llvm::DK_OptimizationRemark
@ DK_OptimizationRemark
Definition: DiagnosticInfo.h:65
llvm::Function::getFunctionType
FunctionType * getFunctionType() const
Returns the FunctionType for me.
Definition: Function.h:176
DP
So we should use XX3Form_Rcr to implement instrinsic Convert DP outs ins xscvdpsp No builtin are required Round &Convert QP DP(dword[1] is set to zero) No builtin are required Round to Quad Precision because you need to assign rounding mode in instruction Provide builtin(set f128:$vT,(int_ppc_vsx_xsrqpi f128:$vB))(set f128 yields< n x< ty > >< result > yields< ty >< result > No builtin are required Load Store load store see def memrix16 in PPCInstrInfo td Load Store Vector load store outs ins lxsdx set load store with conversion from to DP
Definition: README_P9.txt:520
llvm::OptimizationRemarkAnalysis::AlwaysPrint
static const char * AlwaysPrint
Definition: DiagnosticInfo.h:815
llvm::DiagnosticInfoIgnoringInvalidDebugMetadata::getModule
const Module & getModule() const
Definition: DiagnosticInfo.h:274
N
#define N
llvm::DiagnosticLocation::getAbsolutePath
std::string getAbsolutePath() const
Return the full path to the file.
Definition: DiagnosticInfo.cpp:129
llvm::getNextAvailablePluginDiagnosticKind
int getNextAvailablePluginDiagnosticKind()
Get the next available kind ID for a plugin diagnostic.
Definition: DiagnosticInfo.cpp:47
llvm::to_string
std::string to_string(const T &Value)
Definition: ScopedPrinter.h:63
getSubprogram
static DISubprogram * getSubprogram(bool IsDistinct, Ts &&... Args)
Definition: DIBuilder.cpp:819
llvm::DISubprogram
Subprogram description.
Definition: DebugInfoMetadata.h:1820
llvm::DiagnosticLocation::getColumn
unsigned getColumn() const
Definition: DiagnosticInfo.h:364
DerivedTypes.h
llvm::DiagnosticInfoInlineAsm::getMsgStr
const Twine & getMsgStr() const
Definition: DiagnosticInfo.h:167
llvm::DiagnosticInfoOptimizationBase::IsVerbose
bool IsVerbose
The remark is expected to be noisy.
Definition: DiagnosticInfo.h:525
llvm::DiagnosticInfoSampleProfile::getMsg
const Twine & getMsg() const
Definition: DiagnosticInfo.h:309
LLVMContext.h
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
raw_ostream.h
llvm::DiagnosticInfoSrcMgr::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:343
DiagnosticPrinter.h
llvm::DiagnosticInfoResourceLimit::getResourceLimit
uint64_t getResourceLimit() const
Definition: DiagnosticInfo.h:207
Value.h
llvm::raw_string_ostream::str
std::string & str()
Flushes the stream contents to the target string and returns the string's reference.
Definition: raw_ostream.h:643
llvm::OptimizationRemarkAnalysis::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:332
llvm::DiagnosticInfoOptimizationFailure::DiagnosticInfoOptimizationFailure
DiagnosticInfoOptimizationFailure(const Function &Fn, const DiagnosticLocation &Loc, const Twine &Msg)
Fn is the function where the diagnostic is being emitted.
Definition: DiagnosticInfo.h:979
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
PassName
static const char PassName[]
Definition: X86LowerAMXIntrinsics.cpp:669
llvm::DiagnosticInfoOptimizationBase::setIsVerbose
Used to set IsVerbose via the stream interface.
Definition: DiagnosticInfo.h:411
llvm::DiagnosticLocation::getLine
unsigned getLine() const
Definition: DiagnosticInfo.h:363
llvm::DIScope::getFile
DIFile * getFile() const
Definition: DebugInfoMetadata.h:484
SpecialSubKind::string
@ string
ScopedPrinter.h