[llvm-commits] [llvm] r78334 - /llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp
Devang Patel
dpatel at apple.com
Thu Aug 6 13:53:24 PDT 2009
Author: dpatel
Date: Thu Aug 6 15:53:24 2009
New Revision: 78334
URL: http://llvm.org/viewvc/llvm-project?rev=78334&view=rev
Log:
Use DebugInfoFinder
Modified:
llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp
Modified: llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp?rev=78334&r1=78333&r2=78334&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16DebugInfo.cpp Thu Aug 6 15:53:24 2009
@@ -200,13 +200,11 @@
/// required initializations.
void PIC16DbgInfo::BeginModule(Module &M) {
// Emit file directive for module.
- SmallVector<GlobalVariable *, 2> CUs;
- SmallVector<GlobalVariable *, 4> GVs;
- SmallVector<GlobalVariable *, 4> SPs;
- CollectDebugInfoAnchors(M, CUs, GVs, SPs);
- if (!CUs.empty()) {
+ DebugInfoFinder DbgFinder;
+ DbgFinder.processModule(M);
+ if (DbgFinder.compile_unit_count() != 0) {
// FIXME : What if more then one CUs are present in a module ?
- GlobalVariable *CU = CUs[0];
+ GlobalVariable *CU = *DbgFinder.compile_unit_begin();
EmitDebugDirectives = true;
SwitchToCU(CU);
}
@@ -431,15 +429,11 @@
/// EmitVarDebugInfo - Emit debug information for all variables.
///
void PIC16DbgInfo::EmitVarDebugInfo(Module &M) {
- SmallVector<GlobalVariable *, 2> CUs;
- SmallVector<GlobalVariable *, 4> GVs;
- SmallVector<GlobalVariable *, 4> SPs;
- CollectDebugInfoAnchors(M, CUs, GVs, SPs);
- if (GVs.empty())
- return;
+ DebugInfoFinder DbgFinder;
+ DbgFinder.processModule(M);
- for (SmallVector<GlobalVariable *, 4>::iterator I = GVs.begin(),
- E = GVs.end(); I != E; ++I) {
+ for (DebugInfoFinder::iterator I = DbgFinder.global_variable_begin(),
+ E = DbgFinder.global_variable_end(); I != E; ++I) {
DIGlobalVariable DIGV(*I);
DIType Ty = DIGV.getType();
unsigned short TypeNo = 0;
More information about the llvm-commits
mailing list