Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
e90ae879
Commit
e90ae879
authored
Jun 26, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
autolib (#pragma lib)
added to 6g to autoload the included import files. SVN=124759
parent
3311e1b6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
gen.c
src/cmd/6g/gen.c
+0
-1
lex.c
src/cmd/gc/lex.c
+3
-1
subr.c
src/cmd/gc/subr.c
+13
-3
No files found.
src/cmd/6g/gen.c
View file @
e90ae879
...
...
@@ -28,7 +28,6 @@ compile(Node *fn)
return
;
lno
=
dynlineno
;
curfn
=
fn
;
dynlineno
=
curfn
->
lineno
;
// for diagnostics
dowidth
(
curfn
->
type
);
...
...
src/cmd/gc/lex.c
View file @
e90ae879
...
...
@@ -118,7 +118,8 @@ importfile(Val *f)
yyerror
(
"import statement not a string"
);
return
;
}
// BOTCH need to get .8 from backend
// BOTCH need to get .6 from backend
snprint
(
namebuf
,
sizeof
(
namebuf
),
"%Z.6"
,
f
->
sval
);
file
=
strdup
(
namebuf
);
linehist
(
file
,
0
);
...
...
@@ -126,6 +127,7 @@ importfile(Val *f)
imp
=
Bopen
(
file
,
OREAD
);
if
(
imp
==
nil
)
fatal
(
"cant open import: %s"
,
namebuf
);
linehist
(
file
,
-
1
);
// acts as #pragma lib
/*
* position the input right
...
...
src/cmd/gc/subr.c
View file @
e90ae879
...
...
@@ -64,13 +64,23 @@ void
linehist
(
char
*
file
,
long
off
)
{
Hist
*
h
;
char
*
cp
;
if
(
debug
[
'i'
])
if
(
file
!=
nil
)
print
(
"%L: import %s
\n
"
,
file
);
else
if
(
file
!=
nil
)
{
if
(
off
<
0
)
print
(
"%L: pragma %s
\n
"
,
file
);
else
print
(
"%L: import %s
\n
"
,
file
);
}
else
print
(
"%L: <eof>
\n
"
);
if
(
off
<
0
&&
file
[
0
]
!=
'/'
)
{
cp
=
mal
(
strlen
(
file
)
+
strlen
(
pathname
)
+
2
);
sprint
(
cp
,
"%s/%s"
,
pathname
,
file
);
file
=
cp
;
}
h
=
alloc
(
sizeof
(
Hist
));
h
->
name
=
file
;
h
->
line
=
lineno
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment