Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:33

0001 //===-- llvm/CodeGen/PseudoSourceValueManager.h -----------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file contains the declaration of the PseudoSourceValueManager class.
0010 //
0011 //===----------------------------------------------------------------------===//
0012 
0013 #ifndef LLVM_CODEGEN_PSEUDOSOURCEVALUEMANAGER_H
0014 #define LLVM_CODEGEN_PSEUDOSOURCEVALUEMANAGER_H
0015 
0016 #include "llvm/ADT/SmallVector.h"
0017 #include "llvm/ADT/StringMap.h"
0018 #include "llvm/CodeGen/PseudoSourceValue.h"
0019 #include "llvm/IR/ValueMap.h"
0020 
0021 namespace llvm {
0022 
0023 class GlobalValue;
0024 class TargetMachine;
0025 
0026 /// Manages creation of pseudo source values.
0027 class PseudoSourceValueManager {
0028   const TargetMachine &TM;
0029   const PseudoSourceValue StackPSV, GOTPSV, JumpTablePSV, ConstantPoolPSV;
0030   SmallVector<std::unique_ptr<FixedStackPseudoSourceValue>> FSValues;
0031   StringMap<std::unique_ptr<const ExternalSymbolPseudoSourceValue>>
0032       ExternalCallEntries;
0033   ValueMap<const GlobalValue *,
0034            std::unique_ptr<const GlobalValuePseudoSourceValue>>
0035       GlobalCallEntries;
0036 
0037 public:
0038   PseudoSourceValueManager(const TargetMachine &TM);
0039 
0040   /// Return a pseudo source value referencing the area below the stack frame of
0041   /// a function, e.g., the argument space.
0042   const PseudoSourceValue *getStack();
0043 
0044   /// Return a pseudo source value referencing the global offset table
0045   /// (or something the like).
0046   const PseudoSourceValue *getGOT();
0047 
0048   /// Return a pseudo source value referencing the constant pool. Since constant
0049   /// pools are constant, this doesn't need to identify a specific constant
0050   /// pool entry.
0051   const PseudoSourceValue *getConstantPool();
0052 
0053   /// Return a pseudo source value referencing a jump table. Since jump tables
0054   /// are constant, this doesn't need to identify a specific jump table.
0055   const PseudoSourceValue *getJumpTable();
0056 
0057   /// Return a pseudo source value referencing a fixed stack frame entry,
0058   /// e.g., a spill slot.
0059   const PseudoSourceValue *getFixedStack(int FI);
0060 
0061   const PseudoSourceValue *getGlobalValueCallEntry(const GlobalValue *GV);
0062 
0063   const PseudoSourceValue *getExternalSymbolCallEntry(const char *ES);
0064 };
0065 
0066 } // end namespace llvm
0067 
0068 #endif