aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-03-23 18:08:29 +0000
committerJim Laskey <jlaskey@mac.com>2006-03-23 18:08:29 +0000
commit580418e0821e6ef28d7a0027cd8fcd1aefb6e847 (patch)
tree0ce0d6c4e29e6d26464cbbf4b63dd250ac29676f /lib
parentb8509c5752d58280178f611e0c3f8b89ed076598 (diff)
downloadexternal_llvm-580418e0821e6ef28d7a0027cd8fcd1aefb6e847.zip
external_llvm-580418e0821e6ef28d7a0027cd8fcd1aefb6e847.tar.gz
external_llvm-580418e0821e6ef28d7a0027cd8fcd1aefb6e847.tar.bz2
Modify how CBE handles #lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26990 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/CBackend/CBackend.cpp14
-rw-r--r--lib/Target/CBackend/Writer.cpp14
2 files changed, 10 insertions, 18 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 5389387..4e86c6f 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -21,6 +21,7 @@
#include "llvm/PassManager.h"
#include "llvm/SymbolTable.h"
#include "llvm/Intrinsics.h"
+#include "llvm/IntrinsicInst.h"
#include "llvm/Analysis/ConstantsScanner.h"
#include "llvm/Analysis/FindUsedTypes.h"
#include "llvm/Analysis/LoopInfo.h"
@@ -1715,17 +1716,12 @@ void CWriter::visitCallInst(CallInst &I) {
case Intrinsic::dbg_stoppoint: {
// If we use writeOperand directly we get a "u" suffix which is rejected
// by gcc.
- ConstantUInt *SI = cast<ConstantUInt>(I.getOperand(1));
- GlobalVariable *GV = cast<GlobalVariable>(I.getOperand(3));
- ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer());
- std::string FileName = CS->getOperand(4)->getStringValue();
- std::string Directory = CS->getOperand(5)->getStringValue();
+ DbgStopPointInst &SPI = cast<DbgStopPointInst>(I);
Out << "\n#line "
- << SI->getValue()
- << " \"" << Directory << FileName << "\"\n";
- // Need to set result.
- Out << "0";
+ << SPI.getLine()
+ << " \"" << SPI.getDirectory()
+ << SPI.getFileName() << "\"\n";
return;
}
}
diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp
index 5389387..4e86c6f 100644
--- a/lib/Target/CBackend/Writer.cpp
+++ b/lib/Target/CBackend/Writer.cpp
@@ -21,6 +21,7 @@
#include "llvm/PassManager.h"
#include "llvm/SymbolTable.h"
#include "llvm/Intrinsics.h"
+#include "llvm/IntrinsicInst.h"
#include "llvm/Analysis/ConstantsScanner.h"
#include "llvm/Analysis/FindUsedTypes.h"
#include "llvm/Analysis/LoopInfo.h"
@@ -1715,17 +1716,12 @@ void CWriter::visitCallInst(CallInst &I) {
case Intrinsic::dbg_stoppoint: {
// If we use writeOperand directly we get a "u" suffix which is rejected
// by gcc.
- ConstantUInt *SI = cast<ConstantUInt>(I.getOperand(1));
- GlobalVariable *GV = cast<GlobalVariable>(I.getOperand(3));
- ConstantStruct *CS = cast<ConstantStruct>(GV->getInitializer());
- std::string FileName = CS->getOperand(4)->getStringValue();
- std::string Directory = CS->getOperand(5)->getStringValue();
+ DbgStopPointInst &SPI = cast<DbgStopPointInst>(I);
Out << "\n#line "
- << SI->getValue()
- << " \"" << Directory << FileName << "\"\n";
- // Need to set result.
- Out << "0";
+ << SPI.getLine()
+ << " \"" << SPI.getDirectory()
+ << SPI.getFileName() << "\"\n";
return;
}
}