LLVM  13.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() << " limit";
74 
75  if (getResourceLimit() != 0)
76  DP << " of " << getResourceLimit();
77 
78  DP << " exceeded (" << getResourceSize() << ") in " << getFunction();
79 }
80 
82  DP << "ignoring debug info with an invalid version (" << getMetadataVersion()
83  << ") in " << getModule();
84 }
85 
87  DiagnosticPrinter &DP) const {
88  DP << "ignoring invalid debug info in " << getModule().getModuleIdentifier();
89 }
90 
92  if (!FileName.empty()) {
93  DP << getFileName();
94  if (LineNum > 0)
95  DP << ":" << getLineNum();
96  DP << ": ";
97  }
98  DP << getMsg();
99 }
100 
102  if (getFileName())
103  DP << getFileName() << ": ";
104  DP << getMsg();
105 }
106 
107 void DiagnosticInfo::anchor() {}
108 void DiagnosticInfoStackSize::anchor() {}
109 void DiagnosticInfoWithLocationBase::anchor() {}
110 void DiagnosticInfoIROptimization::anchor() {}
111 
113  if (!DL)
114  return;
115  File = DL->getFile();
116  Line = DL->getLine();
117  Column = DL->getColumn();
118 }
119 
121  if (!SP)
122  return;
123 
124  File = SP->getFile();
125  Line = SP->getScopeLine();
126  Column = 0;
127 }
128 
130  return File->getFilename();
131 }
132 
134  StringRef Name = File->getFilename();
136  return std::string(Name);
137 
138  SmallString<128> Path;
139  sys::path::append(Path, File->getDirectory(), Name);
141 }
142 
144  return Loc.getAbsolutePath();
145 }
146 
148  unsigned &Line,
149  unsigned &Column) const {
150  RelativePath = Loc.getRelativePath();
151  Line = Loc.getLine();
152  Column = Loc.getColumn();
153 }
154 
156  StringRef Filename("<unknown>");
157  unsigned Line = 0;
158  unsigned Column = 0;
159  if (isLocationAvailable())
160  getLocation(Filename, Line, Column);
161  return (Filename + ":" + Twine(Line) + ":" + Twine(Column)).str();
162 }
163 
165  const Value *V)
166  : Key(std::string(Key)) {
167  if (auto *F = dyn_cast<Function>(V)) {
168  if (DISubprogram *SP = F->getSubprogram())
169  Loc = SP;
170  }
171  else if (auto *I = dyn_cast<Instruction>(V))
172  Loc = I->getDebugLoc();
173 
174  // Only include names that correspond to user variables. FIXME: We should use
175  // debug info if available to get the name of the user variable.
176  if (isa<llvm::Argument>(V) || isa<GlobalValue>(V))
177  Val = std::string(GlobalValue::dropLLVMManglingEscape(V->getName()));
178  else if (isa<Constant>(V)) {
180  V->printAsOperand(OS, /*PrintType=*/false);
181  } else if (auto *I = dyn_cast<Instruction>(V))
182  Val = I->getOpcodeName();
183 }
184 
186  : Key(std::string(Key)) {
188  OS << *T;
189 }
190 
192  : Key(std::string(Key)), Val(S.str()) {}
193 
195  : Key(std::string(Key)), Val(itostr(N)) {}
196 
198  : Key(std::string(Key)), Val(llvm::to_string(N)) {}
199 
201  : Key(std::string(Key)), Val(itostr(N)) {}
202 
204  : Key(std::string(Key)), Val(itostr(N)) {}
205 
207  : Key(std::string(Key)), Val(utostr(N)) {}
208 
210  unsigned long N)
211  : Key(std::string(Key)), Val(utostr(N)) {}
212 
214  unsigned long long N)
215  : Key(std::string(Key)), Val(utostr(N)) {}
216 
218  ElementCount EC)
219  : Key(std::string(Key)) {
221  EC.print(OS);
222 }
223 
226  : Key(std::string(Key)) {
228  C.print(OS);
229 }
230 
232  : Key(std::string(Key)), Loc(Loc) {
233  if (Loc) {
234  Val = (Loc->getFilename() + ":" + Twine(Loc.getLine()) + ":" +
235  Twine(Loc.getCol())).str();
236  } else {
237  Val = "<UNKNOWN LOCATION>";
238  }
239 }
240 
242  DP << getLocationStr() << ": " << getMsg();
243  if (Hotness)
244  DP << " (hotness: " << *Hotness << ")";
245 }
246 
249  const DiagnosticLocation &Loc,
250  const Value *CodeRegion)
253  *cast<BasicBlock>(CodeRegion)->getParent(), Loc, CodeRegion) {}
254 
256  StringRef RemarkName,
257  const Instruction *Inst)
259  RemarkName, *Inst->getParent()->getParent(),
260  Inst->getDebugLoc(), Inst->getParent()) {}
261 
262 static const BasicBlock *getFirstFunctionBlock(const Function *Func) {
263  return Func->empty() ? nullptr : &Func->front();
264 }
265 
267  StringRef RemarkName,
268  const Function *Func)
270  RemarkName, *Func, Func->getSubprogram(),
271  getFirstFunctionBlock(Func)) {}
272 
274  const Function &Fn = getFunction();
275  LLVMContext &Ctx = Fn.getContext();
277 }
278 
280  const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc,
281  const Value *CodeRegion)
284  *cast<BasicBlock>(CodeRegion)->getParent(), Loc, CodeRegion) {}
285 
287  StringRef RemarkName,
288  const Instruction *Inst)
290  PassName, RemarkName,
291  *Inst->getParent()->getParent(),
292  Inst->getDebugLoc(), Inst->getParent()) {}
293 
295  const Function &Fn = getFunction();
296  LLVMContext &Ctx = Fn.getContext();
298 }
299 
301  const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc,
302  const Value *CodeRegion)
305  *cast<BasicBlock>(CodeRegion)->getParent(), Loc, CodeRegion) {}
306 
308  StringRef RemarkName,
309  const Instruction *Inst)
311  PassName, RemarkName,
312  *Inst->getParent()->getParent(),
313  Inst->getDebugLoc(), Inst->getParent()) {}
314 
316  enum DiagnosticKind Kind, const char *PassName, StringRef RemarkName,
317  const DiagnosticLocation &Loc, const Value *CodeRegion)
319  *cast<BasicBlock>(CodeRegion)->getParent(),
320  Loc, CodeRegion) {}
321 
323  const Function &Fn = getFunction();
324  LLVMContext &Ctx = Fn.getContext();
327 }
328 
330  DP << Diagnostic;
331 }
332 
334  DP << Diagnostic;
335 }
336 
338  const char *PassName, StringRef RemarkName, const DiagnosticLocation &Loc,
339  const Value *CodeRegion)
342  *cast<BasicBlock>(CodeRegion)->getParent(), Loc, CodeRegion) {}
343 
345  // Only print warnings.
346  return getSeverity() == DS_Warning;
347 }
348 
350  std::string Str;
351  raw_string_ostream OS(Str);
352 
353  OS << getLocationStr() << ": in function " << getFunction().getName() << ' '
354  << *getFunction().getFunctionType() << ": " << Msg << '\n';
355  OS.flush();
356  DP << Str;
357 }
358 
360  DP << "Instruction selection used fallback path for " << getFunction();
361 }
362 
364  Args.emplace_back(S);
365 }
366 
368  Args.push_back(std::move(A));
369 }
370 
372  IsVerbose = true;
373 }
374 
376  FirstExtraArgIndex = Args.size();
377 }
378 
380  std::string Str;
381  raw_string_ostream OS(Str);
383  make_range(Args.begin(), FirstExtraArgIndex == -1
384  ? Args.end()
385  : Args.begin() + FirstExtraArgIndex))
386  OS << Arg.Val;
387  return OS.str();
388 }
389 
390 void OptimizationRemarkAnalysisFPCommute::anchor() {}
391 void OptimizationRemarkAnalysisAliasing::anchor() {}
llvm::DIScope::getFilename
StringRef getFilename() const
Definition: DebugInfoMetadata.h:631
llvm::DK_FirstPluginKind
@ DK_FirstPluginKind
Definition: DiagnosticInfo.h:82
llvm::InstructionCost
Definition: InstructionCost.h:26
llvm::EngineKind::Kind
Kind
Definition: ExecutionEngine.h:524
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:241
llvm
This class represents lattice values for constants.
Definition: AllocatorList.h:23
llvm::StringRef::empty
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:156
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:86
llvm::DiagnosticInfoDebugMetadataVersion::getModule
const Module & getModule() const
Definition: DiagnosticInfo.h:251
Metadata.h
llvm::ElementCount
Definition: TypeSize.h:382
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
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:614
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:363
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::DiagnosticInfoSampleProfile::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:91
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:279
llvm::Function::getContext
LLVMContext & getContext() const
getContext - Return a reference to the LLVMContext associated with this function.
Definition: Function.cpp:300
llvm::DiagnosticInfoUnsupported::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:349
llvm::Type
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:46
Module.h
llvm::DiagnosticInfoOptimizationBase::RemarkName
StringRef RemarkName
Textual identifier for the remark (single-word, camel-case).
Definition: DiagnosticInfo.h:515
T
#define T
Definition: Mips16ISelLowering.cpp:341
llvm::DiagnosticInfoISelFallback::print
void print(DiagnosticPrinter &DP) const override
Print using the given DP a user-friendly message.
Definition: DiagnosticInfo.cpp:359
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:144
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:205
llvm::DiagnosticLocation::getRelativePath
StringRef getRelativePath() const
Return the file name relative to the compilation directory.
Definition: DiagnosticInfo.cpp:129
Instruction.h
CommandLine.h
llvm::OptimizationRemark::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:273
llvm::DiagnosticInfoPGOProfile::print
void print(DiagnosticPrinter &DP) const override
Definition: DiagnosticInfo.cpp:101
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:300
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:329
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:471
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:183
llvm::DiagnosticInfoOptimizationFailure::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:344
llvm::DK_OptimizationRemarkMissed
@ DK_OptimizationRemarkMissed
Definition: DiagnosticInfo.h:66
llvm::DiagnosticInfo::getSeverity
DiagnosticSeverity getSeverity() const
Definition: DiagnosticInfo.h:116
llvm::DiagnosticInfo
This is the base abstract class for diagnostic reporting in the backend.
Definition: DiagnosticInfo.h:101
llvm::DiagnosticPrinter
Interface for custom diagnostic printing.
Definition: DiagnosticPrinter.h:31
llvm::OptimizationRemarkMissed::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:294
llvm::StringRef::str
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
Definition: StringRef.h:248
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:247
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:155
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:143
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:219
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:893
PassName
static const char PassName[]
Definition: X86LowerAMXType.cpp:346
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:4687
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:57
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:780
llvm::DiagnosticInfoInlineAsm::getLocCookie
unsigned getLocCookie() const
Definition: DiagnosticInfo.h:165
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:81
llvm::DIScope::getDirectory
StringRef getDirectory() const
Definition: DebugInfoMetadata.h:637
llvm::DiagnosticInfoISelFallback::getFunction
const Function & getFunction() const
Definition: DiagnosticInfo.h:948
llvm::Value::getName
StringRef getName() const
Return a constant reference to the value's name.
Definition: Value.cpp:295
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:807
getFirstFunctionBlock
static const BasicBlock * getFirstFunctionBlock(const Function *Func)
Definition: DiagnosticInfo.cpp:262
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:80
llvm::GraphProgram::Name
Name
Definition: GraphWriter.h:52
std
Definition: BitVector.h:941
llvm::DiagnosticInfoOptimizationBase::getMsg
std::string getMsg() const
Definition: DiagnosticInfo.cpp:379
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:165
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:805
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:133
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:62
getSubprogram
static DISubprogram * getSubprogram(bool IsDistinct, Ts &&... Args)
Definition: DIBuilder.cpp:792
llvm::DISubprogram
Subprogram description.
Definition: DebugInfoMetadata.h:1811
llvm::DiagnosticLocation::getColumn
unsigned getColumn() const
Definition: DiagnosticInfo.h:364
DerivedTypes.h
llvm::DiagnosticInfoInlineAsm::getMsgStr
const Twine & getMsgStr() const
Definition: DiagnosticInfo.h:166
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:333
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:632
llvm::OptimizationRemarkAnalysis::isEnabled
bool isEnabled() const override
Definition: DiagnosticInfo.cpp:322
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:969
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
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:476
SpecialSubKind::string
@ string
ScopedPrinter.h