[llvm-commits] [llvm] r100218 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h include/llvm/CodeGen/MachineInstr.h include/llvm/Instruction.h include/llvm/Support/DebugLoc.h include/llvm/Support/IRBuilder.h lib/Target/PIC16/PIC16DebugInfo.h lib/VMCore/Core.cpp lib/VMCore/DebugLoc.cpp lib/VMCore/Metadata.cpp
Chris Lattner
sabre at nondot.org
Fri Apr 2 13:21:22 PDT 2010
Author: lattner
Date: Fri Apr 2 15:21:22 2010
New Revision: 100218
URL: http://llvm.org/viewvc/llvm-project?rev=100218&view=rev
Log:
rename NewDebugLoc -> DebugLoc, prune #includes in DebugLoc.h.
This keeps around temporary typedef for clang/llvm-gcc so the
build won't break when I commit this :)
Modified:
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
llvm/trunk/include/llvm/CodeGen/MachineInstr.h
llvm/trunk/include/llvm/Instruction.h
llvm/trunk/include/llvm/Support/DebugLoc.h
llvm/trunk/include/llvm/Support/IRBuilder.h
llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h
llvm/trunk/lib/VMCore/Core.cpp
llvm/trunk/lib/VMCore/DebugLoc.cpp
llvm/trunk/lib/VMCore/Metadata.cpp
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=100218&r1=100217&r2=100218&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Fri Apr 2 15:21:22 2010
@@ -19,6 +19,7 @@
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/Support/DebugLoc.h"
#include "llvm/Target/TargetMachine.h"
+#include "llvm/ADT/DenseMap.h"
namespace llvm {
class BlockAddress;
Modified: llvm/trunk/include/llvm/CodeGen/MachineInstr.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineInstr.h?rev=100218&r1=100217&r2=100218&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineInstr.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineInstr.h Fri Apr 2 15:21:22 2010
@@ -16,12 +16,13 @@
#ifndef LLVM_CODEGEN_MACHINEINSTR_H
#define LLVM_CODEGEN_MACHINEINSTR_H
-#include "llvm/ADT/ilist.h"
-#include "llvm/ADT/ilist_node.h"
-#include "llvm/ADT/STLExtras.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/Target/TargetInstrDesc.h"
#include "llvm/Target/TargetOpcodes.h"
+#include "llvm/ADT/ilist.h"
+#include "llvm/ADT/ilist_node.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/Support/DebugLoc.h"
#include <vector>
Modified: llvm/trunk/include/llvm/Instruction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instruction.h?rev=100218&r1=100217&r2=100218&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Instruction.h (original)
+++ llvm/trunk/include/llvm/Instruction.h Fri Apr 2 15:21:22 2010
@@ -32,7 +32,7 @@
Instruction(const Instruction &); // Do not implement
BasicBlock *Parent;
- NewDebugLoc DbgLoc; // 'dbg' Metadata cache.
+ DebugLoc DbgLoc; // 'dbg' Metadata cache.
enum {
/// HasMetadataBit - This is a bit stored in the SubClassData field which
@@ -181,10 +181,10 @@
}
/// setDebugLoc - Set the debug location information for this instruction.
- void setDebugLoc(const NewDebugLoc &Loc) { DbgLoc = Loc; }
+ void setDebugLoc(const DebugLoc &Loc) { DbgLoc = Loc; }
/// getDebugLoc - Return the debug location for this node as a DebugLoc.
- const NewDebugLoc &getDebugLoc() const { return DbgLoc; }
+ const DebugLoc &getDebugLoc() const { return DbgLoc; }
private:
/// hasMetadataHashEntry - Return true if we have an entry in the on-the-side
Modified: llvm/trunk/include/llvm/Support/DebugLoc.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/DebugLoc.h?rev=100218&r1=100217&r2=100218&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/DebugLoc.h (original)
+++ llvm/trunk/include/llvm/Support/DebugLoc.h Fri Apr 2 15:21:22 2010
@@ -12,11 +12,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_DEBUGLOC_H
-#define LLVM_DEBUGLOC_H
-
-#include "llvm/ADT/DenseMap.h"
-#include <vector>
+#ifndef LLVM_SUPPORT_DEBUGLOC_H
+#define LLVM_SUPPORT_DEBUGLOC_H
namespace llvm {
class MDNode;
@@ -25,7 +22,7 @@
/// DebugLoc - Debug location id. This is carried by Instruction, SDNode,
/// and MachineInstr to compactly encode file/line/scope information for an
/// operation.
- class NewDebugLoc {
+ class DebugLoc {
/// LineCol - This 32-bit value encodes the line and column number for the
/// location, encoded as 24-bits for line and 8 bits for col. A value of 0
/// for either means unknown.
@@ -35,15 +32,15 @@
/// decoded by LLVMContext. 0 is unknown.
int ScopeIdx;
public:
- NewDebugLoc() : LineCol(0), ScopeIdx(0) {} // Defaults to unknown.
+ DebugLoc() : LineCol(0), ScopeIdx(0) {} // Defaults to unknown.
/// get - Get a new DebugLoc that corresponds to the specified line/col
/// scope/inline location.
- static NewDebugLoc get(unsigned Line, unsigned Col,
- MDNode *Scope, MDNode *InlinedAt = 0);
+ static DebugLoc get(unsigned Line, unsigned Col,
+ MDNode *Scope, MDNode *InlinedAt = 0);
- /// getFromDILocation - Translate the DILocation quad into a NewDebugLoc.
- static NewDebugLoc getFromDILocation(MDNode *N);
+ /// getFromDILocation - Translate the DILocation quad into a DebugLoc.
+ static DebugLoc getFromDILocation(MDNode *N);
/// isUnknown - Return true if this is an unknown location.
bool isUnknown() const { return ScopeIdx == 0; }
@@ -73,20 +70,13 @@
/// DILocation compatible MDNode.
MDNode *getAsMDNode(const LLVMContext &Ctx) const;
- bool operator==(const NewDebugLoc &DL) const {
+ bool operator==(const DebugLoc &DL) const {
return LineCol == DL.LineCol && ScopeIdx == DL.ScopeIdx;
}
- bool operator!=(const NewDebugLoc &DL) const { return !(*this == DL); }
-
-
-
-
- static NewDebugLoc getUnknownLoc() { NewDebugLoc L; return L; }
+ bool operator!=(const DebugLoc &DL) const { return !(*this == DL); }
};
-
- typedef NewDebugLoc DebugLoc;
-
+ typedef DebugLoc NewDebugLoc;
} // end namespace llvm
#endif /* LLVM_DEBUGLOC_H */
Modified: llvm/trunk/include/llvm/Support/IRBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/IRBuilder.h?rev=100218&r1=100217&r2=100218&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/IRBuilder.h (original)
+++ llvm/trunk/include/llvm/Support/IRBuilder.h Fri Apr 2 15:21:22 2010
@@ -40,7 +40,7 @@
/// IRBuilderBase - Common base class shared among various IRBuilders.
class IRBuilderBase {
- NewDebugLoc CurDbgLocation;
+ DebugLoc CurDbgLocation;
protected:
BasicBlock *BB;
BasicBlock::iterator InsertPt;
@@ -82,13 +82,13 @@
/// SetCurrentDebugLocation - Set location information used by debugging
/// information.
- void SetCurrentDebugLocation(const NewDebugLoc &L) {
+ void SetCurrentDebugLocation(const DebugLoc &L) {
CurDbgLocation = L;
}
/// getCurrentDebugLocation - Get location information used by debugging
/// information.
- const NewDebugLoc &getCurrentDebugLocation() const { return CurDbgLocation; }
+ const DebugLoc &getCurrentDebugLocation() const { return CurDbgLocation; }
/// SetInstDebugLocation - If this builder has a current debug location, set
/// it on the specified instruction.
Modified: llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h?rev=100218&r1=100217&r2=100218&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.h Fri Apr 2 15:21:22 2010
@@ -19,7 +19,7 @@
namespace llvm {
class MachineFunction;
- class NewDebugLoc; typedef NewDebugLoc DebugLoc;
+ class DebugLoc;
namespace PIC16Dbg {
enum VarType {
T_NULL,
Modified: llvm/trunk/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=100218&r1=100217&r2=100218&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Core.cpp (original)
+++ llvm/trunk/lib/VMCore/Core.cpp Fri Apr 2 15:21:22 2010
@@ -1671,7 +1671,7 @@
void LLVMSetCurrentDebugLocation(LLVMBuilderRef Builder, LLVMValueRef L) {
MDNode *Loc = L ? unwrap<MDNode>(L) : NULL;
- unwrap(Builder)->SetCurrentDebugLocation(NewDebugLoc::getFromDILocation(Loc));
+ unwrap(Builder)->SetCurrentDebugLocation(DebugLoc::getFromDILocation(Loc));
}
LLVMValueRef LLVMGetCurrentDebugLocation(LLVMBuilderRef Builder) {
Modified: llvm/trunk/lib/VMCore/DebugLoc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/DebugLoc.cpp?rev=100218&r1=100217&r2=100218&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/DebugLoc.cpp (original)
+++ llvm/trunk/lib/VMCore/DebugLoc.cpp Fri Apr 2 15:21:22 2010
@@ -15,7 +15,7 @@
// DebugLoc Implementation
//===----------------------------------------------------------------------===//
-MDNode *NewDebugLoc::getScope(const LLVMContext &Ctx) const {
+MDNode *DebugLoc::getScope(const LLVMContext &Ctx) const {
if (ScopeIdx == 0) return 0;
if (ScopeIdx > 0) {
@@ -32,7 +32,7 @@
return Ctx.pImpl->ScopeInlinedAtRecords[-ScopeIdx-1].first.get();
}
-MDNode *NewDebugLoc::getInlinedAt(const LLVMContext &Ctx) const {
+MDNode *DebugLoc::getInlinedAt(const LLVMContext &Ctx) const {
// Positive ScopeIdx is an index into ScopeRecords, which has no inlined-at
// position specified. Zero is invalid.
if (ScopeIdx >= 0) return 0;
@@ -44,8 +44,8 @@
}
/// Return both the Scope and the InlinedAt values.
-void NewDebugLoc::getScopeAndInlinedAt(MDNode *&Scope, MDNode *&IA,
- const LLVMContext &Ctx) const {
+void DebugLoc::getScopeAndInlinedAt(MDNode *&Scope, MDNode *&IA,
+ const LLVMContext &Ctx) const {
if (ScopeIdx == 0) {
Scope = IA = 0;
return;
@@ -69,9 +69,9 @@
}
-NewDebugLoc NewDebugLoc::get(unsigned Line, unsigned Col,
- MDNode *Scope, MDNode *InlinedAt) {
- NewDebugLoc Result;
+DebugLoc DebugLoc::get(unsigned Line, unsigned Col,
+ MDNode *Scope, MDNode *InlinedAt) {
+ DebugLoc Result;
// If no scope is available, this is an unknown location.
if (Scope == 0) return Result;
@@ -95,7 +95,7 @@
/// getAsMDNode - This method converts the compressed DebugLoc node into a
/// DILocation compatible MDNode.
-MDNode *NewDebugLoc::getAsMDNode(const LLVMContext &Ctx) const {
+MDNode *DebugLoc::getAsMDNode(const LLVMContext &Ctx) const {
if (isUnknown()) return 0;
MDNode *Scope, *IA;
@@ -111,12 +111,12 @@
return MDNode::get(Ctx2, &Elts[0], 4);
}
-/// getFromDILocation - Translate the DILocation quad into a NewDebugLoc.
-NewDebugLoc NewDebugLoc::getFromDILocation(MDNode *N) {
- if (N == 0 || N->getNumOperands() != 4) return NewDebugLoc();
+/// getFromDILocation - Translate the DILocation quad into a DebugLoc.
+DebugLoc DebugLoc::getFromDILocation(MDNode *N) {
+ if (N == 0 || N->getNumOperands() != 4) return DebugLoc();
MDNode *Scope = dyn_cast_or_null<MDNode>(N->getOperand(2));
- if (Scope == 0) return NewDebugLoc();
+ if (Scope == 0) return DebugLoc();
unsigned LineNo = 0, ColNo = 0;
if (ConstantInt *Line = dyn_cast_or_null<ConstantInt>(N->getOperand(0)))
Modified: llvm/trunk/lib/VMCore/Metadata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Metadata.cpp?rev=100218&r1=100217&r2=100218&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Metadata.cpp (original)
+++ llvm/trunk/lib/VMCore/Metadata.cpp Fri Apr 2 15:21:22 2010
@@ -425,7 +425,7 @@
}
void Instruction::setDbgMetadata(MDNode *Node) {
- DbgLoc = NewDebugLoc::getFromDILocation(Node);
+ DbgLoc = DebugLoc::getFromDILocation(Node);
}
/// setMetadata - Set the metadata of of the specified kind to the specified
@@ -436,7 +436,7 @@
// Handle 'dbg' as a special case since it is not stored in the hash table.
if (KindID == LLVMContext::MD_dbg) {
- DbgLoc = NewDebugLoc::getFromDILocation(Node);
+ DbgLoc = DebugLoc::getFromDILocation(Node);
return;
}
@@ -549,7 +549,7 @@
/// removeAllMetadata - Remove all metadata from this instruction.
void Instruction::removeAllMetadata() {
assert(hasMetadata() && "Caller should check");
- DbgLoc = NewDebugLoc();
+ DbgLoc = DebugLoc();
if (hasMetadataHashEntry()) {
getContext().pImpl->MetadataStore.erase(this);
setHasMetadataHashEntry(false);
More information about the llvm-commits
mailing list