File: undefined.cc

package info (click to toggle)
oxref 0.90.10-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 400 kB
  • sloc: cpp: 786; makefile: 141
file content (39 lines) | stat: -rw-r--r-- 1,121 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "store.ih"

    // 00000000         *UND*  00000000 std::ios_base::Init::Init()
    //                                  ---------------------------

void Store::undefined(std::string const &symbol)
{
    // find 'symbol' in d_xrefData. 
    // If not yet available add it to xrefData.
    // Determine the symbol's index in xrefData
    // The function currently handled has a currentIdx and from that index
    // the current *UND* symbol is called.
                
    auto iter = find_if(
                    d_xrefData.begin(), d_xrefData.end(),
                    [&](XrefData const &xrefData)
                    {
                        return xrefData.hasSymbol(symbol);
                    }
                );
                  //  FnWrap::unary(XrefData::hasSymbol, symbol));

    size_t index = iter - d_xrefData.begin();   // index of this symbol

    if (iter == d_xrefData.end())               // symbol not yet defined
    {
        index = d_xrefData.size();
        d_xrefData.push_back(XrefData(symbol)); // define the symbol
    }

    d_xrefData[index].calledFrom(d_currentIdx);
}